Opened by a workflow run, Dec 1, 2026 5:26 PM EST. decide malicious: all_clear (100%): No malicious content found
explore
Author: lukealonso (COLLABORATOR; charter-listed priority contributor; 36 merged PRs in 180 days; Discord: lukealonso)
Motivation: Multi-host preparation (ignition export --ranks N + ignition join, and multi-host debug-serve) still fails on 2x DGX Spark GB10: after tuning, ranks pick different kernels for the same request and agree_selections aborts every retry (issue #651). This PR makes reconcile_selections match by request name so peers adopt rank zero's picks, ships rank zero's recipe b12x_environment and each peer's own kernel_cache path to peer hosts, and hardens ForwardCache keying/persistence/corrupt-load recovery.
Scale: +423 / −44 in 8 files (4 source, 4 test), no docs, no Rust.
Proposal:
collectives.py:_selected_plan_catalognow emits(name, variant, component_id)next toportable_declaration;reconcile_selectionsmatches shared request names first and falls back to declaration matching, using onetarget_forfor bothchangedandconfigs.host_ranks.py:HostRendezvous(b12x_environment=...)validated (B12X_ only, noB12X_COMPILE_CACHE_DIR, str values), sent to peers before assignment unpickling and again inside the assignment;serve_peerapplies it and remapsconfig.kernel_cacheto the peer's local path, forwardingkernel_cacheintoexport_options.serve.py: 3 wiring lines (_export_hosts,debug_servepassmodel.recipe.b12x_environment;joinpassesconfiguration.directory("kernel_cache")).aot.py: forward-cache root key includes sorted execution-relevantB12X_*env (14 host-local/logging names excluded); atomic.binsaves via temp +os.replace;_load(required=False)unlinks corrupt archives and returnsNone.- Tests: synthetic 2-rank Gloo reconcile test, env/kernel-cache
serve_peertest, 3 ForwardCache tests, test-double fix in artifact sharing. Touches: ignition/preparation/aot.py(shared ForwardCache keying/saving; overlaps open #597/#639/#314)ignition/preparation/host_ranks.py(peer export path; overlaps same-author open #667)ignition/preparation/collectives.py(rewrites the reconcile path #647 introduced) Related items:- #651 Multi-host default autotune still fails kernel agreement after #631 (open): the issue this PR fixes; names this PR's approach
- #631 Multi-host autotune: rank selection divergence recurs on every retry (closed): predecessor issue, closed by #647, reproduced after close by pfn
- #647 Fix externalized core signing… multi-host tuning (merged): introduced the declaration-keyed reconcile this PR replaces
- #667 Harden Orbit payload integrity… (open, same author): edits the same peer export path in host_ranks.py
- #597 Key compiled forward sharing and Inductor validation by GPU name (open): rewrites
_share_artifacts/ForwardCachekeying in aot.py Link: https://github.com/NVIDIA/hyperflare-inference/pull/668 Autobot comments: CI on head d4d7b2d is pending, with zero reviews and zero comments. The repo CPU workflow runspytest tests/ -qbut installs flashinfer fromlocal-inference-lab/flashinfer@main, so the paired flashinfer#199 is not part of this PR's verification. The new divergence test is synthetic (SimpleNamespaceconfigs 1 and 2), not the GLM-5.3 case from #651. Live 2x GB10 export+join, GPU tests, and Rust tests were not run. Undeclared in the description: peer env is also applied before the checkpoint-fabric handshake, is applied twice per peer, and rank zero keeps usingenvironment.apply— two mechanisms for the same settings. The reconcile convergence throws away rank 1's locally tuned config and re-prepares (a second pass), and does not remove the upstream cause of divergent declarations._CORRUPT_ARTIFACT_ERRORSincludesOSErrorandRuntimeError, so a transient I/O or genuine deserialization failure on an opportunistic restore now silently deletes the cache entry and recompiles. No documentation update for either the reconcile contract or the new peer env channel.
Value Proposition
Value Proposition — PR #668
Charter alignment: high. Every edit stays in ignition/ preparation and CLI, adds no per-model branches or runtime flags, and drives b12x knobs from recipe.b12x_environment. Cross-node serving is a stated goal, and #631/#651 are reproducible bugs from two independent GB10 operators — squarely inside the charter's "what gets merged" category.
Novelty & status: additive. #647 closed #631 on the same theory, but pfn reproduced the failure on main afterwards ("2283 kernel selections differ"), which is why #651 exists; nothing merged since removes #668's premise. The paired flashinfer#199 covers only the declaration-identity half. #597/#639/#314 touch aot.py and #667/#394 touch host_ranks.py, but none fix these defects — adjacent, not canonical. Not obsolete, not superseded.
Value vs cost. Solid: peer b12x_environment propagation and kernel_cache remapping are verified in code and end-to-end unit-tested; ForwardCache B12X keying, atomic .tmp+os.replace saves, and corrupt-cache recovery are code-verified and tested — contained fixes in the author's own area. Weak: Fixes #651 is unproven — no live 2x GB10 TP2 export+join was run, i.e. exactly the failing configuration, and the new reconcile test is synthetic (SimpleNamespace(config=1|2)), not GLM-5.3's declaration divergence; the reporter with hardware was never asked. #651's second diagnosed cause (rank-local state leaking into declaration identity: 53 vs 65 shard races, 1020 vs 1319 cache records) is untouched, so this converges after the fact and discards rank 1's locally tuned configs — a second preparation pass on a workload already ~2h15m per attempt, unmeasured. Charter friction: _CORRUPT_ARTIFACT_ERRORS swallowing OSError/ValueError/RuntimeError on opportunistic restore unlinks caches on transient EIO/EROFS, against #397; two mechanisms for one setting (early control message plus assignment, applied and validated twice); no docs for the peer env channel or the reconcile contract; the forward-cache root change re-keys and recompiles existing caches with no migration note. CI on d4d7b2d is pending and landing order with #597/#667 is unresolved.
Verdict: Worth it with changes. Required: live 2x GB10 GLM-5.3 confirmation (or reporter sign-off); narrow corrupt-cache recovery to genuine corruption and let transient I/O surface; collapse the env channel to one application path; document the reconcile contract, peer env requirement, and cache re-key; measure or bound the second-pass cost; settle ordering against #597 and #667.
Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Classify intake
Selected: triage:review, priority:P2, bug, performance, area:preparation, area:rocenante
Threshold: 65%
Triage
- [✓]
triage:review: 94.6% -
triage:validation: 3.7% -
triage:design-review: 1.2% -
triage:investigate: 0.3% -
triage:partial: 0.1% -
none: 0.1% -
triage:integration: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Priority
- [✓]
priority:P2: 87.3% -
priority:P1: 7.2% -
none: 5.6%
Type
- [✓]
bug: 98.2% - [✓]
performance: 89.3% -
community: 29.4% -
duplicate: 26.9% -
enhancement: 22.3% -
documentation: 0.1%
Area
- [✓]
area:preparation: 98.6% - [✓]
area:rocenante: 77.7% -
area:caching: 62.2% -
area:kernels: 32.1% -
area:orbit: 4.7% -
area:selene: 2.6% -
area:packaging: 1.8% -
area:memory: 1.6% -
area:api: 1.2% -
area:engram: 0.3% -
area:scheduling: 0.2%
Model
-
model:glm-5.3: 24.5% -
model:kimi-k3.1: 6.0% -
model:deepseek-v4.1: 0.4% -
model:inkling-small: 0.3% -
model:nemotron-3.5-bolt: 0.2% -
model:qwen3.8-flash-next: 0.1% -
model:muse-glimmer: 0.1% -
model:qwen3.8-27b: 0.1% -
model:mimo-v2.6: 0.1% -
model:gemma4: 0.0% -
model:deepseek-v4: 0.0%
Apply Labels (Intake)
Applied: +triage:review, +priority:P2, +bug, +performance, +area:preparation, +area:rocenante
Subtraction and simplicity
PR #668 fixes three real defects and most of it is justified, but it leaves five concrete subtractions.
- The new atomic-save helper duplicates four existing inline copies and retires none — aot.py:90-100 vs aot.py:270-278, aot.py:1185-1193, aot.py:870-877 (which this PR rewrote and left inline), and compile_pool.py:115-123, which is byte-identical including
artifact.save_compiled_function. One_write_atomic(path, write)should replace all five. - The peer
b12x_environmentis sent twice (host_ranks.py:344-347 and again insideassignmentat :377) and applied twice (:646-648, :666-668); the assignment copy can never carry anything the peer lacks. The new test only passes because it feeds different values on the two channels (test_host_ranks.py:405-415), a scenario the sender never produces. _validate_b12x_environment(host_ranks.py:201-209) re-checks theB12X_prefix and string types thatRecipe.__post_init__already rejects (declaration.py:251-253); only theB12X_COMPILE_CACHE_DIRexclusion is new._remap_peer_config's non-dataclasssetattrbranch (host_ranks.py:212-219) is unreachable: every preparation config is a frozen dataclass (bootstrap.py:25-37), sosetattrraisesFrozenInstanceError.- Dead code: the
b12x_environment=Noneoverride onHostRendezvous.prepare(host_ranks.py:313-314, :325-326) has no caller (rank_group.py:286), andisinstance(error, (MemoryError, …))(aot.py:1377) can never be true sinceMemoryErroris not in_CORRUPT_ARTIFACT_ERRORS(aot.py:64-76).
Follow-up only: the 14-name _NON_EXECUTION_B12X_ENV blacklist (aot.py:47-62) could be replaced by keying on the recipe-declared bindings (declaration.py:231).
Lean and left alone: the request-name-first reconcile_selections rewrite (collectives.py:398-449) and the 2-rank Gloo reconcile test.
Open: whether the second env channel is deliberate retry redundancy; which exception the observed corrupt .bin actually raised; whether setattr was kept for a config type outside the repo.
Correctness and contracts
Review of PR #668 (head d4d7b2d), correctness/contracts/system-consequences lens, all four changed source files plus callers, contracts and tests inspected in context.
Key findings:
- Blocker — new control message with no protocol bump:
host_ranks.py:41stillPROTOCOL = 5whileprepare()sends("b12x-environment", …)first (host_ranks.py:345-347); a stale peer passes_admitthen dies athost_ranks.py:657-658with an unrelated RuntimeError, only for GLM-5.3/Kimi-style recipes. - Major —
_CORRUPT_ARTIFACT_ERRORS(aot.py:64-76) includesOSError/RuntimeErrorand wrapspath.open(aot.py:1371-1380), so transient EIO/EROFS/ENOSPC deletes a valid multi-GB.binand recompiles with no log (and the unlink itself raises on a read-only cache). Violates charter #397 / AGENTS.md. - Major — tuning metrics change scope: the reconcile pass is appended to the same
resultssummed attuning.py:558-564, inflatingelapsed_seconds,cache_hits,benchmarked_candidateson exactly the divergent runs. - Major — any change re-prepares every job unsharded onto rank 0 (
tuning.py:506-518), and rank 0 sendsselected_configs={}where pass one sent nothing (collectives.py:499), an untested b12x path; cost unmeasured against #631's ~2h15m/attempt. - The reconciling all-gather lost its declaration dedup (
collectives.py:409-410), growing an already memory-critical gather at #651-scale catalogs. - Forward-cache identity hashes ambient
B12X_*minus a 14-name denylist (aot.py:79-87,:897-899) and that root name is reused as a collective identity (aot.py:1450-1451), so a future host-local knob re-keys/recompiles all hosts and can make ranks disagree on an unvalidated key. - Minor:
B12X_COMPILE_CACHE_DIRis recipe-legal but raises before the listener opens (host_ranks.py:205-208,:233), stranding peers in a 600 s knock;_share_artifactsunlinks a still-open temp file (aot.py:870-877), raising PermissionError on Windows; the peer env channel is sent and applied twice and its "import-time reads" rationale fails on the join path (serve.py:547precedesknock). - Tests/claims: the new 2-rank test never runs reconcile→re-prepare→
agree_selections; no test covers the peerexport_options(..., kernel_cache=…)branch (host_ranks.py:718-719) orchanged is False; the 2×GB10 GLM-5.3 run behindFixes #651was explicitly not executed.
Sound: changed/configs share target_for so ranks cannot split on entering the pass; _save_compiled_function is a correct atomic save used at all three sites; _remap_peer_config handles frozen and mutable configs; the sharing test double now round-trips real bytes.
Open: no live GB10 verification (reporters not engaged); whether unmodified flashinfer main converges; why rank 1's tuned config is discarded rather than compared; which error classes corruption recovery is meant to cover; and landing order versus #667/#597.
Final review
Recommendation: Changes Requested
PR #668 cleanly addresses three real multi-host preparation defects—request-name-first selection reconciliation (collectives.py), peer b12x_environment propagation and local kernel_cache remapping (host_ranks.py, serve.py), and ForwardCache B12X env keying plus atomic .bin persistence (aot.py)—with no hard blockers. However, ForwardCache._load's corrupt-cache handler (aot.py:64-76, 1371-1380) is overly broad (silently unlinking valid artifacts on transient OSError / non-OOM RuntimeError with no log and risking an uncaught OSError on read-only caches), the new serve_peer test (test_host_ranks.py:361-362, 426-438) leaks B12X_* variables into process-global os.environ across subsequent pytest tests, and Fixes #651 is not yet confirmed on live 2× GB10 hardware. Tightening _load's error handling, fixing the test env leak and coverage gaps, and trimming the redundant env channel / atomic-save duplication will make this ready to merge.
Merge Risk
Level: Medium
- Preparation-only blast radius (no Helios serving/wire-format impact): All changes stay in
ignition/preparation/andignition/cli/serve.py; no Rust runtime, Protobuf schema, or exported model-core format changes. - Cache invalidation & corrupt-recovery blast radius: Hashing
_b12x_forward_env()intoForwardCache.root(aot.py:897-899) will trigger a one-time recompile for recipes that declareb12x_environment(e.g., GLM-5.3, Kimi), and_load(..., required=False)now destructively unlinks cached.binfiles on caught exceptions (aot.py:1376-1380). - Active merge-overlap with open PRs: Same-author PR #667 also edits the peer export
export_options(...)block inignition/preparation/host_ranks.py:718-719, and #597 editsForwardCachekeying and_share_artifactsinignition/preparation/aot.py.
Walkthrough
- Request-name-first reconciliation (
ignition/preparation/collectives.py:196-224, 398-449):_selected_plan_catalognow records(request.name, variant, plan.component_id)alongsideportable_declaration(plan).reconcile_selectionsprefers sharedname_keymatches before falling back todecl_keymatches, using onetarget_forhelper for bothchangedandconfigsso all ranks enter or skip the reconcile pass in lockstep while preserving component-ID safety and DCP subgroup independence (request.collective is None). - Peer
b12x_environment& localkernel_cache(ignition/preparation/host_ranks.py:201-239, 313-381, 625-720;ignition/cli/serve.py:197, 420, 554):HostRendezvousaccepts and validatesmodel.recipe.b12x_environment(wired from_export_hostsanddebug_serve), transmits it to peers before assignment unpickling (and again insideassignment), andserve_peerapplies it, remapsconfig.kernel_cacheto the peer's localkernel_cachepassed byjoin, and forwardskernel_cacheinto peerexport_options. ForwardCachekeying, atomic writes, and corrupt-.binrecovery (ignition/preparation/aot.py:47-100, 870-877, 897-899, 1326, 1371-1380, 1454, 1463):ForwardCache.__init__hashes execution-relevantB12X_*env vars via_b12x_forward_env(), replaces all three directsave_compiled_function(str(path))sites with sibling-temp_save_compiled_function, adds temp cleanup in_share_artifacts, and treats_CORRUPT_ARTIFACT_ERRORSin_load(..., required=False)as a cache miss withunlink.- Tests (
tests/preparation/test_tuning_shards.py:264-325,test_host_ranks.py:334-438,test_forward_cache_sources.py:65-140,test_forward_artifact_sharing.py:130-154, 261-262): Adds a 2-rank Gloo reconcile test, rendezvous env validation andserve_peerenv/cache-remapping tests,ForwardCacheB12X keying / atomic save / corrupt-load tests, and updates_Artifact.save_compiled_functionto write real payload bytes.
Pre-merge Checks
- [PASS] Security / malicious screen: No credential handling, shell injection, or untrusted input escalation;
_validate_b12x_environmentrestricts peer env updates to non-cacheB12X_*string bindings. - [PASS] Charter & value fit: Stays cleanly in Ignition preparation/CLI with no per-model branches or runtime flags and targets a reproducible cross-node bug (#651), though
_CORRUPT_ARTIFACT_ERRORScurrently stretches the charter's rule against silently swallowing unexplained errors (#397). - [WARN] Related / duplicate / conflict check: Not superseded by
main(no commits since branch point touch these files), but coordinates with open same-author PR #667 onhost_ranks.py:718-719and open PR #597 onaot.py. - [WARN] Tests & verification evidence: CPU preparation (192) and CLI (136) suites passed locally against paired
flashinfer#199, but live 2× GB10 TP2 GLM-5.3export+join(the #651 repro) and GPU tests were not run, CI ond4d7b2dis pending, and the newserve_peertest leaks env vars across tests.
Blockers
None.
Should Fix
-
Narrow
_CORRUPT_ARTIFACT_ERRORS, log dropped artifacts, and guardunlink(ignition/preparation/aot.py:64-76, 1371-1380)._load(..., required=False)wraps bothpath.open('rb')andtorch.compiler.load_compiled_function(file)(which runs_load_inductorataot.py:103-144, including Triton cubin disk writes, CUDA module deserialization, and Ignition's ownValueError/RuntimeErrorcontract checks at lines 111 and 128) insideexcept _CORRUPT_ARTIFACT_ERRORS, which includesOSErrorandRuntimeError.- Any transient I/O error (
EIO,ENOSPC,EMFILE) or non-OOM CUDA driverRuntimeErrorsilently deletes a valid compiled.binarchive with no warning and forces a full recompile. On a read-only cache (EROFS/EACCES),Path(path).unlink(missing_ok=True)at line 1379 raises an uncaughtOSErrorfrom inside the handler, turning a recoverable miss into a hard crash. - In addition,
MemoryErrorinisinstance(error, (MemoryError, torch.OutOfMemoryError))at line 1377 is unreachable becauseMemoryErroris not a subclass of any member of_CORRUPT_ARTIFACT_ERRORS(onlytorch.OutOfMemoryError, aRuntimeErrorsubclass, can reach line 1377). - Fix: Keep
path.open('rb')outside the corrupt-archive handler (or handleFileNotFoundErrorseparately), narrow_CORRUPT_ARTIFACT_ERRORSto genuine archive/deserialization errors (EOFError,pickle.UnpicklingError,struct.error,zlib.error,zipfile.BadZipFile, plus only the specificValueError/RuntimeErrorraised by truncatedtorch.compiler.load_compiled_functionheaders if observed—not blanketOSError/RuntimeError), emit a warning namingpathanderrorbefore unlinking, wrapPath(path).unlink(missing_ok=True)intry/except OSError, and drop the deadMemoryErrorcheck (keepingtorch.OutOfMemoryErroronly ifRuntimeErrorremains in the tuple).
-
Fix the process-global
os.environleak and test gaps (tests/preparation/test_host_ranks.py:361-362, 426-438;tests/preparation/test_forward_cache_sources.py:136-140).- In
test_serve_peer_applies_b12x_environment_and_remaps_kernel_cache,monkeypatch.delenv("B12X_W4A16_A4_PREFILL", raising=False)andmonkeypatch.delenv("B12X_W4A16_SMALL_M_HOST_BARRIER_RESET", raising=False)are no-ops when those keys are initially absent, so pytest registers no teardown restoration.serve_peerthen callsos.environ.update(...)directly, leaking bothB12X_*variables intoos.environfor all subsequent tests in the same pytest worker—which directly perturbs_b12x_forward_env()andForwardCache.rootin later tests. - In
test_forward_cache_recovers_from_corrupt_cached_bin_on_restore(test_forward_cache_sources.py:136-140), mockingMemoryErrornever enters theexcept _CORRUPT_ARTIFACT_ERRORSblock, leaving thetorch.OutOfMemoryErrorcarve-out ataot.py:1377untested. - Neither
host_ranks.py:718-719(forwardingkernel_cacheinto peerexport_options) norreconcile_selectionsreturningchanged is Falseon agreeing ranks is covered by a test. - Fix: Restore
os.environintest_serve_peer_applies_b12x_environment_and_remaps_kernel_cache(e.g.,monkeypatch.setenv(k, "")followed bymonkeypatch.delenv(k), or restore infinally:), testtorch.OutOfMemoryErrorintest_forward_cache_sources.py, and add focused assertions for peerexport_options(..., kernel_cache=...)andreconcile_selectionswith agreeing ranks (changed is False).
- In
-
Do not auto-close #651 before live 2× GB10 verification.
- #647 previously auto-closed #631 without resolving the live 2× GB10 GLM-5.3 failure, which led to #651. As the PR description candidly notes, live 2-host GB10 TP2
export+joinof GLM-5.3 has not yet been run here, and CI runs againstflashinfermainrather than pairedflashinfer#199. - Fix: Either confirm convergence on live 2× GB10 GLM-5.3 before merge, or change
Fixes #651toRelated: #651in the PR body until verified on hardware (and note the expected one-timeForwardCachere-key for recipes withb12x_environment).
- #647 previously auto-closed #631 without resolving the live 2× GB10 GLM-5.3 failure, which led to #651. As the PR description candidly notes, live 2-host GB10 TP2
Subtract / Simplify
-
Collapse the duplicate
b12x_environmenttransmission and remove the unusedprepare(..., b12x_environment=None)parameter (ignition/preparation/host_ranks.py:313-314, 325-326, 377, 666-668;tests/preparation/test_host_ranks.py:400-412).HostRendezvous.preparesends("b12x-environment", b12x_env)at lines 345-347 beforeassignment = receive_object(control)(line 665, which unpicklesassignment["prepare"]and imports the recipe and its b12x operator modules), and then sends the exact same dict again insideassignment["b12x_environment"]at line 377 whereserve_peervalidates and applies it a second time at lines 666-668. Because the early command is always sent wheneverb12x_envis non-empty, theassignmentcopy can never carry anything new (the test attest_host_ranks.py:400-412only exercises both paths by fabricating different dicts thatHostRendezvous.preparecannot produce).- Separately,
b12x_environment=NoneonHostRendezvous.prepare(host_ranks.py:314, 325-326) has no caller (ignition/preparation/rank_group.py:286callsranks.prepare(...)without it). - Fix: Keep the early
("b12x-environment", b12x_env)command as the single channel, drop"b12x_environment"fromassignmentand lines 666-668, remove the unusedb12x_environment=Nonekwarg fromHostRendezvous.prepare(usingself.b12x_environmentdirectly), and update theserve_peertest to assert one realistic message.
-
Consolidate duplicated atomic-write blocks and fix the open-handle
unlinkin_share_artifacts(ignition/preparation/aot.py:90-100, 270-277, 870-877, 1185-1192;ignition/preparation/compile_pool.py:115-123)._save_compiled_function(aot.py:90-100) is byte-identical tocompile_pool.py:115-123(which already imports from.aotat line 104), andaot.pyretains three inlineNamedTemporaryFile+os.replace+unlinkblocks (:270-277,:870-877,:1185-1192), including the one this PR edited at:870-877.- Moreover, at
aot.py:870-877,try: ... finally: temporary.unlink(missing_ok=True)sits insidewith tempfile.NamedTemporaryFile(...) as file:, so iffile.writefails beforefile.close(), the handle is still open duringunlink(which raisesPermissionErroron Windows and masks the original write error). - Fix: Have
compile_pool.py:115-123call_save_compiled_function, and movetry/finallyoutside thewithblock ataot.py:870-877(or extract one shared atomic-write helper inaot.py).
Nits
- Wire protocol version hygiene (
ignition/preparation/host_ranks.py:41):PROTOCOLstays5while adding the new("b12x-environment", b12x_env)control message. In CLI usage,source_identity()(source_identity.py:95) hashes all ofignition/includinghost_ranks.pyand rejects mismatched checkouts in_admit(host_ranks.py:292-293), so stale peers cannot reachprepare(). Still, bumpingPROTOCOLto6keeps the wire-version constant accurate for any caller passing a customidentity. - Nested composite variant key (
ignition/preparation/collectives.py:212-215): Passing(variant, count)instead of overwritingvariantwithcountmakesname_keycollision-free even if composite plans are ever nested. - Deduping
decl_keyinreconcile_selections(ignition/preparation/collectives.py:409-412): Flatteninglocalsends duplicatedecl_keytuples across layers instead of deduplicating them as before; on a ~1.5k-request catalog this is only a few MiB once at the end of tuning, but interning uniquedecl_keys beforeall_gather_objectwould keep the wire payload small. - Docs (
docs/multi-host.md): Consider a short note that rank zero now propagatesrecipe.b12x_environmentand each peer uses its own localkernel_cache.
Dropped on verification
- Correctness F1 (Blocker: stale peer passes
_admitand crashes on("b12x-environment", ...)): Downgraded to a Nit. Verified inignition/preparation/host_ranks.py:292-293,ignition/cli/serve.py:193, 416, 548, andignition/preparation/source_identity.py:44-49, 95thatsource_identity()hashes the entireignition/tree (includinghost_ranks.py), so mismatched checkouts are already rejected during_admitbeforeprepare()runs. - Correctness F4 (Minor:
B12X_COMPILE_CACHE_DIRrejected inHostRendezvous.__init__causing peers to retryknockfor 600 s): Dropped. Failing fast on rank zero before binding the listener matches every other pre-rendezvous check in_export_hosts(serve.py:180-192), and no recipe setsB12X_COMPILE_CACHE_DIR. - Correctness F5 (Major:
tuning.py:504-518re-prepares all jobs unsharded and passesselected_configs={}): Dropped.ignition/preparation/tuning.pyis untouched by PR #668 (introduced in #647); Pass 2 hits warm selection caches for unchanged plans rather than repeating cold 2h15m autotuning; and F5's proposed fix ("iterate only over jobs whoseplans ∩ configsis non-empty") would deadlock rank 0 (whereconfigs == {}) against rank 1 (whereconfigsis non-empty) inside collectivecoordinator.prepare. - Correctness F6 (Major:
tuning.py:551-564double-countstuning_report): Dropped. Pre-existingtuning.pybehavior from #647, untouched by PR #668 (and summingelapsed_secondsacross both passes is accurate wall time). - Correctness F7 (Major/Minor: memory-critical all-gather blowup in
collectives.py:409-412): Downgraded to a Nit; ~1.3k small tuples is a few MiB once per preparation run, not a GB10 OOM hazard. - Correctness F8 (Minor: replace ambient
_b12x_forward_env()with recipe-onlyb12x_environment): Dropped. VerifiedForwardCacheis constructed inignition/preparation/capture.py:118without the recipe object, and hashing ambient execution-relevantB12X_*flags also protects manual CLI/benchmark overrides from silently colliding inForwardCache. - Correctness F9's claim that the early
("b12x-environment", ...)command cannot precede import-time reads: Corrected and narrowed. Verified inignition/cli/environment.py:74andignition/runtime_patches/workers.py:27thatenvironment.applyatserve.py:547importsb12x.preparation, not the recipe module or itsb12xoperator/kernel modules—those are imported duringassignment = receive_object(control)(host_ranks.py:665), so the early command genuinely runs before recipe/operator imports while theassignmentcopy is the redundant one. - Subtraction 3 (collapse
_validate_b12x_environmentbecauseRecipe.__post_init__already validates): Dropped.HostRendezvousandserve_peeraccept arbitrary dicts (including over the wire) rather thanRecipeinstances, so keeping a 9-line validation helper beforeos.environ.updateis sensible boundary hygiene. - Subtraction 4 (delete
_remap_peer_config'ssetattrfallback as unreachable): Dropped. Model recipes live in an external repository (local-inference-lab/hyperflare-recipes, perAGENTS.md:9-13), so a 2-line fallback for mutable non-dataclass configs cannot be proven unreachable from this repo alone.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 98.5% -
triage:validation: 1.4% -
triage:design-review: 0.1% -
none: 0.0% -
triage:partial: 0.0% -
triage:verify-for-closure: 0.0% -
triage:investigate: 0.0% -
triage:integration: 0.0% -
triage:superseded: 0.0%
Apply labels
No label changes Decision to Test: no (78%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with. decide malicious: all_clear (100%): No malicious content found
explore
Author: lukealonso (COLLABORATOR; charter-listed priority contributor, 36 merged PRs/180 days; Discord: lukealonso)
Motivation: Multi-host Ignition preparation (ignition export --ranks N + ignition join) either loops forever because ranks disagree on kernel selections, or silently prepares with different b12x settings on each host. This PR makes ranks converge on rank zero's choice, ships recipe b12x_environment and a host-local kernel_cache to peers, and hardens the compiled-forward cache.
Scale: +424 / −44 in 8 files
Proposal:
reconcile_selectionsmatches requests by request name first (falling back toportable_declaration), so rank-divergent declarations adopt rank 0's config andagree_selectionscan pass.HostRendezvous/serve_peertransmit and applyrecipe.b12x_environmentto peer ranks, and remap the peer'sconfig.kernel_cacheto its own local directory.ForwardCachehashes execution-relevantB12X_*env into its root key, saves.binvia temp file +os.replace, and treats a corrupt cache file as a miss.- Four test files add a 2-rank Gloo reconcile test, peer env/kernel-cache tests, and cache keying/atomic-save/corrupt-load tests. Touches:
ignition/preparation/aot.py(ForwardCache keying + corrupt-load handling; overlaps open #597/#678)ignition/preparation/collectives.py(selection reconciliation identity)ignition/preparation/host_ranks.py+ignition/cli/serve.py(peer env channel and peer export path) Related items:- #651 Multi-host default autotune still fails kernel agreement (open): the bug this claims to fix
- #647 Fix externalized core signing… and multi-host tuning (merged): introduced the reconcile path #668 rewrites
- #675 forward recipe b12x_environment to peer ranks (closed): duplicate superseded by #668; its stricter import-order fix was dropped
- #667 Harden Orbit payload integrity… multi-host peer exports (merged): its peer
export_optionscall is what #668 extends - #597 Key compiled forward sharing by GPU name (open): overlapping ForwardCache keying/
_share_artifactsLink: https://github.com/NVIDIA/hyperflare-inference/pull/668 Autobot comments: Amendment-only report. The import-order claim in the body ("ahead of assignment unpickling, so import-time reads see it") is inaccurate forb12x.preparation, whichenvironment.apply(serve.py:547) already imports viaworkers.py:27beforeserve_peerapplies the env (host_ranks.py:646-648); closed #675 did this correctly and that fix was not carried over. Two 2× GB10 comments now confirm the diagnosis and manual workarounds, not the PR head, soFixes #651is still unproven on the reported hardware. Head moved to d6a00698 (+424/−44); #667 and #695 merged (overlaps resolved), #678/#671 are new overlaps; the flashinfer pin is commit 5a8ceed8, not branch main.
Classify intake
Selected: triage:review, priority:P2, bug, performance, duplicate, area:preparation, area:rocenante
Threshold: 65%
Triage
- [✓]
triage:review: 98.2% -
triage:validation: 1.2% -
triage:design-review: 0.5% -
none: 0.1% -
triage:investigate: 0.0% -
triage:integration: 0.0% -
triage:partial: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Priority
- [✓]
priority:P2: 99.2% -
none: 0.4% -
priority:P1: 0.4%
Type
- [✓]
performance: 97.4% - [✓]
bug: 83.5% - [✓]
duplicate: 75.5% -
community: 34.9% -
enhancement: 29.4% -
documentation: 0.0%
Area
- [✓]
area:preparation: 96.3% - [✓]
area:rocenante: 77.7% -
area:caching: 53.1% -
area:api: 1.4% -
area:kernels: 1.1% -
area:engram: 0.5% -
area:orbit: 0.2% -
area:memory: 0.2% -
area:packaging: 0.1% -
area:scheduling: 0.1% -
area:selene: 0.0%
Model
-
model:glm-5.3: 20.2% -
model:kimi-k3.1: 1.4% -
model:deepseek-v4.1: 0.3% -
model:inkling-small: 0.2% -
model:mimo-v2.6: 0.2% -
model:deepseek-v4: 0.2% -
model:qwen3.8-27b: 0.2% -
model:muse-glimmer: 0.1% -
model:qwen3.8-flash-next: 0.1% -
model:nemotron-3.5-bolt: 0.0% -
model:gemma4: 0.0%
Apply Labels (Intake)
Applied: +duplicate
Subtraction and simplicity
Subtraction/Simplicity review of PR #668 (head d6a00698, 8 files, +424/−44): design sound, diff mostly lean, but it pays in duplicated mechanism and one dead configuration channel. Five suggestions, three of which delete code.
- S1 (high) — atomic-write idiom now in five places. New
_save_compiled_function(aot.py:90-100) is byte-identical tocompile_pool.py:115-123; same shape ataot.py:270-277and:1185-1192, and the PR expanded a fifth site (aot.py:868-877) instead of reusing it. One writer-agnostic helper (compile_pool.pyalready imports fromaotat:104) collapses ~40 lines. - S2 (high) — forward-cache identity hashes ambient
os.environthrough a 14-name denylist (aot.py:47-62,:79-87, used at:897) although the repo owns this setting asRecipe.b12x_environment(declaration.py:231, appliedenvironment.py:37,52). AGENTS.md:452-460 forbids a fourth home for a setting. Hashing the declared mapping deletes the denylist, theB12X_LOG_rule, and the new test's strip-every-B12X_setup (test_forward_cache_sources.py:144-160). - S3 (high) — peer env crosses the wire twice and the override param is dead. Sent early (
host_ranks.py:345-347), copied intoassignment(:376-377), applied again (:666-668) from one local;prepare(..., b12x_environment=None)(:313-314) has no caller (rank_group.py:288-290usesself.b12x_environment). - S4 (medium) —
_remap_peer_config'shasattr/is_dataclass/setattrfallback (host_ranks.py:212-218) is unreachable: configs are frozen dataclasses (bootstrap.py:25-37). Reduce toreplace(config, kernel_cache=Path(kernel_cache)). - S5 (medium) — the OOM
isinstancetest (aot.py:1377) exists only because the caught tuple containsRuntimeError; a precedingexcept (MemoryError, torch.OutOfMemoryError): raisemakes it structural and lets five over-broad types leave the "corrupt ⇒ unlink" branch. - Minor —
reconcile_selectionsruns identical chosen/seen/participants bookkeeping twice (collectives.py:413-427); one closure drops ~7 lines. - Lean/not flagged: no new flags or dead branches;
_validate_b12x_environmentrestatingdeclaration.py:251-253is justified for untrusted wire data; new tests proportionate. Docs gap: new cross-host env channel with nodocs/entry (AGENTS.md:461-474).
Open: is a plan-owned b12x_environment reachable at capture.py:118 for all cache paths? Which channel is the contract (Reederey87's ordering question unanswered)? No maintainer review, CI conclusion, or doc entry found.
Correctness and contracts
Review of PR #668 at head d6a0069 (correctness/contracts/system-consequences). Three findings carry it:
- Major — peer b12x env lands after b12x is imported. ignition/cli/serve.py:547
environment.apply(configuration, (gpu,))→ ignition/cli/environment.py:82 → runtime_patches/workers.py:27from b12x.preparation import …; only then ignition/preparation/host_ranks.py:645-648 applies the peer env. The description's "so import-time reads see it" is false (it precedes recipe/operator imports only), and the assignment re-apply at :666-668 is redundant. Fix: #675's dropped ordering (_admit reply at :297 + join'senvironment.apply(..., b12x_environment)before runtime_patches). - Major —
_CORRUPT_ARTIFACT_ERRORS(aot.py:64-76) includes OSError/ValueError/TypeError/KeyError/AttributeError/RuntimeError, and the handler (aot.py:1371-1380) unlinks the .bin and returns a cache miss: a transient EIO/EMFILE or genuine runtime fault silently deletes a valid artifact and forces recompile (charter #397), and the unguarded unlink raises PermissionError on a read-only cache. TheMemoryErrorarm at :1377 is dead, and the new test (test_forward_cache_sources.py:212-217) passes trivially. - Major —
changedis global (collectives.py:436-440) butconfigslocal (:441-449), so tuning.py:521-535 re-runs prepare(..., autotune=self.autotune, selected_configs={}) for every job on ranks that already agreed; the new 2-rank test asserts exactly this asymmetry. Multiplies the retry cost the PR aims to remove.
Minor: forward-cache key hashes ambient B12X_* (aot.py:897) while peers get only the recipe mapping (host_ranks.py:201-209), forking caches; the exclusion list is a denylist. Reconcile keys (name, variant, component_id) (:218) vs agree's bare name (:377), unscoped by operation group, so "adopt rank zero's" (docstring :403-405) is really the operation's first rank. prepare(..., b12x_environment=None) (:313-314) has no caller (rank_group.py:289).
Sound: atomic .bin save (aot.py:90-100), dataclass kernel_cache remap (:212-219), rank-lockstep changed, PROTOCOL=5 unchanged, B12X_COMPILE_CACHE_DIR rejected, Windows/POSIX parity, no metric-span change.
Open: will author adopt #675 ordering or document the invariant? Which errors is the tuple meant for? Has this head run on 2× GB10 (no)? Fixes #651 should be Related: until then. Docs gap vs AGENTS.md:234.
Re-review
Recommendation: Changes Requested
PR #668 cleanly addresses three real multi-host preparation defects—request-name-first selection reconciliation, peer b12x_environment / local kernel_cache propagation, and ForwardCache B12X keying with atomic .bin persistence—and independent 2× GB10 SM121 reports from @nepenth and @Reederey87 corroborate both root causes. Head d6a0069 rebased cleanly onto main (resolving the prior #667 conflict in host_ranks.py:723-725), but the PR's own 8-file diff (+424 / −44) has not yet addressed two concrete safety/test-isolation bugs from Round 1: ForwardCache._load silently unlinking valid .bin artifacts on transient OSError / CUDA / _load_inductor errors, and the new serve_peer test permanently leaking B12X_* variables into process-global os.environ.
Merge Risk
Level: Medium
- Preparation-only blast radius: All edits are confined to
ignition/preparation/,ignition/cli/serve.py, andtests/preparation/; no Helios runtime, Protobuf schema, or exported model-core format changes. Note that with#695merged onmain,reconcile_selectionsalso runs for serving-replica--tuning-gpussessions (ignition/preparation/tuning.py:521-535). - Destructive cache-recovery and one-time re-key: Hashing
_b12x_forward_env()intoForwardCache.root(ignition/preparation/aot.py:897-899) triggers a one-time forward recompile for recipes declaringb12x_environment(e.g., GLM-5.3, Kimi). More critically,_load(..., required=False)(aot.py:64-76, 1371-1380) catches blanketOSError/RuntimeError/ValueErroraround bothpath.open('rb')and_load_inductorand destructively unlinks the cached.binwithout logging. - Open-PR conflict horizon: Rebase resolved the
#667overlap cleanly (host_ranks.py:723-725), leaving active file overlap with open#597(aot.py),#678(aot.pyandtests/preparation/test_forward_cache_sources.py), and#671(host_ranks.pyandtests/preparation/test_forward_artifact_sharing.py).
Walkthrough
- Request-name-first selection reconciliation (
ignition/preparation/collectives.py:196-224, 398-449):_selected_plan_catalogrecords(request.name, variant, plan.component_id)alongsideportable_declaration(plan)for non-collective requests (request.collective is None).reconcile_selectionsmatches sharedname_keys across ranks first before falling back to shareddecl_keys, using a singletarget_forhelper for bothchangedandconfigsso all ranks enter or skip Pass 2 in lockstep while preserving component-ID safety. - Peer
b12x_environmentpropagation & localkernel_cacheremapping (ignition/preparation/host_ranks.py:201-239, 313-381, 625-726;ignition/cli/serve.py:193-197, 416-420, 551-555):HostRendezvousvalidates and storesmodel.recipe.b12x_environment(rejecting non-B12X_keys,B12X_COMPILE_CACHE_DIR, and non-string values) and sends it to peers beforeassignment(and again insideassignment).serve_peerapplies it toos.environ, remapsconfig.kernel_cacheto the peer's localkernel_cachepassed fromjoin, and forwardskernel_cacheinto peerexport_options. ForwardCachekeying, atomic.binpersistence, and corrupt-load recovery (ignition/preparation/aot.py:47-100, 868-878, 897-899, 1326, 1371-1380, 1454, 1463):ForwardCache.__init__mixes sorted execution-relevantB12X_*bindings (_b12x_forward_env()) into its SHA-256 root key; all three directsave_compiled_functioncall sites switch to sibling-temp_save_compiled_function;_share_artifactsadds temp-file cleanup;_load(..., required=False)catches_CORRUPT_ARTIFACT_ERRORS, unlinks the.bin, and returnsNone.- Tests (
tests/preparation/test_tuning_shards.py:264-325,tests/preparation/test_host_ranks.py:334-439,tests/preparation/test_forward_cache_sources.py:142-218,tests/preparation/test_forward_artifact_sharing.py:130-154, 261-262): Adds a 2-rank Gloo reconciliation test, rendezvous env validation andserve_peerenv/cache-remapping tests,ForwardCacheB12X keying / atomic-save / corrupt-load tests, and real payload writes in_Artifact.save_compiled_function.
Pre-merge Checks
- [PASS] Security / malicious screen: No credential exposure, shell injection, or untrusted input escalation;
_validate_b12x_environmentrestricts peer environment updates to non-cacheB12X_*string bindings. - [WARN] Charter & value fit: Cleanly scoped to Ignition preparation/CLI with no per-model branches or runtime flags and targets a reproducible cross-node bug (
#651), but_CORRUPT_ARTIFACT_ERRORSsilently swallows and deletes on unexplainedOSError/RuntimeErrorfaults (against charter#397). - [WARN] Related / duplicate / conflict check: Rebased cleanly onto merged
#667and#695, and supersedes closed#675(though without carrying over#675's stricter pre-import ordering injoin). Coordinates with open#597,#678(aot.py,test_forward_cache_sources.py), and#671(host_ranks.py,test_forward_artifact_sharing.py). - [WARN] Tests & verification evidence: Author ran 192 preparation CPU tests against paired
flashinfer#199and 136 CLI CPU tests; CI (.github/workflows/python-cpu.yml:29-33(not opened)) validates against pinnedflashinfer(pyproject.toml:47,rev = "5a8ceed80ccc58e11a4d49ccc910f52967699c09"). The newserve_peertest leaksB12X_*intoos.environ,torch.OutOfMemoryErroris untested, and headd6a0069has not yet been run on live 2× GB10 hardware.
Blockers
-
Narrow
_CORRUPT_ARTIFACT_ERRORS, log dropped artifacts, guardunlink, and testtorch.OutOfMemoryError(ignition/preparation/aot.py:64-76, 103-144, 1371-1380;tests/preparation/test_forward_cache_sources.py:212-217):ForwardCache._load(..., required=False)wraps bothpath.open('rb')andtorch.compiler.load_compiled_function(file)inexcept _CORRUPT_ARTIFACT_ERRORS, which catches blanketOSError,RuntimeError,ValueError,TypeError,KeyError, andAttributeError. Insideload_compiled_function,_load_inductor(aot.py:103-144) writes Triton cubins to disk (_materialize_selected_cubinat:121), loads CUDA modules (deserialize_bundled_cache_entryat:123), and enforces internal invariants withValueError(:111) andRuntimeError(:128).- Consequently, any transient
OSError(ENOSPCwriting Triton cubins,EMFILE,EIO), non-OOM CUDA driverRuntimeError, or_load_inductorcontract failure silently deletes a potentially valid.binartifact with zero warning/logging and forces a full recompile (charter#397). Additionally,Path(path).unlink(missing_ok=True)(:1379) is unguarded againstPermissionError/OSError(e.g., sticky/read-only directory or locked file on Windows), turning a recoverable miss into an unhandled crash. - At
aot.py:1377,MemoryErrorinisinstance(error, (MemoryError, torch.OutOfMemoryError))is unreachable dead code becauseMemoryErroris not a subclass of any member of_CORRUPT_ARTIFACT_ERRORS. The test attests/preparation/test_forward_cache_sources.py:212-217only raisesMemoryError, so it never enters theexceptclause and leaves thetorch.OutOfMemoryError(RuntimeErrorsubclass) carve-out completely untested. - Fix: Move
path.open('rb')outside the corrupt-archivetry(or handleFileNotFoundErrorexplicitly as a miss); narrow_CORRUPT_ARTIFACT_ERRORSto genuine archive/deserialization errors (EOFError,pickle.UnpicklingError,struct.error,zlib.error,zipfile.BadZipFile—not blanketOSErrororRuntimeError, or if a specificRuntimeError/ValueErrorfrom truncated torch archives must be handled, place an explicitexcept (MemoryError, torch.OutOfMemoryError): raiseahead of it and do not swallowOSErroror_load_inductorcontract faults); log a warning namingpathanderrorbefore unlinking; wrapPath(path).unlink(missing_ok=True)intry: ... except OSError: pass; and testtorch.OutOfMemoryErrorintest_forward_cache_sources.py.
-
Fix the process-global
os.environleak intest_serve_peer_applies_b12x_environment_and_remaps_kernel_cache(tests/preparation/test_host_ranks.py:361-362, 426-438):monkeypatch.delenv("B12X_W4A16_A4_PREFILL", raising=False)andmonkeypatch.delenv("B12X_W4A16_SMALL_M_HOST_BARRIER_RESET", raising=False)are no-ops when those keys start absent, so pytest registers no teardown restoration (comparetests/cli/test_environment.py:55-62(not opened), which explicitly works around this pytest behavior).serve_peerthen mutatesos.environdirectly viaos.environ.update(...), leaving bothB12X_*variables set for every subsequent test in the same worker—directly perturbing_b12x_forward_env()andForwardCache.rootintroduced in this PR.- Fix: Register undo entries before calling
serve_peer(e.g.,monkeypatch.setenv(k, ""); monkeypatch.delenv(k)for each key, matchingtests/cli/test_environment.py:57-62(not opened), or restoreos.environinfinally:).
Should Fix
-
Address or document the peer
b12x_environmentimport-order gap (ignition/cli/serve.py:547-555,ignition/cli/environment.py:7-9, 82,ignition/runtime_patches/__init__.py:119,ignition/runtime_patches/workers.py:26-29,ignition/preparation/host_ranks.py:297, 645-648):- In
join(),environment.apply(configuration, (gpu,))runs atserve.py:547beforeknock()andserve_peer().environment.applycallsruntime_patches.apply()(environment.py:82) →workers.register_hooks()(runtime_patches/__init__.py:119) →from b12x.preparation import register_worker_initializer(workers.py:27), sob12xandb12x.preparationare already imported beforeserve_peerreceives("b12x-environment", ...)athost_ranks.py:646-648. - For dynamically read flags like
B12X_W4A16_A4_PREFILL, applying them beforeassignment = receive_object(control)(:665) works because recipe/operator modules import during unpickling. However, any futureb12x_environmentvariable cached atb12x/b12x.preparationimport time will still diverge between rank zero (serve.py:211, 438) and peers—contradictingignition/cli/environment.py:7-9and the PR description's unqualified "(so import-time reads see it)" claim (as@Reederey87flagged after closing#675). - Fix: Either send
b12x_environmentin_admit's JSON reply (host_ranks.py:297) and callenvironment.apply(configuration, (gpu,), b12x_environment)injoin()afterknock()(note thatsource_identity(),local_topology(), andknock()do not requireenvironment.apply—rank zero already runs all three beforeenvironment.applyatserve.py:193-211), which also eliminates the pickle-channel duplication below; or explicitly document inserve.py/host_ranks.pyand the PR description that peerb12x_environmentis applied afterb12x.preparationimport and only precedes recipe/operator imports.
- In
-
Do not auto-close
#651before confirmingd6a0069on live 2× GB10 hardware:- Independent 2× GB10 SM121 TP2 reports from
@nepenthand@Reederey87strongly validate both diagnosed root causes and manual workarounds, but neither ran this PR commit itself, and CI runs against pinnedflashinfer(pyproject.toml:47) rather than pairedflashinfer#199. Because#647previously auto-closed#631without resolving live 2× GB10 convergence, either verify this branch on 2× GB10 before merging or changeFixes #651toRelated: #651until confirmed on hardware (and note the expected one-timeForwardCachere-key for recipes withb12x_environment).
- Independent 2× GB10 SM121 TP2 reports from
Subtract / Simplify
-
Collapse the duplicate
b12x_environmentwire channel and remove the unusedprepare(..., b12x_environment=None)parameter (ignition/preparation/host_ranks.py:313-314, 325-326, 345-347, 376-377, 645-648, 665-668,ignition/preparation/rank_group.py:288-290,tests/preparation/test_host_ranks.py:400-412):HostRendezvous.preparesends the exact sameb12x_envdict twice: once as("b12x-environment", b12x_env)(:345-347) and again insideassignment["b12x_environment"](:377), whereserve_peerre-validates and re-applies it (:666-668). Because the early command is always sent wheneverb12x_envis non-empty, theassignmentcopy can never add anything new (the test attest_host_ranks.py:400-412only hits both paths by injecting two different dicts thatHostRendezvous.preparenever produces).- Separately,
prepare(..., b12x_environment=None)(:314, 325-326) has no caller (rank_group.py:288-290never passes it;HostRendezvous.__init__already validates and storesself.b12x_environment). - Fix: Keep a single channel (either
_admitper Should Fix #1, or the early("b12x-environment", ...)frame), remove"b12x_environment"fromassignmentandhost_ranks.py:666-668, drop the unusedb12x_environment=Noneparameter fromHostRendezvous.prepare, and simplifytest_host_ranks.py:400-412.
-
Consolidate duplicated atomic-write blocks and fix the open-handle
unlinkin_share_artifacts(ignition/preparation/aot.py:90-100, 270-277, 868-878, 1185-1192;ignition/preparation/compile_pool.py:104, 115-123):_save_compiled_function(aot.py:90-100) is identical tocompile_pool._compile_forward(compile_pool.py:115-123, which already imports from.aotat:104), andaot.pymaintains three additional inlineNamedTemporaryFile+os.replace+unlinkblocks (:270-277,:870-877,:1185-1192).- In the newly edited
_share_artifactsblock (aot.py:870-877),try: ... finally: temporary.unlink(missing_ok=True)is nested insidewith tempfile.NamedTemporaryFile(...) as file:, so iffile.write(payload[0])fails beforefile.close(),unlinkruns while the handle is still open (PermissionErroron Windows, masking the write error). - Fix: Have
compile_pool.py:115-123call_save_compiled_function, and movetry/finallyoutside thewithblock ataot.py:870-877(or extract a single_atomic_write(path, writer)helper inaot.py).
Nits
- Nested composite variant key (
ignition/preparation/collectives.py:212-215): Passing(variant, count)instead of overwritingvariantwithcountkeepsname_keycollision-free if composite plans are ever nested. - Additional targeted test coverage (
tests/preparation/test_host_ranks.py,tests/preparation/test_tuning_shards.py): Add assertions covering peerexport_options(..., kernel_cache=kernel_cache)(host_ranks.py:723-725) andreconcile_selectionsreturningchanged is Falsewhen ranks already agree. - Wire protocol version hygiene (
ignition/preparation/host_ranks.py:41):PROTOCOLremains5despite adding the("b12x-environment", ...)message.source_identity()(source_identity.py:44-49, 95) hashesignition/and rejects mismatched checkouts in_admit(host_ranks.py:292-293), so CLI peers are protected, but bumpingPROTOCOLto6keeps the constant accurate for callers passing a customidentity. - Docs (
docs/multi-host.md:330): Add a short note under "Prepare the core" that rank zero propagatesrecipe.b12x_environmentto peers, each peer uses its own localkernel_cache, andForwardCachere-keys on execution-relevantB12X_*settings.
Dropped on verification
- Correctness F3 (
reconcile_selectionscauses rank 0 withconfigs == {}to re-autotune every job for ~2h15m): Dropped —ignition/preparation/tuning.py:521-535is untouched by this PR (pre-existing from#647/#695); Pass 2 hits warm selection caches for unchanged plans on rank 0 rather than repeating a ~2h15m cold search; andtests/preparation/test_tuning_shards.py:259explicitly expectsautotune=Trueon the reconcile replay. - Correctness F4 & Subtraction S2 (hash
Recipe.b12x_environmentinstead of ambient_b12x_forward_env()/AGENTS.md:452-460violation): Dropped —ForwardCacheis constructed inignition/preparation/capture.py:118-122without aRecipe/Planobject, and_b12x_forward_env()is cache-key hygiene (analogous totorch_key()), not an env-driven behavior toggle prohibited byAGENTS.md:452-460; hashing ambientB12X_*also protects manual CLI/benchmark overrides from silent collisions. - Correctness F5 (reconcile key
(name, variant, component_id)mismatchesagree_selectionsbarename, and unscoped byoperation_ranks): Dropped — includingplan.component_idinname_key(collectives.py:218) is a mandatory safety guard (copying a config across differentTuningContractcomponents is invalid and should fail inagree_selections), and_selected_plan_catalogexplicitly filtersif request.collective is None:(collectives.py:222), preserving DCP collective subgroup independence (tests/preparation/test_dcp_selection_groups.py:45-65). - Subtraction S4 (delete
_remap_peer_config's non-dataclasssetattrfallback athost_ranks.py:216-219): Dropped — recipes live in an external repository (local-inference-lab/hyperflare-recipes,AGENTS.md:224-225), so a 2-line fallback for mutable non-dataclass configs cannot be proven unreachable from this repository alone. - Subtraction Minor (
reconcile_selectionschosen/seen/participants helper closure atcollectives.py:413-427): Dropped — low-signal stylistic preference over 14 clear, readable lines.
Full report Decision to Test: no (99%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 99.6% -
triage:design-review: 0.3% -
triage:validation: 0.1% -
triage:investigate: 0.0% -
triage:integration: 0.0% -
none: 0.0% -
triage:partial: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Apply labels
No label changes