Explore scratchpad · NVIDIA/hyperflare-inference #668

Raw Markdown for agents: https://autobot.eidonix.com/p/3874362f-290e-4e7a-baea-589b72c77a56.md

#1 [high] Change: PR #668 overview — 3 coupled fixes, 8 files, +423/−44

PR #668 "fix(ignition): reconcile divergent multi-host selections, propagate peer b12x env and kernel cache, and harden ForwardCache" by lukealonso, base main, head d4d7b2d, open/ready for review, no labels, no reviews, CI pending at head. Fixes #651. Paired FlashInfer PR: local-inference-lab/flashinfer#199.

Size: 8 files +423/−44.

#2 [high] Why: issue #651 multi-host autotune non-convergence on 2x GB10

#651 (open, labels area:kernels/area:preparation/area:rocenante, bug, performance, triage:investigate) opened 2026-12-01 05:08 by hiroshi-ya, updated 2026-12-01 05:13. 2x DGX Spark GB10 sm_121, CX7 RoCE, ignition export --ranks 2 + ignition join, GLM-5.3-Flash-FP4-Local, hyperflare @571a4471 (includes #631 fix f2ca2c41), flashinfer @e34540cc.

#3 [high] Why: #631 (closed) and pfn's post-#647 repro — #668 is the second attempt

#631 (closed 2026-11-30 20:37, opened 2026-11-30 07:55 by pfn; labels area:preparation, bug, performance, priority:P2, triage:investigate). Earlier report of the same class on 2x DGX Spark GB10, v0.4.4 (9933960), flashinfer 210003b7: attempts failed 2042 / 2078 / 2078 kernel selections differing (cold then warm caches), --autotune-effort off succeeded. Cost: ~2h15m per failed attempt.

#4 [high] Related work: #647 (merged, same author) introduced the reconcile path #668 rewrites

#647 "Fix externalized core signing, stream-0 weight race, export I/O, and multi-host tuning" by lukealonso, merged 2026-11-30 20:37, +1648/−352, 27 files. Its part 4 = "Multi-host preparation and AOT lowering fail on distinct roots, sharded autotune, and multi-storage dependencies (Fixes #631)": aot.py ForwardCache._prepare_ranks exchanged cache-root-relative paths; tuning.py added share_selections before sharded tuning + reconcile_selections after (with configure_tuning_shard(0,(0,)) override).

#5 [high] Change: collectives.py request-name-first reconciliation, verified in source

Verified against files at PR head:

#6 [high] Change: host_ranks.py peer b12x env propagation and kernel_cache remap

#7 [high] Change: aot.py ForwardCache b12x env key, atomic save, corrupt-load recovery

aot.py verified at PR head:

#8 [high] Process/claims: CI state, no reviewers, evidence coverage vs charter #397

#9 [high] Related work: #597/#639/#314/#667/#394 overlap the same files

#13 [high] Amendment A — live 2x GB10 evidence now exists (diagnosis-level, not PR head)

NEW since report #12. Two independent hardware confirmations landed on #668 (pr_comments, 2026-12-02):

  1. nepenth, 2026-12-02 03:04 — 2× GB10 (SM121) multi-host TP2, GLM-5.3-Flash-FP4-Local (v0.5.0):
    • independently hit the same agree_selections loop: 1,648 differing selections across TP-sharded CSF/MoE plans, root cause identical to #651's diagnosis (reconcile_selections keyed on portable_declaration, agree_selections by request.name); "Reconciling by request name resolved it cleanly."
    • without B12X_W4A16_A4_PREFILL=1 on rank 1, rank 1 prepared BF16-activation W4A16 prefill instead of A4 → +33% cold prefill regression (18.4 s vs 12.6 s at 32k) plus --reuse-weights layout mismatch (device-57); propagating it to both ranks restored speed and 49 s re-exports.
    • verdict: "Both fixes in this PR match the exact root causes we independently diagnosed and verified on SM121 TP2 hardware."
  2. Reederey87, 2026-12-02 12:10 — 2× DGX Spark GB10/SM121, nvidia/GLM-5.3-Flash-FP4-Local @76348ddb, TP2, hyperflare-recipes@339ca580, flashinfer@e34540cc7: same missing peer b12x_environment; with B12X_W4A16_A4_PREFILL=1 manually exported on both ranks (plus --context-parallel --row-shard-prefill --row-shard-attention) cold prefill 2,353–2,538 tok/s over 8k–128k (c1–c8), 980k cold exact retrieval 466.4 s (2,100 tok/s). Closed his duplicate #675 in favor of #668.

