Skip to content

Embed in-kernel Pallas runtime helpers into generated code - #3187

Closed
AmesingFlank wants to merge 1 commit into
AmesingFlank/stack/104from
AmesingFlank/stack/101
Closed

Embed in-kernel Pallas runtime helpers into generated code#3187
AmesingFlank wants to merge 1 commit into
AmesingFlank/stack/104from
AmesingFlank/stack/101

Conversation

@AmesingFlank

@AmesingFlank AmesingFlank commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Stacked PRs:


Embed in-kernel Pallas runtime helpers into generated code

The generated Pallas kernel calls two helion-defined, pure-jax helpers --
divide_filter_topk (aten.topk lowering, via _helion_divide_filter_topk) and
flatten_worklist (compact-worklist builder) -- which were pulled in with
from helion... import ..., leaving a helion dependency that blocks
precompiling to a helion-free standalone.

Add a Backend.embedded_helper_source(body) hook (default "") that
BoundKernel.to_code injects between the imports and the kernel body. The
Pallas backend overrides it to inline the source of whichever helper body
references -- module docstring and from __future__ stripped by _embed_source
(located via ast, so a docstring containing a triple-quote can't corrupt the
output) -- plus a _helion_divide_filter_topk = divide_filter_topk alias. The
topk library_imports entry and the inline flatten_worklist import in
render_build_worklist are dropped. Both helper modules import only
jax/stdlib (and now carry a note to stay free of any helion import, which
would trip the precompiler's substring guard), so the embedded module stays
dependency-free. This runs for regular kernels too, keeping a single code path.

Tests: the two builder tests that exec the rendered _build_worklist now
supply flatten_worklist (no longer imported inline);
test_matching_kernel_generates_compact and test_topk_divide_and_filter_lowering
assert the embedded def + alias are present, the old helion import is gone, and
the module still ast.parses (guarding against a corrupt embed). Also repairs
the window-guard test's stale call to the 2-arg _get_vmem_limit_bytes.

Verified on TPU: topk (3 passed), compact guard/render/builder (10 passed); full
test_pallas_compact_worklist.py shows only the 6 pre-existing scratch_types
JAX-skew failures (identical to base), 66 passed. ruff/pyrefly clean (83
baseline); H100 Triton unaffected (embedded_helper_source is a no-op there).

@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/101 branch from b1bdb37 to f8af008 Compare July 28, 2026 16:02
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/100 branch from 201c9f5 to 5d5e92a Compare July 28, 2026 16:02
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 28, 2026
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/100 to main July 28, 2026 17:39
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/101 branch 2 times, most recently from 1c9cc90 to cdeadbd Compare July 28, 2026 17:39
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/100 July 28, 2026 17:39
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/100 to main July 28, 2026 20:09
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/101 branch from cdeadbd to 8dbbe62 Compare July 28, 2026 20:09
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/100 July 28, 2026 20:10
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/100 to main July 28, 2026 21:14
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/101 branch from 8dbbe62 to d2bed12 Compare July 28, 2026 21:14
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/100 July 28, 2026 21:15
AmesingFlank added a commit that referenced this pull request Jul 28, 2026
The generated Pallas kernel calls two helion-defined, pure-`jax` helpers --
`divide_filter_topk` (aten.topk lowering, via `_helion_divide_filter_topk`) and
`flatten_worklist` (compact-worklist builder) -- which were pulled in with
`from helion... import ...`, leaving a helion dependency that blocks
precompiling to a helion-free standalone.

Add a `Backend.embedded_helper_source(body)` hook (default `""`) that
`BoundKernel.to_code` injects between the imports and the kernel body. The
Pallas backend overrides it to inline the source of whichever helper `body`
references -- module docstring and `from __future__` stripped by `_embed_source`
(located via `ast`, so a docstring containing a triple-quote can't corrupt the
output) -- plus a `_helion_divide_filter_topk = divide_filter_topk` alias. The
topk `library_imports` entry and the inline `flatten_worklist` import in
`render_build_worklist` are dropped. Both helper modules import only
`jax`/stdlib (and now carry a note to stay free of any `helion` import, which
would trip the precompiler's substring guard), so the embedded module stays
dependency-free. This runs for regular kernels too, keeping a single code path.

Tests: the two builder tests that `exec` the rendered `_build_worklist` now
supply `flatten_worklist` (no longer imported inline);
`test_matching_kernel_generates_compact` and `test_topk_divide_and_filter_lowering`
assert the embedded def + alias are present, the old helion import is gone, and
the module still `ast.parse`s (guarding against a corrupt embed). Also repairs
the window-guard test's stale call to the 2-arg `_get_vmem_limit_bytes`.

Verified on TPU: topk (3 passed), compact guard/render/builder (10 passed); full
`test_pallas_compact_worklist.py` shows only the 6 pre-existing `scratch_types`
JAX-skew failures (identical to base), 66 passed. `ruff`/`pyrefly` clean (83
baseline); H100 Triton unaffected (`embedded_helper_source` is a no-op there).

stack-info: PR: #3187, branch: AmesingFlank/stack/101
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/100 to main July 28, 2026 22:27
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/101 branch from d2bed12 to 1efda11 Compare July 28, 2026 22:27
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/100 July 28, 2026 22:27
AmesingFlank added a commit that referenced this pull request Jul 29, 2026
The generated Pallas kernel calls two helion-defined, pure-`jax` helpers --
`divide_filter_topk` (aten.topk lowering, via `_helion_divide_filter_topk`) and
`flatten_worklist` (compact-worklist builder) -- which were pulled in with
`from helion... import ...`, leaving a helion dependency that blocks
precompiling to a helion-free standalone.

Add a `Backend.embedded_helper_source(body)` hook (default `""`) that
`BoundKernel.to_code` injects between the imports and the kernel body. The
Pallas backend overrides it to inline the source of whichever helper `body`
references -- module docstring and `from __future__` stripped by `_embed_source`
(located via `ast`, so a docstring containing a triple-quote can't corrupt the
output) -- plus a `_helion_divide_filter_topk = divide_filter_topk` alias. The
topk `library_imports` entry and the inline `flatten_worklist` import in
`render_build_worklist` are dropped. Both helper modules import only
`jax`/stdlib (and now carry a note to stay free of any `helion` import, which
would trip the precompiler's substring guard), so the embedded module stays
dependency-free. This runs for regular kernels too, keeping a single code path.

Tests: the two builder tests that `exec` the rendered `_build_worklist` now
supply `flatten_worklist` (no longer imported inline);
`test_matching_kernel_generates_compact` and `test_topk_divide_and_filter_lowering`
assert the embedded def + alias are present, the old helion import is gone, and
the module still `ast.parse`s (guarding against a corrupt embed). Also repairs
the window-guard test's stale call to the 2-arg `_get_vmem_limit_bytes`.

Verified on TPU: topk (3 passed), compact guard/render/builder (10 passed); full
`test_pallas_compact_worklist.py` shows only the 6 pre-existing `scratch_types`
JAX-skew failures (identical to base), 66 passed. `ruff`/`pyrefly` clean (83
baseline); H100 Triton unaffected (`embedded_helper_source` is a no-op there).

stack-info: PR: #3187, branch: AmesingFlank/stack/101
AmesingFlank added a commit that referenced this pull request Jul 29, 2026
The generated Pallas kernel calls two helion-defined, pure-`jax` helpers --
`divide_filter_topk` (aten.topk lowering, via `_helion_divide_filter_topk`) and
`flatten_worklist` (compact-worklist builder) -- which were pulled in with
`from helion... import ...`, leaving a helion dependency that blocks
precompiling to a helion-free standalone.

Add a `Backend.embedded_helper_source(body)` hook (default `""`) that
`BoundKernel.to_code` injects between the imports and the kernel body. The
Pallas backend overrides it to inline the source of whichever helper `body`
references -- module docstring and `from __future__` stripped by `_embed_source`
(located via `ast`, so a docstring containing a triple-quote can't corrupt the
output) -- plus a `_helion_divide_filter_topk = divide_filter_topk` alias. The
topk `library_imports` entry and the inline `flatten_worklist` import in
`render_build_worklist` are dropped. Both helper modules import only
`jax`/stdlib (and now carry a note to stay free of any `helion` import, which
would trip the precompiler's substring guard), so the embedded module stays
dependency-free. This runs for regular kernels too, keeping a single code path.

Tests: the two builder tests that `exec` the rendered `_build_worklist` now
supply `flatten_worklist` (no longer imported inline);
`test_matching_kernel_generates_compact` and `test_topk_divide_and_filter_lowering`
assert the embedded def + alias are present, the old helion import is gone, and
the module still `ast.parse`s (guarding against a corrupt embed). Also repairs
the window-guard test's stale call to the 2-arg `_get_vmem_limit_bytes`.

Verified on TPU: topk (3 passed), compact guard/render/builder (10 passed); full
`test_pallas_compact_worklist.py` shows only the 6 pre-existing `scratch_types`
JAX-skew failures (identical to base), 66 passed. `ruff`/`pyrefly` clean (83
baseline); H100 Triton unaffected (`embedded_helper_source` is a no-op there).

stack-info: PR: #3187, branch: AmesingFlank/stack/101
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/100 to main July 29, 2026 09:04
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/101 branch from 9b5944d to e8b5964 Compare July 29, 2026 09:04
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/100 July 29, 2026 09:04
AmesingFlank added a commit that referenced this pull request Jul 29, 2026
The generated Pallas kernel calls two helion-defined, pure-`jax` helpers --
`divide_filter_topk` (aten.topk lowering, via `_helion_divide_filter_topk`) and
`flatten_worklist` (compact-worklist builder) -- which were pulled in with
`from helion... import ...`, leaving a helion dependency that blocks
precompiling to a helion-free standalone.

Add a `Backend.embedded_helper_source(body)` hook (default `""`) that
`BoundKernel.to_code` injects between the imports and the kernel body. The
Pallas backend overrides it to inline the source of whichever helper `body`
references -- module docstring and `from __future__` stripped by `_embed_source`
(located via `ast`, so a docstring containing a triple-quote can't corrupt the
output) -- plus a `_helion_divide_filter_topk = divide_filter_topk` alias. The
topk `library_imports` entry and the inline `flatten_worklist` import in
`render_build_worklist` are dropped. Both helper modules import only
`jax`/stdlib (and now carry a note to stay free of any `helion` import, which
would trip the precompiler's substring guard), so the embedded module stays
dependency-free. This runs for regular kernels too, keeping a single code path.

Tests: the two builder tests that `exec` the rendered `_build_worklist` now
supply `flatten_worklist` (no longer imported inline);
`test_matching_kernel_generates_compact` and `test_topk_divide_and_filter_lowering`
assert the embedded def + alias are present, the old helion import is gone, and
the module still `ast.parse`s (guarding against a corrupt embed). Also repairs
the window-guard test's stale call to the 2-arg `_get_vmem_limit_bytes`.

Verified on TPU: topk (3 passed), compact guard/render/builder (10 passed); full
`test_pallas_compact_worklist.py` shows only the 6 pre-existing `scratch_types`
JAX-skew failures (identical to base), 66 passed. `ruff`/`pyrefly` clean (83
baseline); H100 Triton unaffected (`embedded_helper_source` is a no-op there).

stack-info: PR: #3187, branch: AmesingFlank/stack/101
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/100 to main July 29, 2026 20:37
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/101 branch from e8b5964 to da14cb6 Compare July 29, 2026 20:37
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/100 July 29, 2026 20:38
AmesingFlank added a commit that referenced this pull request Jul 30, 2026
The generated Pallas kernel calls two helion-defined, pure-`jax` helpers --
`divide_filter_topk` (aten.topk lowering, via `_helion_divide_filter_topk`) and
`flatten_worklist` (compact-worklist builder) -- which were pulled in with
`from helion... import ...`, leaving a helion dependency that blocks
precompiling to a helion-free standalone.

Add a `Backend.embedded_helper_source(body)` hook (default `""`) that
`BoundKernel.to_code` injects between the imports and the kernel body. The
Pallas backend overrides it to inline the source of whichever helper `body`
references -- module docstring and `from __future__` stripped by `_embed_source`
(located via `ast`, so a docstring containing a triple-quote can't corrupt the
output) -- plus a `_helion_divide_filter_topk = divide_filter_topk` alias. The
topk `library_imports` entry and the inline `flatten_worklist` import in
`render_build_worklist` are dropped. Both helper modules import only
`jax`/stdlib (and now carry a note to stay free of any `helion` import, which
would trip the precompiler's substring guard), so the embedded module stays
dependency-free. This runs for regular kernels too, keeping a single code path.

Tests: the two builder tests that `exec` the rendered `_build_worklist` now
supply `flatten_worklist` (no longer imported inline);
`test_matching_kernel_generates_compact` and `test_topk_divide_and_filter_lowering`
assert the embedded def + alias are present, the old helion import is gone, and
the module still `ast.parse`s (guarding against a corrupt embed). Also repairs
the window-guard test's stale call to the 2-arg `_get_vmem_limit_bytes`.

Verified on TPU: topk (3 passed), compact guard/render/builder (10 passed); full
`test_pallas_compact_worklist.py` shows only the 6 pre-existing `scratch_types`
JAX-skew failures (identical to base), 66 passed. `ruff`/`pyrefly` clean (83
baseline); H100 Triton unaffected (`embedded_helper_source` is a no-op there).

stack-info: PR: #3187, branch: AmesingFlank/stack/101
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/100 to main July 30, 2026 01:56
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/101 branch from da14cb6 to 8a33994 Compare July 30, 2026 01:56
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/100 July 30, 2026 01:56
AmesingFlank added a commit that referenced this pull request Jul 30, 2026
The generated Pallas kernel calls two helion-defined, pure-`jax` helpers --
`divide_filter_topk` (aten.topk lowering, via `_helion_divide_filter_topk`) and
`flatten_worklist` (compact-worklist builder) -- which were pulled in with
`from helion... import ...`, leaving a helion dependency that blocks
precompiling to a helion-free standalone.

Add a `Backend.embedded_helper_source(body)` hook (default `""`) that
`BoundKernel.to_code` injects between the imports and the kernel body. The
Pallas backend overrides it to inline the source of whichever helper `body`
references -- module docstring and `from __future__` stripped by `_embed_source`
(located via `ast`, so a docstring containing a triple-quote can't corrupt the
output) -- plus a `_helion_divide_filter_topk = divide_filter_topk` alias. The
topk `library_imports` entry and the inline `flatten_worklist` import in
`render_build_worklist` are dropped. Both helper modules import only
`jax`/stdlib (and now carry a note to stay free of any `helion` import, which
would trip the precompiler's substring guard), so the embedded module stays
dependency-free. This runs for regular kernels too, keeping a single code path.

Tests: the two builder tests that `exec` the rendered `_build_worklist` now
supply `flatten_worklist` (no longer imported inline);
`test_matching_kernel_generates_compact` and `test_topk_divide_and_filter_lowering`
assert the embedded def + alias are present, the old helion import is gone, and
the module still `ast.parse`s (guarding against a corrupt embed). Also repairs
the window-guard test's stale call to the 2-arg `_get_vmem_limit_bytes`.

Verified on TPU: topk (3 passed), compact guard/render/builder (10 passed); full
`test_pallas_compact_worklist.py` shows only the 6 pre-existing `scratch_types`
JAX-skew failures (identical to base), 66 passed. `ruff`/`pyrefly` clean (83
baseline); H100 Triton unaffected (`embedded_helper_source` is a no-op there).

stack-info: PR: #3187, branch: AmesingFlank/stack/101
AmesingFlank added a commit that referenced this pull request Jul 30, 2026
The generated Pallas kernel calls two helion-defined, pure-`jax` helpers --
`divide_filter_topk` (aten.topk lowering, via `_helion_divide_filter_topk`) and
`flatten_worklist` (compact-worklist builder) -- which were pulled in with
`from helion... import ...`, leaving a helion dependency that blocks
precompiling to a helion-free standalone.

Add a `Backend.embedded_helper_source(body)` hook (default `""`) that
`BoundKernel.to_code` injects between the imports and the kernel body. The
Pallas backend overrides it to inline the source of whichever helper `body`
references -- module docstring and `from __future__` stripped by `_embed_source`
(located via `ast`, so a docstring containing a triple-quote can't corrupt the
output) -- plus a `_helion_divide_filter_topk = divide_filter_topk` alias. The
topk `library_imports` entry and the inline `flatten_worklist` import in
`render_build_worklist` are dropped. Both helper modules import only
`jax`/stdlib (and now carry a note to stay free of any `helion` import, which
would trip the precompiler's substring guard), so the embedded module stays
dependency-free. This runs for regular kernels too, keeping a single code path.

Tests: the two builder tests that `exec` the rendered `_build_worklist` now
supply `flatten_worklist` (no longer imported inline);
`test_matching_kernel_generates_compact` and `test_topk_divide_and_filter_lowering`
assert the embedded def + alias are present, the old helion import is gone, and
the module still `ast.parse`s (guarding against a corrupt embed). Also repairs
the window-guard test's stale call to the 2-arg `_get_vmem_limit_bytes`.

Verified on TPU: topk (3 passed), compact guard/render/builder (10 passed); full
`test_pallas_compact_worklist.py` shows only the 6 pre-existing `scratch_types`
JAX-skew failures (identical to base), 66 passed. `ruff`/`pyrefly` clean (83
baseline); H100 Triton unaffected (`embedded_helper_source` is a no-op there).

stack-info: PR: #3187, branch: AmesingFlank/stack/101
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/100 to main July 30, 2026 02:43
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/101 branch from 8a33994 to cd771fb Compare July 30, 2026 02:43
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/104 July 30, 2026 02:43
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/104 to main July 30, 2026 03:17
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/101 branch from cd771fb to 3517194 Compare July 30, 2026 03:17
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/104 July 30, 2026 03:17
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/104 to main July 30, 2026 03:28
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/101 branch from 3517194 to 0763855 Compare July 30, 2026 03:29
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/104 July 30, 2026 03:29
The generated Pallas kernel calls two helion-defined, pure-`jax` helpers --
`divide_filter_topk` (aten.topk lowering, via `_helion_divide_filter_topk`) and
`flatten_worklist` (compact-worklist builder) -- which were pulled in with
`from helion... import ...`, leaving a helion dependency that blocks
precompiling to a helion-free standalone.

Add a `Backend.embedded_helper_source(body)` hook (default `""`) that
`BoundKernel.to_code` injects between the imports and the kernel body. The
Pallas backend overrides it to inline the source of whichever helper `body`
references -- module docstring and `from __future__` stripped by `_embed_source`
(located via `ast`, so a docstring containing a triple-quote can't corrupt the
output) -- plus a `_helion_divide_filter_topk = divide_filter_topk` alias. The
topk `library_imports` entry and the inline `flatten_worklist` import in
`render_build_worklist` are dropped. Both helper modules import only
`jax`/stdlib (and now carry a note to stay free of any `helion` import, which
would trip the precompiler's substring guard), so the embedded module stays
dependency-free. This runs for regular kernels too, keeping a single code path.

Tests: the two builder tests that `exec` the rendered `_build_worklist` now
supply `flatten_worklist` (no longer imported inline);
`test_matching_kernel_generates_compact` and `test_topk_divide_and_filter_lowering`
assert the embedded def + alias are present, the old helion import is gone, and
the module still `ast.parse`s (guarding against a corrupt embed). Also repairs
the window-guard test's stale call to the 2-arg `_get_vmem_limit_bytes`.

Verified on TPU: topk (3 passed), compact guard/render/builder (10 passed); full
`test_pallas_compact_worklist.py` shows only the 6 pre-existing `scratch_types`
JAX-skew failures (identical to base), 66 passed. `ruff`/`pyrefly` clean (83
baseline); H100 Triton unaffected (`embedded_helper_source` is a no-op there).

stack-info: PR: #3187, branch: AmesingFlank/stack/101
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/104 to main July 30, 2026 03:47
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/101 branch from 0763855 to 70f46f9 Compare July 30, 2026 03:47
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/104 July 30, 2026 03:48
AmesingFlank added a commit that referenced this pull request Jul 30, 2026
The generated Pallas kernel calls two helion-defined, pure-`jax` helpers --
`divide_filter_topk` (aten.topk lowering, via `_helion_divide_filter_topk`) and
`flatten_worklist` (compact-worklist builder) -- which were pulled in with
`from helion... import ...`, leaving a helion dependency that blocks
precompiling to a helion-free standalone.

Add a `Backend.embedded_helper_source(body)` hook (default `""`) that
`BoundKernel.to_code` injects between the imports and the kernel body. The
Pallas backend overrides it to inline the source of whichever helper `body`
references -- module docstring and `from __future__` stripped by `_embed_source`
(located via `ast`, so a docstring containing a triple-quote can't corrupt the
output) -- plus a `_helion_divide_filter_topk = divide_filter_topk` alias. The
topk `library_imports` entry and the inline `flatten_worklist` import in
`render_build_worklist` are dropped. Both helper modules import only
`jax`/stdlib (and now carry a note to stay free of any `helion` import, which
would trip the precompiler's substring guard), so the embedded module stays
dependency-free. This runs for regular kernels too, keeping a single code path.

Tests: the two builder tests that `exec` the rendered `_build_worklist` now
supply `flatten_worklist` (no longer imported inline);
`test_matching_kernel_generates_compact` and `test_topk_divide_and_filter_lowering`
assert the embedded def + alias are present, the old helion import is gone, and
the module still `ast.parse`s (guarding against a corrupt embed). Also repairs
the window-guard test's stale call to the 2-arg `_get_vmem_limit_bytes`.

Verified on TPU: topk (3 passed), compact guard/render/builder (10 passed); full
`test_pallas_compact_worklist.py` shows only the 6 pre-existing `scratch_types`
JAX-skew failures (identical to base), 66 passed. `ruff`/`pyrefly` clean (83
baseline); H100 Triton unaffected (`embedded_helper_source` is a no-op there).

stack-info: PR: #3187, branch: AmesingFlank/stack/101
@AmesingFlank

Copy link
Copy Markdown
Contributor Author

Folded into #3184. In-kernel Pallas helper embedding (divide_filter_topk / flatten_worklist) is now a dependency-free-only step inside to_code(allow_helion_deps=False) (via embedded_helper_source, called only by the standalone builders) rather than an always-on pass over every to_code. Regular output imports the helpers from helion; only standalones embed them. The helper-module notes and the _get_vmem_limit_bytes test fix moved into #3184, so this standalone commit is no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant