Explore report · NVIDIA/hyperflare-inference #668

Raw Markdown for agents: https://autobot.eidonix.com/p/141a2f6b-25a5-485e-b24e-c0edb2191158.md

PR #668 — fix(ignition): reconcile divergent multi-host selections, propagate peer b12x env and kernel cache, and harden ForwardCache

https://github.com/NVIDIA/hyperflare-inference/pull/668 · base main · head d4d7b2d · open, ready for review · no labels · no reviews · CI pending · Fixes #651 · Paired FlashInfer PR: local-inference-lab/flashinfer#199 · Discord: lukealonso

Key findings

The change (what it does, size, and what the description omits)

Size: 8 files, +423/−44 — ignition/preparation/collectives.py, ignition/preparation/host_ranks.py, ignition/preparation/aot.py, ignition/cli/serve.py (5/−2), and four test files under tests/preparation/ (+252/−3). No docs, no Rust.

1. Request-name-first reconciliation (ignition/preparation/collectives.py). _selected_plan_catalog now returns 5-tuples (plan, decl_key, (name, variant, component_id), payload, config), expanding composite plans per variant so variant disambiguates (collectives.py:196-224). reconcile_selections gathers them, builds chosen_name/chosen_decl in rank order (rank 0 wins) plus participant counts, and a single target_for(decl_key, name_key) prefers a shared request name, falling back to a shared declaration (collectives.py:413-434). Both the changed flag and the returned configs use target_for, so every rank decides to enter or skip the re-prepare pass identically (collectives.py:436-449). The caller is unchanged: tuning.py:504-518 reconciles, re-prepares with selected_configs (forcing configure_tuning_shard(0, (0,)) when sharded), then agree_selections at tuning.py:530 — which keys purely on request name (local = {item["name"]: (component, json config)}, collectives.py:375-396), which is exactly why the name key is what makes the two agree.

Not said in the description: a name match wins even when the two ranks' declarations differ, so the portable_declaration fallback only fires for names present on a single rank; and a divergent rank's whole locally tuned component (component_key includes portable_declaration, per tests/preparation/tuning_shards.py:56-58 (not opened)) is thrown away and re-prepared with rank zero's config — the fix costs a second tuning/preparation pass in the very scenario of #651 (which already takes ~2h15m per failed attempt per #631).

2. Peer b12x_environment and kernel_cache (ignition/preparation/host_ranks.py, ignition/cli/serve.py). _validate_b12x_environment rejects non-B12X_ names, B12X_COMPILE_CACHE_DIR and non-string values (host_ranks.py:201-209); _remap_peer_config uses dataclasses.replace when possible, else setattr (host_ranks.py:212-219). HostRendezvous.__init__ takes and stores b12x_environment (host_ranks.py:229-234); prepare() takes an optional override, sends the env to every peer control socket before the checkpoint-fabric/checkpoint-source commands (host_ranks.py:344-347) and also embeds it in assignment (host_ranks.py:374-377). serve_peer gains kernel_cache= (host_ranks.py:626), applies the early env command (host_ranks.py:646-648), re-applies from the assignment and remaps config.kernel_cache to Path(kernel_cache) (host_ranks.py:666-669), and forwards kernel_cache into export_options in the peer export branch (host_ranks.py:718-719; export_options(cache, *, no_weights, reuse_weights, kernel_cache) at core_snapshot.py:25-33). Wiring: serve.py:197 (_export_hosts), :420 (debug_serve) pass model.recipe.b12x_environment; serve.py:551-554 join passes kernel_cache=configuration.directory("kernel_cache"); rank zero's own env comes from environment.apply(configuration, local, plan.recipe.b12x_environment) at serve.py:211 (and serve.py:547 in join).

Not said in the description: the two-mechanism redundancy for rank zero; the double validation/application on each peer; and that B12X_COMPILE_CACHE_DIR is deliberately excluded because environment.apply already points it at the peer-local kernel_cache/b12x, so the new channel cannot redirect a peer's compile cache.