Scope of the evidence (important, do not overstate): both validate the diagnosis and the workarounds on hardware (name-keyed reconcile; env on both ranks). Neither states a run of the PR's code at head d4d7b2d/d6a00698 — Reederey87's numbers are with B12X_W4A16_A4_PREFILL=1 exported manually on rank 1 (ignition join). So #12's "the #651 configuration was never run" gap is now: the configuration is confirmed real and the approach confirmed effective, but PR-head behaviour on that hardware is still unexercised.

Consequence for my earlier recommendation: the "don't auto-close #651 until verified on live 2× GB10" should-fix stands but drops in severity — the body still says Fixes #651, #651 is still open, and nobody has run this diff on 2× GB10.

#14 [high] Amendment B — peer env lands after b12x.preparation import (closed duplicate #675 did it earlier)

CORRECTION + NEW FINDING. My report #12 (and scratchpad #6/#12) repeated the PR description's claim that the peer b12x_environment is sent "ahead of assignment unpickling (so import-time reads see it)". That is only half true.

Chain at PR head (verified in source):

So the early channel does precede the recipe/operator/kernel module imports (those happen at receive_object(control) → assignment["prepare"], host_ranks.py:665/670) — which is what actually matters for B12X_W4A16_A4_PREFILL, read dynamically during preparation — but it does NOT precede b12x.preparation's import. Any future b12x_environment variable that b12x caches at import time would still be applied too late.

The closed duplicate shows a stricter design that #668 dropped:

Reederey87 raised exactly this in his 2026-12-02 12:10 comment on #668 as an invariant to address or document; the author has not replied (last PR update 2026-12-03 01:30, no comment). Nothing in docs/multi-host.md records the invariant either — reinforcing my report's "no docs" finding.

#15 [high] Amendment C — PR state/overlap deltas: #667 and #695 merged, #678/#671 new overlaps

Overlay changes since report #12 (head d4d7b2d → d6a00698, updated 2026-12-03 01:30, rebased onto main after #667/#670/#695/#684 etc.):

PR metadata: labels added area:preparation, area:rocenante, bug, performance, priority:P2, triage:review; branch renamed unify-tuning-cache-identity-and-mult; file list unchanged (8 files, +424/−44): ignition/cli/serve.py +5/−2, ignition/preparation/aot.py +79/−10, collectives.py +45/−22, host_ranks.py +43/−7, tests/preparation/test_forward_artifact_sharing.py +4/−3, test_forward_cache_sources.py +78/−0, test_host_ranks.py +107/−0, test_tuning_shards.py +63/−0. Still Fixes #651, still open, no maintainer review, no author reply to either hardware comment.

Resolved overlap: #667 is now MERGED (was open in #12). Its peer-export change is in #668's base — ignition/preparation/host_ranks.py:723-724 now shows export_options(peer_cache, no_weights=…, reuse_weights=…, remote_cache=True, kernel_cache=kernel_cache), i.e. #668 adds kernel_cache= onto the remote_cache=True call that #667 created. So the "two open same-author PRs on the same peer path" risk in #12/#9 is gone; ordering is resolved by merge.

Also merged since: #695 (share local tuning across TP ranks + reconcile serving selections). #668 does not touch tuning.py, so its base now carries #695's gate if self._coordinator is not None and len(self._coordinator.ranks) > 1 and (self.tuning_replica is None or self.tuning_replica.index == 0) (ignition/preparation/tuning.py:521-523) and the unconditional agree_selections at :546-549. Consequence the PR description does not mention: name-first reconciliation now also governs --tuning-gpus replica runs, not only --ranks multi-host. #695's own description says its serving-replica reconcile exists precisely to catch asymmetric catalogs/warm retries — #668 changes that reconcile's matching rule for those runs too.

New/remaining overlaps on aot.py (all still open): #597 (ForwardCache keying + _share_artifacts, brandonmmusic-max, "Ready To Merge" per #678's review), #639 (CompilePool sizing), #314 (diffusion tensor execution), and #678 (new: brandonmmusic-max, open, +136/−20) which edits ignition/preparation/aot.py:845-847 (now current_source_roots()) and rewrites tests/preparation/test_forward_cache_sources.py (+118/−12) — the same test file #668 adds 78 lines to, so that file is a textual conflict hotspot.

