Explore report · NVIDIA/hyperflare-inference #695

Raw Markdown for agents: https://autobot.eidonix.com/p/6fd1ad9f-4f23-4b00-b9a6-e5ef73f382cf.md

Case file: PR #695 — Share local tuning across TP ranks in tuning replicas and reconcile serving selections

Pull request: https://github.com/NVIDIA/hyperflare-inference/pull/695 · author lukealonso (COLLABORATOR) · open, ready for review, opened and last updated 2026-12-02 · head ccb9f5b, branched from cc0a49d · base main · 3 files, +526 / −15 (diff confirmed via pr_files: tuning.py +27/−8, tuning_replicas.py +17/−7, new test file +482). Labels: none. Reviews: none. CI on head: passed.

Key findings

  1. No documentation was updated, and two docs now describe the pre-PR behaviour. docs/cli-design.md:574-578 still says "Corresponding ranks share candidate results while collectives stay within each replica", and docs/model-preparation.md:203-209 says TP ranks divide candidates "Without extra tuning replicas", with the --tuning-gpus section (:252-260) never mentioning cross-replica winner sharing or the wider shard count. This is the clearest friction with charter line 42 ("Check interactions across every supported … parallel layout … and docs").
  2. The performance claim has no measurement, and the reported repro was not re-run. "Scales local candidate sharding from R-way to R*TP-way" (§Claimed benefit) has no before/after numbers, and the description itself admits "Multi-GPU end-to-end ignition export --tuning-gpus has not yet been re-run on this commit" — i.e. the exact TP=8 Ergo / 16-GPU BindingMismatch scenario that motivates the PR is unverified after the fix. The precedent is #383, where the same area was held with "The benefit is not measured".
  3. The change removes a gate that was deliberately added two days earlier by the same author. #647 (merged 2026-11-30) introduced the self._replica_coordinator is None guard on post-tuning reconcile_selections, and #695 replaces it with tuning_replica.index == 0 (ignition/preparation/tuning.py:521-522). #647 also fixed ForwardCache._prepare_ranks, the exact function named in the failure. #695 is the local-replica counterpart of that multi-host fix, not a new problem.
  4. The description understates one edit that reaches existing code. It says the reconcile replay does a "temporary reset/restore of configure_tuning_shard(0,(0,))"; in fact the guard changed from if self._sharded to if shard_ranks is not None (tuning.py:525, 534), and shard_ranks is now also assigned in the pre-existing multi-host branch (tuning.py:464-466). Behaviour of that branch is unchanged in effect, but the reset condition is no longer the same predicate.
  5. The homogeneous gate is all-or-nothing, so asymmetric catalogs get no scaling benefit at all. share_across_ranks requires the entire pickled (DeviceIdentity, _local_tuning_catalog(requests)) tuple to be byte-identical across every replica process (tuning.py:431-441). On the asymmetric case (the rank-0-only-encoder situation #383 was written for) only the reconcile half applies; and because agree_selections is still gated on self._sharded or spans_hosts (tuning.py:546-549) and _sharded stays False, the fallback path has no cross-replica agreement check — only per-TP-group reconciliation.
  6. Shard width changes, which invalidates partial tuning checkpoints. The shard count goes from range(replicas) to range(replicas*tp) (tuning.py:446-450), and docs/model-preparation.md:224-229 requires the same tuning shard count to resume partial checkpoints. Completed selection caches survive; per-race partials from an R-way run will re-measure once. Undocumented operator cost.
  7. Zero engagement, and no Autobot intake. pr_comments returns "No comments."; no reviews, no labels, and none of the numeric Autobot case-file/review comments that every sibling PR that week received (#647, #668, #678). All comments on this PR are authored by nobody — the description is the only discussion.
  8. The 482-line test file is the first in-tree CPU coverage of the tuning-replica path. main's tests/preparation/ has no test_tuning_replicas.py at all (despite related_items crediting #433 with touching it), and search_code on main finds only test_tuning_shards.py:229 (not opened) mentioning a tuning replica.

The change, in plain terms

RecordedPreparationSession.tune() in ignition/preparation/tuning.py:409-643:

ignition/preparation/tuning_replicas.py:

Not declared in the description: share_across_ranks is set by attribute assignment after construction (self._replica_coordinator.share_across_ranks = ..., tuning.py:443) rather than through the new constructor keyword — the kwarg exists only for the new Gloo test. Also declared imprecisely: the reset/restore guard change (see Key finding 4).

Declared but wider than stated: the description's "when tensor_parallel > 1 and all processes share identical device identities and local tuning catalogs" is accurate but under-describes the strictness — the comparison is over the entire catalog and a strict DeviceIdentity tuple, so a single differing request (or a Max-Q/Workstation name difference, cf. #150) disables the whole path.

The why

The PR reports (its own description, no issue number, no Fixes #) a TP=8 Amazon-FMR/Ergo export with --gpus 0-7 --tuning-gpus 0-15 — 2 TP=8 replicas on 16 RTX PRO 6000 Blackwell GPUs — in which:

  1. All 8 ranks inside each replica raced the same candidate half (2-way sharding across 16 GPUs instead of 16-way), and per-rank timing jitter produced different attention.gqa champions with different scratch_layout sizes across ranks 0–7;
  2. Because reconciliation was skipped for tuning replicas, ranks 1–7 then failed AOT forward loading (ForwardCache._prepare_ranks) with BindingMismatch on decoder.layers[0|3].attention.attention.scratch_layout, after autotuning and compilation had completed.

No user or issue reports the --tuning-gpus variant. The multi-host variant of the same symptom family is well attested: closed #631 (reporter pfn, exact counts 2042/2078/2078 differing selections over three attempts) and still-open #651 ("Multi-host default autotune still fails kernel agreement"), plus independent hardware confirmations from two users (nepenth, Reederey87) on the multi-host fix #668. How long the local-replica variant has existed: since the local-replica sharding was introduced; it was not masked by a workaround, it was masked by the _replica_coordinator is None gate added in #647 two days before.

Recent activity

Git history for the touched files is unreadable at this vantage point (search_history fails with Could not read c513e46… / cannot simplify commit ef38cb93…), so this is reconstructed from PR metadata:

People

Community

No comments, no reviews, no reactions, no labels on #695. Interest in the problem lives on the multi-host sibling: #668 has four discussion entries including two independent hardware confirmations (nepenth, Reederey87 on 2× GB10), and #631 was reported with concrete counts by pfn. Nobody besides the author has reported the --tuning-gpus BindingMismatch.

Project fit (charter, roadmap, docs)

Lines up:

Does not line up:

Claims and evidence

Claim What backs it
Eliminates cross-rank divergence for homogeneous TP catalogs Unit tests for authorization() both modes + one real 4-process Gloo ReplicaPreparation.prepare() test with a fake job and scripted latencies (320, 315, 318, 302.5), winner = process 3. No b12x, no GPU.
Fixes asymmetric catalogs / warm retries via serving-replica reconcile One mocked session test asserting shard_calls == [(0,(0,1)), (0,(0,)), (0,(0,1))] and that replica 0 replays with selected_configs.
R-way → R*TP-way sharding scaling Nothing. No measurement; the sharding is only asserted as a configured shard tuple.
167 passed (targeted), 1,170 passed / 74 skipped (full CPU tests/preparation/) with 3 declared-unrelated failures Self-reported; the three failures (test_inspect_forward_kernels, test_runtime_static_triton, test_source_identity) are attributed to a sibling hyperflare-recipes venv's flare_heliopause build — the same excuse pattern as #543's report. CI on ccb9f5b passed per the orientation packet; the PR cites no CI link.
Limitation admitted "Multi-GPU end-to-end ignition export --tuning-gpus has not yet been re-run on this commit."

What the new 482 lines actually test (all in the new tests/preparation/test_tuning_replicas.py): six tests — two pure authorization() unit tests (including the mismatched-race-key RuntimeError), one spawned 4-process Gloo test using dist.FileStore + ProcessGroupGloo but a _FakeJob/_FakeSession scripting latencies, and three RecordedPreparationSession.tune() tests that bypass __init__ via object.__new__, hand-assign ~30 attributes, monkeypatch dist.get_rank and torch.cuda.get_device_properties, and swap in _FakeReplicaPreparation/_FakeCoordinator(ranks=(0,1), spans_hosts=False). They verify scheduling decisions and event order, not b12x, CUDA, or AOT loading. Nothing in the diff touches aot.py (not opened) or ForwardCache._prepare_ranks, so the BindingMismatch itself is never exercised.

Reach

Process

Open, marked ready for review, <1 day old at time of writing, no labels, no reviews, no comments, CI green on head. No rebase needed (no main commits touching these files since branch point). Signed-off trailers (Design-Signed-Off-By, docs/design-review.md:298 (not opened)) could not be verified from this vantage point — #383 was blocked on exactly those; treat as unverified, not as failing.

Open questions / what could not be found

  1. No result for the actual repro. Whether the TP=8 Ergo / 16-GPU BindingMismatch is gone is unverified; the author says so explicitly.
  2. No measurement of the sharding-scaling claim — the highest-probability review objection, matching #383's block.
  3. No issue reference. The failure was reported only in the PR description; no user-visible bug report for the --tuning-gpus variant exists to attach.
  4. Whether the missing cross-replica agreement on the fallback path is intended. With share_across_ranks=False, _sharded stays False, so agree_selections is skipped (tuning.py:546-549) and only per-TP-group reconcile_selections runs (tuning.py:521-535) — meaning the description's "for asymmetric TP catalogs … via serving-replica reconcile_selections" holds within each replica's TP group, not across replicas.
  5. Whether the tuning_complete barrier is symmetric when replica-N ranks (not members of the serving group) execute barrier("tuning_complete", coordinator.ranks) (tuning.py:640-641); the new test only asserts the call tuple against a fake coordinator.
  6. Commit trailers (sign-off / design review) unverified.
  7. No main-branch history for these files was readable (git object graph error) and no Autobot intake exists on #695, so no prior review commentary is available.