3. ForwardCache hardening (ignition/preparation/aot.py). New _NON_EXECUTION_B12X_ENV frozenset of 14 names (compile cache dir/disk/memory/workers/spec memo, RoCE cache/GID/HCA, preparation trace dir, barrier timeout, timing knobs, compile progress) and _b12x_forward_env() returning a sorted tuple of the remaining B12X_*, also excluding B12X_LOG_* (aot.py:47-82). The cache root key tuple becomes (namespace, options, _b12x_forward_env(), torch_key(), runtime_patches.identity(), device props…) (aot.py:894-901). _save_compiled_function writes to a sibling NamedTemporaryFile(suffix='.tmp') then os.replace, unlinking in finally (aot.py:85-96), and replaces all three former direct save_compiled_function(str(path)) sites (aot.py:1326, :1454, :1463); _share_artifacts now closes the temp handle and unlinks on failure (aot.py:868-880). _load wraps the deserialize in try/except _CORRUPT_ARTIFACT_ERRORS, unlinking and returning None when required=False, re-raising for required=True and for MemoryError/torch.OutOfMemoryError (aot.py:1371-1386).

Not said: the breadth of the caught tuple (see Key findings) and that MemoryError needs its explicit check because it is not in the tuple.

Tests added: 2-rank Gloo _gloo_reconcile_divergent_worker + test_reconcile_selections_matches_divergent_declarations_by_request_name (tests/preparation/test_tuning_shards.py:262-325, synthetic configs 1/2 for a same-name/divergent-declaration request plus a different-name/shared-declaration alias); validation and end-to-end serve_peer env/kernel-cache test (tests/preparation/test_host_ranks.py:332-438); b12x env key inclusion/exclusion, atomic save rollback, corrupt-restore recovery (tests/preparation/test_forward_cache_sources.py:63-140); _Artifact test double now writes its payload bytes instead of asserting existence (tests/preparation/test_forward_artifact_sharing.py:130-155, :262).

The why

Recent activity

People

Community

Nothing found beyond the PR body: pr_comments returns no comments, there are no reviews, no labels, no reactions recorded, and no linked discussion on #651 or #631 pointing at this PR. Interest so far is zero on the PR itself; the interest in the underlying problem is two independent GB10 operators (#631's pfn, #651's hiroshi-ya) both blocked.

Project fit

Claims and evidence

Claim Evidence Verdict
Peers prepare with rank zero's recipe b12x_environment host_ranks.py:201-219, :344-347, :374-377, :646-648, :666-669; end-to-end test tests/preparation/test_host_ranks.py:342-438 asserting both B12X_W4A16_A4_PREFILL and B12X_W4A16_SMALL_M_HOST_BARRIER_RESET land and config.kernel_cache becomes Path(peer_cache) Verified in code and unit-tested
Peers write cubins into their own cache kernel_cache forwarded into export_options (host_ranks.py:718-719; core_snapshot.py:25-33) → runtime_core.py:405-408 Verified in code; no test covers the export branch
reconcile_selections converges rank-divergent declarations to rank zero collectives.py:398-449; 2-rank Gloo test tests/preparation/test_tuning_shards.py:262-325 Logic verified; the test's inputs are synthetic, not #651's GLM-5.3 divergence
"#651 is fixed" Fixes #651 in the body; no live run Unproven — author explicitly did not run 2x GB10 export+join, the reproduced configuration
ForwardCache separates forwards across differing B12X_* settings aot.py:47-82, :894-901; tests test_forward_cache_sources.py:63-92 Verified and tested
.bin writes are atomic; crashes leave no partial artifact aot.py:85-96, :868-880, three call sites; test test_forward_cache_sources.py:95-116 Verified and tested
Corrupt cached .bin becomes a cache miss aot.py:1371-1386; test test_forward_cache_sources.py:119-140 Verified and tested; breadth of swallowed errors is the caveat
192 preparation tests + 136 cli tests pass author's Validation section (CPU, CUDA_VISIBLE_DEVICES="", local FlashInfer branch) Reported, not independently re-run here; CI on head is still pending
Independent of flashinfer#199 PR body; CI installs flashinfer main (pyproject.toml:47) Plausible; means the declaration-identity half of #651 is not exercised by this PR

Reach

Process

Open and marked ready for review; 8 files, +423/−44; no labels, no reviewers requested, no reviews, no comments; CI on head d4d7b2d pending at the time of the orientation packet; no commits to main since the branch point (a3c80e1) touch its files, so no stale-branch conflict. The PR is one of three open from the same author in the same week (#667, #658, #659), two of which touch adjacent multi-host code.

Open questions / not found