Also new overlap on host_ranks.py + that same test: #671 (kbenkhaled, open) edits ignition/preparation/host_ranks.py (Gpu.integrated through local_topology/topology_gpu, ~:126-141) and tests/preparation/test_forward_artifact_sharing.py, both files #668 touches/must keep green.

#675 (Reederey87) closed 2026-12-02 12:10 as superseded by #668 and is now among #668's closes: refs, alongside #651.

#10 [medium] People: lukealonso owns these files; #651/#631 reporters silent on this PR

Author lukealonso is a charter-listed priority contributor ("Priority contributors (@voipmonitor, @original-el8, @lukealonso) carry extra weight"), GitHub association COLLABORATOR, 36 merged PRs in 180 days, 3 currently open (#667, #659, #658). Areas: helios/src (26), docs (22), ignition/preparation (10), flare-cli/src (9), heliopause/src (7).

#11 [medium] Project fit: docs gaps — no doc update for reconcile or peer b12x env

docs/preparation-development.md:337-349 documents CollectivePreparation relaying b12x contributions and _mixed_tuning_batches sharded/remainder batches, but says nothing about reconcile_selections, request-name matching, or the post-tuning second preparation pass. docs/preparation-development.md:124-127 says the runtime patch identity contributes to Ignition forward cache keys — #668 extends that key with B12X_* env, with no doc change. docs/multi-host.md:364-369 warns ranks can trail each other "by minutes inside one forward" during compiled warmup; :377 "All hosts need matching Flare executables and preparation sources" is the closest existing statement to #668's peer-env requirement. docs/model-preparation.md:121-123 documents kernel_cache/kv_codec caching under [paths] kernel_cache — the cubin path #668 now remaps onto each peer (runtime_core.py:405-408). Docs changed by #668: none (8 files, no docs/), so the documented multi-host preparation contract is not updated for the peer b12x env or the peer-local kernel cache.

#16 [medium] Amendment D — citation fixes: flashinfer pin is a commit, docs coverage confirmed zero

Two corrections to report #12, both verified in the repository at PR head:

  1. CI's FlashInfer pin (corrects report #12's "pins flashinfer-python to local-inference-lab/flashinfer branch main"). pyproject.toml:47 (identical on main and at PR head) is flashinfer-python = { git = "https://github.com/local-inference-lab/flashinfer.git", rev = "5a8ceed80ccc58e11a4d49ccc910f52967699c09" } — a pinned commit, not a branch. .github/workflows/python-cpu.yml:29-33 does uv sync --extra prepare --extra test then pytest tests/ -q with CUDA_VISIBLE_DEVICES: "". The substantive point in #12 stands (the paired flashinfer#199 is not what CI installs), but the mechanism is "a different pinned revision", not "floating main", and the pin is charter-consistent ("Be explicit and pin everything", #215). Phrase it as: CI validates #668 against pinned flashinfer rev 5a8ceed8, not against flashinfer#199.

  2. Documentation coverage of both new contracts is confirmed nil. search_code over docs/ for reconcile_selections|b12x_environment returns no matches; docs/preparation-development.md has no reconcile/agree_selections/b12x_environment; docs/multi-host.md has no b12x|kernel_cache|environment. AGENTS.md:234 routes any multi-host-preparation change to docs/multi-host.md, and AGENTS.md:461-475 (as amended by merged #690) documents exactly which environment variables Flare inspects — the new peer b12x env channel and the peer-local kernel_cache remap are neither. So scratchpad #11's "no docs" finding is exact, not just a missing paragraph in multi-host.md: docs/cli-design.md's "No environment-variable behavior switches" section (as amended by #690) and docs/preparation-development.md are the sections whose claims the new peer env channel actually extends.

Charter mapping unaffected: "Bring real evidence... Bug fixes need to address the root cause" (#397) still bites on the broad _CORRUPT_ARTIFACT_ERRORS handler (aot.py:64-76, :1371-1380); "Supported matrix & compatibility... verify cross-node" moves from wholly unaddressed to partially addressed by the two hardware comments (entry 13) — they verify the diagnosis and the workarounds on 2x GB10, not this PR's head.