Make the Pallas launcher dependency-free (torch + jax only) - #3183
Merged
Conversation
AmesingFlank
force-pushed
the
AmesingFlank/stack/96
branch
from
July 28, 2026 16:02
7cc19f5 to
aa4871d
Compare
AmesingFlank
force-pushed
the
AmesingFlank/stack/97
branch
from
July 28, 2026 16:02
c6b5c2a to
1003016
Compare
This was referenced Jul 28, 2026
This was referenced Jul 28, 2026
AmesingFlank
marked this pull request as ready for review
July 28, 2026 17:50
norx1991
approved these changes
Jul 28, 2026
AmesingFlank
marked this pull request as draft
July 28, 2026 20:09
AmesingFlank
force-pushed
the
AmesingFlank/stack/97
branch
from
July 28, 2026 20:09
1003016 to
6b6459d
Compare
AmesingFlank
marked this pull request as ready for review
July 28, 2026 20:10
AmesingFlank
marked this pull request as draft
July 28, 2026 21:14
AmesingFlank
marked this pull request as draft
July 29, 2026 20:37
AmesingFlank
force-pushed
the
AmesingFlank/stack/97
branch
from
July 29, 2026 20:37
3f6f8c5 to
161fb9d
Compare
AmesingFlank
marked this pull request as ready for review
July 29, 2026 20:38
AmesingFlank
added a commit
that referenced
this pull request
Jul 30, 2026
`helion/runtime/pallas/launcher.py` now imports only torch + jax (+ stdlib) --
no other `helion` module -- so the precompiler can bulk-export it into a
standalone Pallas kernel with zero Helion runtime dependency. Two helion deps
are severed:
- `_PALLAS_UNSUPPORTED_DTYPES` (the {int64,uint64,float64} frozenset TPU can't
lower) moves from `helion/_compiler/backend.py` -- which only defined it for
the launcher's import; nothing else used it -- into the launcher.
- `is_pallas_interpret` (from `helion.runtime.settings`) is replaced by a
dep-free `_pallas_interpret_enabled()` env-var read at the launcher's own
runtime call sites (the two `default_pallas_launcher` install-path fallbacks),
where no `CompileEnvironment` is active so `is_pallas_interpret` already
reduces to that env var (`Settings.pallas_interpret` itself defaults from it).
`_get_vmem_limit_bytes` is called both at runtime (launcher) and at compile time
(`_compiler/pallas/backend.py`, where a `CompileEnvironment` IS active), so
rather than have it read the env var it now takes `interpret` as a parameter:
the compiler passes `env.settings.pallas_interpret` (honoring decorator-set
interpret) and the launcher passes `_pallas_interpret_enabled()`. This keeps the
launcher dependency-free with no behavior change at either site -- mirroring how
the launcher install path already threads `_pallas_interpret` as a kwarg.
Verified on the TPU pod: non-interpret pallas add/topk/jax_fn and the
compact-worklist window/budget/guard/matmul tests pass; the launcher imports only
torch+jax. `ruff`/`pyrefly` clean (83 baseline); Triton `add` still correct on
H100. (Interpret-mode `add` tests fail identically on the base commit -- a
pre-existing pod JAX-version issue, not from this change.)
stack-info: PR: #3183, branch: AmesingFlank/stack/97
AmesingFlank
marked this pull request as draft
July 30, 2026 01:55
AmesingFlank
force-pushed
the
AmesingFlank/stack/97
branch
from
July 30, 2026 01:56
161fb9d to
c87972c
Compare
AmesingFlank
marked this pull request as ready for review
July 30, 2026 01:56
AmesingFlank
added a commit
that referenced
this pull request
Jul 30, 2026
`helion/runtime/pallas/launcher.py` now imports only torch + jax (+ stdlib) --
no other `helion` module -- so the precompiler can bulk-export it into a
standalone Pallas kernel with zero Helion runtime dependency. Two helion deps
are severed:
- `_PALLAS_UNSUPPORTED_DTYPES` (the {int64,uint64,float64} frozenset TPU can't
lower) moves from `helion/_compiler/backend.py` -- which only defined it for
the launcher's import; nothing else used it -- into the launcher.
- `is_pallas_interpret` (from `helion.runtime.settings`) is replaced by a
dep-free `_pallas_interpret_enabled()` env-var read at the launcher's own
runtime call sites (the two `default_pallas_launcher` install-path fallbacks),
where no `CompileEnvironment` is active so `is_pallas_interpret` already
reduces to that env var (`Settings.pallas_interpret` itself defaults from it).
`_get_vmem_limit_bytes` is called both at runtime (launcher) and at compile time
(`_compiler/pallas/backend.py`, where a `CompileEnvironment` IS active), so
rather than have it read the env var it now takes `interpret` as a parameter:
the compiler passes `env.settings.pallas_interpret` (honoring decorator-set
interpret) and the launcher passes `_pallas_interpret_enabled()`. This keeps the
launcher dependency-free with no behavior change at either site -- mirroring how
the launcher install path already threads `_pallas_interpret` as a kwarg.
Verified on the TPU pod: non-interpret pallas add/topk/jax_fn and the
compact-worklist window/budget/guard/matmul tests pass; the launcher imports only
torch+jax. `ruff`/`pyrefly` clean (83 baseline); Triton `add` still correct on
H100. (Interpret-mode `add` tests fail identically on the base commit -- a
pre-existing pod JAX-version issue, not from this change.)
stack-info: PR: #3183, branch: AmesingFlank/stack/97
AmesingFlank
marked this pull request as draft
July 30, 2026 02:43
AmesingFlank
force-pushed
the
AmesingFlank/stack/97
branch
from
July 30, 2026 02:43
c87972c to
a611585
Compare
AmesingFlank
marked this pull request as ready for review
July 30, 2026 02:43
AmesingFlank
marked this pull request as draft
July 30, 2026 03:17
AmesingFlank
force-pushed
the
AmesingFlank/stack/97
branch
from
July 30, 2026 03:17
a611585 to
44c2433
Compare
AmesingFlank
marked this pull request as ready for review
July 30, 2026 03:17
AmesingFlank
marked this pull request as draft
July 30, 2026 03:28
AmesingFlank
force-pushed
the
AmesingFlank/stack/97
branch
from
July 30, 2026 03:29
44c2433 to
0cb409a
Compare
AmesingFlank
marked this pull request as ready for review
July 30, 2026 03:29
`helion/runtime/pallas/launcher.py` now imports only torch + jax (+ stdlib) --
no other `helion` module -- so the precompiler can bulk-export it into a
standalone Pallas kernel with zero Helion runtime dependency. Two helion deps
are severed:
- `_PALLAS_UNSUPPORTED_DTYPES` (the {int64,uint64,float64} frozenset TPU can't
lower) moves from `helion/_compiler/backend.py` -- which only defined it for
the launcher's import; nothing else used it -- into the launcher.
- `is_pallas_interpret` (from `helion.runtime.settings`) is replaced by a
dep-free `_pallas_interpret_enabled()` env-var read at the launcher's own
runtime call sites (the two `default_pallas_launcher` install-path fallbacks),
where no `CompileEnvironment` is active so `is_pallas_interpret` already
reduces to that env var (`Settings.pallas_interpret` itself defaults from it).
`_get_vmem_limit_bytes` is called both at runtime (launcher) and at compile time
(`_compiler/pallas/backend.py`, where a `CompileEnvironment` IS active), so
rather than have it read the env var it now takes `interpret` as a parameter:
the compiler passes `env.settings.pallas_interpret` (honoring decorator-set
interpret) and the launcher passes `_pallas_interpret_enabled()`. This keeps the
launcher dependency-free with no behavior change at either site -- mirroring how
the launcher install path already threads `_pallas_interpret` as a kwarg.
Verified on the TPU pod: non-interpret pallas add/topk/jax_fn and the
compact-worklist window/budget/guard/matmul tests pass; the launcher imports only
torch+jax. `ruff`/`pyrefly` clean (83 baseline); Triton `add` still correct on
H100. (Interpret-mode `add` tests fail identically on the base commit -- a
pre-existing pod JAX-version issue, not from this change.)
stack-info: PR: #3183, branch: AmesingFlank/stack/97
AmesingFlank
marked this pull request as draft
July 30, 2026 03:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked PRs:
OutputCodeOptions(jax_fn=True)for Pallas (JAX-array entrypoints) #3186OutputCodeOptions(allow_helion_deps=False)for the Pallas backend (TorchTPU) #3184OutputCodeOptions(allow_helion_deps=False)toBoundKernel.to_codefor standalone Triton kernels #3181Make the Pallas launcher dependency-free (torch + jax only)
helion/runtime/pallas/launcher.pynow imports only torch + jax (+ stdlib) --no other
helionmodule -- so the precompiler can bulk-export it into astandalone Pallas kernel with zero Helion runtime dependency. Two helion deps
are severed:
_PALLAS_UNSUPPORTED_DTYPES(the {int64,uint64,float64} frozenset TPU can'tlower) moves from
helion/_compiler/backend.py-- which only defined it forthe launcher's import; nothing else used it -- into the launcher.
is_pallas_interpret(fromhelion.runtime.settings) is replaced by adep-free
_pallas_interpret_enabled()env-var read at the launcher's ownruntime call sites (the two
default_pallas_launcherinstall-path fallbacks),where no
CompileEnvironmentis active sois_pallas_interpretalreadyreduces to that env var (
Settings.pallas_interpretitself defaults from it)._get_vmem_limit_bytesis called both at runtime (launcher) and at compile time(
_compiler/pallas/backend.py, where aCompileEnvironmentIS active), sorather than have it read the env var it now takes
interpretas a parameter:the compiler passes
env.settings.pallas_interpret(honoring decorator-setinterpret) and the launcher passes
_pallas_interpret_enabled(). This keeps thelauncher dependency-free with no behavior change at either site -- mirroring how
the launcher install path already threads
_pallas_interpretas a kwarg.Verified on the TPU pod: non-interpret pallas add/topk/jax_fn and the
compact-worklist window/budget/guard/matmul tests pass; the launcher imports only
torch+jax.
ruff/pyreflyclean (83 baseline); Tritonaddstill correct onH100. (Interpret-mode
addtests fail identically on the base commit -- apre-existing pod JAX-version issue, not from this change.)