Repository navigation
Migrate ignition runtime patches and preparation onto public b12x contracts - #648
Merged
Merged
Conversation
…tracts
Why this change is needed and why this approach:
Ignition previously imported private b12x.*._* internals across 14 files under
ignition/runtime_patches/, ignition/preparation/, and ignition/components/.
Before this change, ignition/runtime_patches/workers.py monkey-patched
b12x._lib.compile_pool._initialize_worker directly to apply Triton patches in
worker processes, while ignition/preparation/{tuning,tuning_shards,collectives,
composition_tuning,forward_metadata,peer_storage,remote_weights,persistent,
virtual_storage,core_storage}.py reached into private session, cache, plan,
scratch, and loader modules. Migrating Ignition onto the public b12x worker
initializer hook and public preparation API removes monkey-patching and private
symbol coupling without changing Helios runtime code, Protobuf schemas, or
exported model core compatibility.
What changed:
- Worker initialization (ignition/runtime_patches/{__init__,triton,workers}.py):
- Before: workers.py replaced compile_pool._initialize_worker at runtime and
triton.py mutated private Triton/compile_pool hooks inline.
- After: workers.py registers and unregisters the Triton patcher through
b12x.preparation.register_worker_initializer and
unregister_worker_initializer.
- Preparation and components (ignition/preparation/{collectives,
composition_tuning,core_storage,forward_metadata,peer_storage,persistent,
remote_weights,tuning,tuning_shards,virtual_storage}.py and
ignition/components/engram.py):
- Before: imported private b12x.preparation.{_cache,_collective,_discovery,
_measurement}, b12x._lib.{compile_plan,compile_pool,scratch}, and private
session attributes (_check_thread, _synchronize, _cancelled, _cache,
_scratch_limit_bytes, _reclaim_programs).
- After: uses public b12x.preparation methods and functions (check_thread,
synchronize, is_cancelled(), selection_cache, scratch_limit,
reclaim_programs, SelectionCache.set_agreed_records, custom_plan,
is_composite_plan, plan_variants, plan_memory_requirements,
plan_compile_jobs) plus public b12x.comm.pcie, b12x.loader, and
b12x.sequence exports.
Claimed benefit and result:
- Measured: zero private b12x.*._* imports remain anywhere under ignition/
across all 14 modified files, and offline CompilePool worker initialization
executes registered Triton patches cleanly without monkey-patching private
functions.
- Expected: insulates Ignition preparation and runtime patches from internal
b12x module reorganization while keeping Helios and model-core compatibility
unchanged.
Supporting evidence and limitations:
- Tested against the paired flashinfer and hyperflare-recipes worktrees:
- tests/preparation/{test_runtime_patches,test_tuning_shards,
test_compile_pool,test_persistent}.py: 88 passed, 0 failed (including
test_b12x_offline_worker_installs_triton_fix_before_first_job).
- tests/preparation/{test_scratch,test_checkpoint_source,
test_unavailable_resources}.py (with test_runtime_patches and
test_tuning_shards): 121 passed, 1 skipped, 0 failed.
- End-to-end RecordedPreparationSession.tune() + CompilePool execution verified
on Blackwell SM120 GPU 0 via hyperflare-recipes window staging and window
attention CUDA tests.
- Material limitations: requires the paired local-inference-lab/flashinfer PR
(public b12x contracts) before merging/updating locked dependencies. Helios
Rust crates, TLA+ models, Kani proofs, and scheduling simulators were not run
because no files outside Python ignition/ were modified. Multi-GPU TP export
was not run on this single-GPU host.
Design-Signed-Off-By: Antigravity (Gemini); design-review=2e5b
Signed-off-by: Luke Alonso <lalonso@gmail.com>
Raydius
added a commit
to Raydius/flare-local-inference
that referenced
this pull request
Nov 30, 2026
Why: the stack now bases on upstream/main `e85019b9b`, whose preparation imports the public b12x contracts that upstream added with NVIDIA#648 - `declaration_key`, `custom_plan`, `coalesce_requests`, `CudaRTLibrary` and `hash_op`. The previous pin, `Raydius/flashinfer@d0301ec6` on upstream `335459b2`, predates them, so `ignition/preparation` raises ImportError at collection on the new base and the Python suites cannot run. What changed: `[tool.uv.sources] flashinfer-python` names `Raydius/flashinfer@cfc2c0d7254076275f0eb8ba201f250ebc78869e`, which is the fork's single eviction commit rebased onto upstream `274eb290` ("perf(b12x/comm): fuse addend in RoCE oneshot/twoshot, lower 4-rank pipe threshold, and guard gated all-gather (NVIDIA#190)"). The re-cut also brings the fork's carried `tests/experimental/b12x/preparation/test_first_use_compile.py` up to upstream's current memo: an activated preparation scope keys tensor and mapping arguments through the metadata pickle, so the two cache cases now assert what the mechanism does and the inventory guard records the five compile factories upstream added without a preparation scope. Result: the b12x import surface the migrated preparation requires is present, and the fork's planning-stub rejection still carries weight on the new base rather than being redundant with upstream's own `evict_planning_artifacts`, which runs before compilation instead of on the factory result. Evidence: on the pinned revision the carried file gives 23 passed; on unmodified `274eb290` the same file gives 2 failed, 21 passed, failing exactly `test_run_job_rejects_unresolved_planning_stub` and `test_compile_compress_memo_is_a_program_cache` - the FORK.md condition that the cases fail unmodified and pass pinned. Measured in `local/flare-ignition:08b3134a-e758d766` with GPU 1 (RTX 5060 Ti) visible. `uv lock --check` in the paired recipes repository resolves 105 packages against the same revision. Kani has not run: it is not installed on this host. Design-Signed-Off-By: omp (qllm/qLLM); design-review=2e5b
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.
Why
Ignition previously imported private
b12x.*._*internals across 14 files inignition/runtime_patches/,ignition/preparation/, andignition/components/. Before this change:ignition/runtime_patches/workers.pymonkey-patchedb12x._lib.compile_pool._initialize_workerat runtime to install Triton patches in offline worker processes.ignition/preparation/{collectives,composition_tuning,core_storage,forward_metadata,peer_storage,persistent,remote_weights,tuning,tuning_shards,virtual_storage}.pyandignition/components/engram.pyreached into privateb12x.preparation.{_cache,_collective,_discovery,_measurement},b12x._lib.{compile_plan,compile_pool,scratch}, and privatePreparationSessionattributes (_check_thread,_synchronize,_cancelled,_cache,_scratch_limit_bytes,_reclaim_programs).Paired with local-inference-lab/flashinfer#194, migrating Ignition onto the public
b12xworker-initializer hook and preparation API removes monkey-patching and private coupling while keeping Helios runtime code, Protobuf schemas, and exported model-core compatibility untouched.What Changed
ignition/runtime_patches/{__init__,triton,workers}.py):workers.pypatchedcompile_pool._initialize_workerdirectly andtriton.pymutated private worker hooks inline.workers.pyregisters and unregisters the Triton patcher throughb12x.preparation.register_worker_initializerandunregister_worker_initializer.ignition/preparation/{collectives,composition_tuning,core_storage,forward_metadata,peer_storage,persistent,remote_weights,tuning,tuning_shards,virtual_storage}.py,ignition/components/engram.py):b12x.*._*modules and accessed privatePreparationSession/SelectionCache/Planattributes directly.b12x.preparationAPIs (check_thread,synchronize,is_cancelled(),selection_cache,scratch_limit,reclaim_programs,SelectionCache.set_agreed_records,custom_plan,is_composite_plan,plan_variants,plan_memory_requirements,plan_compile_jobs, scratch/compile helpers) plus publicb12x.comm.pcie,b12x.loader, andb12x.sequenceexports.Claimed Benefit and Result
0privateb12x.*._*imports remain anywhere underignition/, and offlineCompilePoolworkers execute registered Triton patches before their first job without monkey-patching private functions.b12xrefactors without altering Helios or exported model cores.Supporting Evidence and Limitations
Tested against local-inference-lab/flashinfer#194 and the paired
local-inference-lab/hyperflare-recipesPR:tests/preparation/{test_runtime_patches,test_tuning_shards,test_compile_pool,test_persistent}.py: 88 passed, 0 failed (includingtest_b12x_offline_worker_installs_triton_fix_before_first_job).tests/preparation/{test_scratch,test_checkpoint_source,test_unavailable_resources}.py(run withtest_runtime_patchesandtest_tuning_shards): 121 passed, 1 skipped, 0 failed.RecordedPreparationSession.tune()+CompilePoolworker execution verified on Blackwell SM120 GPU 0 viahyperflare-recipeswindow staging and window attention CUDA tests.ignition/were changed.Discord: lukealonso