Skip to content

Move Pallas launchers into helion/runtime/pallas/launcher.py - #3182

Merged
AmesingFlank merged 1 commit into
mainfrom
AmesingFlank/stack/96
Jul 30, 2026
Merged

Move Pallas launchers into helion/runtime/pallas/launcher.py#3182
AmesingFlank merged 1 commit into
mainfrom
AmesingFlank/stack/96

Conversation

@AmesingFlank

@AmesingFlank AmesingFlank commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Stacked PRs:


Move Pallas launchers into helion/runtime/pallas/launcher.py

Relocate the entire Pallas launch + compile core (default_pallas_launcher, the
~40 _pallas_* block-spec / compile / cache helpers, _DirectCallKernel,
_LauncherFastPath, _PallasCompileResult, _PallasInterpretCallable, the
compact-worklist launcher path, and the torch<->jax converters) out of the
2500-line catch-all helion/runtime/__init__.py into a dedicated
helion/runtime/pallas/launcher.py (2388 lines moved).

Pure move: the only edits are re-basing the two relative imports one level deeper
(from .settings -> from ..settings, from .._compiler.backend ->
from ..._compiler.backend); every function body is unchanged.

helion.runtime re-exports default_pallas_launcher (generated Pallas code
imports it), and every direct importer of a moved symbol is repointed to the new
home: pallas_jax_export (7 _pallas_*/_BlockSpecInfo helpers),
_compiler/pallas/backend.py (_get_vmem_limit_bytes),
_compiler/pallas/compact_worklist.py (compact_ordered_physical_window),
test_pallas_compact_worklist (_get_vmem_limit_bytes, compact_ordered_*,
_compact_raise_if_range_exceeds_window), and test_pallas
(_build_matmul_dot_general_jit_fn, imported as the launcher module so the
patch.object spy still targets the launcher's namespace). Two stale
runtime._compact_raise_if_range_exceeds_window doc comments are updated. The
now-unused dataclass/Literal/TYPE_CHECKING/jax imports are dropped from
runtime/__init__.py.

Isolating this into one file (still importing a couple of helion helpers for
now) sets up making it torch+jax-only so the precompiler can bulk-export it.

Verified on the TPU pod: pallas add/topk, all 5 test_pallas.py jax_fn tests,
compact-worklist vmem/budget, resident-window-guard, and matmul-dot-general tests
pass; ruff/pyrefly clean (83 baseline); Triton add still correct on H100.
(One pre-existing TPU failure, test_jax_fn_under_jit_matches_eager, and the
interpret-mode add tests fail identically on the base commit -- pod JAX-version
skew, unrelated to this move.)

@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/95 branch from 301565b to e64ad7c Compare July 28, 2026 16:02
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/96 branch from 7cc19f5 to aa4871d 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/95 to main July 28, 2026 17:39
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/95 July 28, 2026 17:39
@AmesingFlank
AmesingFlank marked this pull request as ready for review July 28, 2026 17:51
@AmesingFlank
AmesingFlank marked this pull request as draft July 28, 2026 20:09
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/95 to main July 28, 2026 20:09
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/96 branch from aa4871d to 3742da2 Compare July 28, 2026 20:09
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/95 July 28, 2026 20:10
@AmesingFlank
AmesingFlank marked this pull request as ready for review July 28, 2026 20:10
@AmesingFlank
AmesingFlank marked this pull request as draft July 28, 2026 21:14
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/95 to main July 28, 2026 21:14
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/96 branch from 3742da2 to 8b3ec21 Compare July 28, 2026 21:14
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/95 July 29, 2026 09:04
@AmesingFlank
AmesingFlank marked this pull request as ready for review July 29, 2026 09:04
AmesingFlank added a commit that referenced this pull request Jul 29, 2026
Relocate the entire Pallas launch + compile core (`default_pallas_launcher`, the
~40 `_pallas_*` block-spec / compile / cache helpers, `_DirectCallKernel`,
`_LauncherFastPath`, `_PallasCompileResult`, `_PallasInterpretCallable`, the
compact-worklist launcher path, and the torch<->jax converters) out of the
2500-line catch-all `helion/runtime/__init__.py` into a dedicated
`helion/runtime/pallas/launcher.py` (2388 lines moved).

Pure move: the only edits are re-basing the two relative imports one level deeper
(`from .settings` -> `from ..settings`, `from .._compiler.backend` ->
`from ..._compiler.backend`); every function body is unchanged.

`helion.runtime` re-exports `default_pallas_launcher` (generated Pallas code
imports it), and every direct importer of a moved symbol is repointed to the new
home: `pallas_jax_export` (7 `_pallas_*`/`_BlockSpecInfo` helpers),
`_compiler/pallas/backend.py` (`_get_vmem_limit_bytes`),
`_compiler/pallas/compact_worklist.py` (`compact_ordered_physical_window`),
`test_pallas_compact_worklist` (`_get_vmem_limit_bytes`, `compact_ordered_*`,
`_compact_raise_if_range_exceeds_window`), and `test_pallas`
(`_build_matmul_dot_general_jit_fn`, imported as the launcher module so the
`patch.object` spy still targets the launcher's namespace). Two stale
`runtime._compact_raise_if_range_exceeds_window` doc comments are updated. The
now-unused `dataclass`/`Literal`/`TYPE_CHECKING`/`jax` imports are dropped from
`runtime/__init__.py`.

Isolating this into one file (still importing a couple of `helion` helpers for
now) sets up making it torch+jax-only so the precompiler can bulk-export it.

Verified on the TPU pod: pallas add/topk, all 5 `test_pallas.py` `jax_fn` tests,
compact-worklist vmem/budget, resident-window-guard, and matmul-dot-general tests
pass; `ruff`/`pyrefly` clean (83 baseline); Triton `add` still correct on H100.
(One pre-existing TPU failure, `test_jax_fn_under_jit_matches_eager`, and the
interpret-mode `add` tests fail identically on the base commit -- pod JAX-version
skew, unrelated to this move.)

stack-info: PR: #3182, branch: AmesingFlank/stack/96
@AmesingFlank
AmesingFlank marked this pull request as draft July 29, 2026 20:37
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/95 to main July 29, 2026 20:37
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/96 branch from 065a798 to c7a6ab1 Compare July 29, 2026 20:37
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/95 July 29, 2026 20:38
@AmesingFlank
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
Relocate the entire Pallas launch + compile core (`default_pallas_launcher`, the
~40 `_pallas_*` block-spec / compile / cache helpers, `_DirectCallKernel`,
`_LauncherFastPath`, `_PallasCompileResult`, `_PallasInterpretCallable`, the
compact-worklist launcher path, and the torch<->jax converters) out of the
2500-line catch-all `helion/runtime/__init__.py` into a dedicated
`helion/runtime/pallas/launcher.py` (2388 lines moved).

Pure move: the only edits are re-basing the two relative imports one level deeper
(`from .settings` -> `from ..settings`, `from .._compiler.backend` ->
`from ..._compiler.backend`); every function body is unchanged.

`helion.runtime` re-exports `default_pallas_launcher` (generated Pallas code
imports it), and every direct importer of a moved symbol is repointed to the new
home: `pallas_jax_export` (7 `_pallas_*`/`_BlockSpecInfo` helpers),
`_compiler/pallas/backend.py` (`_get_vmem_limit_bytes`),
`_compiler/pallas/compact_worklist.py` (`compact_ordered_physical_window`),
`test_pallas_compact_worklist` (`_get_vmem_limit_bytes`, `compact_ordered_*`,
`_compact_raise_if_range_exceeds_window`), and `test_pallas`
(`_build_matmul_dot_general_jit_fn`, imported as the launcher module so the
`patch.object` spy still targets the launcher's namespace). Two stale
`runtime._compact_raise_if_range_exceeds_window` doc comments are updated. The
now-unused `dataclass`/`Literal`/`TYPE_CHECKING`/`jax` imports are dropped from
`runtime/__init__.py`.

Isolating this into one file (still importing a couple of `helion` helpers for
now) sets up making it torch+jax-only so the precompiler can bulk-export it.

Verified on the TPU pod: pallas add/topk, all 5 `test_pallas.py` `jax_fn` tests,
compact-worklist vmem/budget, resident-window-guard, and matmul-dot-general tests
pass; `ruff`/`pyrefly` clean (83 baseline); Triton `add` still correct on H100.
(One pre-existing TPU failure, `test_jax_fn_under_jit_matches_eager`, and the
interpret-mode `add` tests fail identically on the base commit -- pod JAX-version
skew, unrelated to this move.)

stack-info: PR: #3182, branch: AmesingFlank/stack/96
@AmesingFlank
AmesingFlank marked this pull request as draft July 30, 2026 01:55
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/95 to main July 30, 2026 01:55
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/96 branch from c7a6ab1 to 7a96ae6 Compare July 30, 2026 01:56
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/95 July 30, 2026 01:56
@AmesingFlank
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
Relocate the entire Pallas launch + compile core (`default_pallas_launcher`, the
~40 `_pallas_*` block-spec / compile / cache helpers, `_DirectCallKernel`,
`_LauncherFastPath`, `_PallasCompileResult`, `_PallasInterpretCallable`, the
compact-worklist launcher path, and the torch<->jax converters) out of the
2500-line catch-all `helion/runtime/__init__.py` into a dedicated
`helion/runtime/pallas/launcher.py` (2388 lines moved).

Pure move: the only edits are re-basing the two relative imports one level deeper
(`from .settings` -> `from ..settings`, `from .._compiler.backend` ->
`from ..._compiler.backend`); every function body is unchanged.

`helion.runtime` re-exports `default_pallas_launcher` (generated Pallas code
imports it), and every direct importer of a moved symbol is repointed to the new
home: `pallas_jax_export` (7 `_pallas_*`/`_BlockSpecInfo` helpers),
`_compiler/pallas/backend.py` (`_get_vmem_limit_bytes`),
`_compiler/pallas/compact_worklist.py` (`compact_ordered_physical_window`),
`test_pallas_compact_worklist` (`_get_vmem_limit_bytes`, `compact_ordered_*`,
`_compact_raise_if_range_exceeds_window`), and `test_pallas`
(`_build_matmul_dot_general_jit_fn`, imported as the launcher module so the
`patch.object` spy still targets the launcher's namespace). Two stale
`runtime._compact_raise_if_range_exceeds_window` doc comments are updated. The
now-unused `dataclass`/`Literal`/`TYPE_CHECKING`/`jax` imports are dropped from
`runtime/__init__.py`.

Isolating this into one file (still importing a couple of `helion` helpers for
now) sets up making it torch+jax-only so the precompiler can bulk-export it.

Verified on the TPU pod: pallas add/topk, all 5 `test_pallas.py` `jax_fn` tests,
compact-worklist vmem/budget, resident-window-guard, and matmul-dot-general tests
pass; `ruff`/`pyrefly` clean (83 baseline); Triton `add` still correct on H100.
(One pre-existing TPU failure, `test_jax_fn_under_jit_matches_eager`, and the
interpret-mode `add` tests fail identically on the base commit -- pod JAX-version
skew, unrelated to this move.)

stack-info: PR: #3182, branch: AmesingFlank/stack/96
@AmesingFlank
AmesingFlank marked this pull request as draft July 30, 2026 02:43
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/95 to main July 30, 2026 02:43
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/96 branch from 7a96ae6 to 889a66f Compare July 30, 2026 02:43
@AmesingFlank
AmesingFlank changed the base branch from main to AmesingFlank/stack/94 July 30, 2026 02:43
@AmesingFlank
AmesingFlank marked this pull request as ready for review July 30, 2026 02:43
@AmesingFlank
AmesingFlank marked this pull request as draft July 30, 2026 03:17
@AmesingFlank
AmesingFlank changed the base branch from AmesingFlank/stack/94 to main July 30, 2026 03:17
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/96 branch from 889a66f to 307dfec Compare July 30, 2026 03:17
@AmesingFlank
AmesingFlank marked this pull request as ready for review July 30, 2026 03:17
Relocate the entire Pallas launch + compile core (`default_pallas_launcher`, the
~40 `_pallas_*` block-spec / compile / cache helpers, `_DirectCallKernel`,
`_LauncherFastPath`, `_PallasCompileResult`, `_PallasInterpretCallable`, the
compact-worklist launcher path, and the torch<->jax converters) out of the
2500-line catch-all `helion/runtime/__init__.py` into a dedicated
`helion/runtime/pallas/launcher.py` (2388 lines moved).

Pure move: the only edits are re-basing the two relative imports one level deeper
(`from .settings` -> `from ..settings`, `from .._compiler.backend` ->
`from ..._compiler.backend`); every function body is unchanged.

`helion.runtime` re-exports `default_pallas_launcher` (generated Pallas code
imports it), and every direct importer of a moved symbol is repointed to the new
home: `pallas_jax_export` (7 `_pallas_*`/`_BlockSpecInfo` helpers),
`_compiler/pallas/backend.py` (`_get_vmem_limit_bytes`),
`_compiler/pallas/compact_worklist.py` (`compact_ordered_physical_window`),
`test_pallas_compact_worklist` (`_get_vmem_limit_bytes`, `compact_ordered_*`,
`_compact_raise_if_range_exceeds_window`), and `test_pallas`
(`_build_matmul_dot_general_jit_fn`, imported as the launcher module so the
`patch.object` spy still targets the launcher's namespace). Two stale
`runtime._compact_raise_if_range_exceeds_window` doc comments are updated. The
now-unused `dataclass`/`Literal`/`TYPE_CHECKING`/`jax` imports are dropped from
`runtime/__init__.py`.

Isolating this into one file (still importing a couple of `helion` helpers for
now) sets up making it torch+jax-only so the precompiler can bulk-export it.

Verified on the TPU pod: pallas add/topk, all 5 `test_pallas.py` `jax_fn` tests,
compact-worklist vmem/budget, resident-window-guard, and matmul-dot-general tests
pass; `ruff`/`pyrefly` clean (83 baseline); Triton `add` still correct on H100.
(One pre-existing TPU failure, `test_jax_fn_under_jit_matches_eager`, and the
interpret-mode `add` tests fail identically on the base commit -- pod JAX-version
skew, unrelated to this move.)

stack-info: PR: #3182, branch: AmesingFlank/stack/96
@AmesingFlank
AmesingFlank marked this pull request as draft July 30, 2026 03:28
@AmesingFlank
AmesingFlank force-pushed the AmesingFlank/stack/96 branch from 307dfec to 45cc490 Compare July 30, 2026 03:29
@AmesingFlank
AmesingFlank marked this pull request as ready for review July 30, 2026 03:29
@AmesingFlank
AmesingFlank merged commit d39e6a1 into main Jul 30, 2026
24 checks passed
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.

2 participants