Pre test report report · NVIDIA/hyperflare-inference #231

Raw Markdown for agents: https://autobot.eidonix.com/p/af99cb9a-2172-4f4b-99d5-ff7b0abe974c.md

Pre-test report — PR #231 "Race a Triton tile kernel against cuBLAS for GLM's BF16 head projections"

Recommendation: DO NOT refer to hardware testing yet. Return to author.

Reason: the change cannot land in its current shape. Four of its six files are out of scope on main after the repository split, one of the two runtime hunks must be re-resolved against a tuning.py that has moved, and several concrete defects (dead custom op, conditional kernel registration, an untested ordering regression in a process-wide side effect) have to be fixed first. Any GPU time spent on 0ba78eb would be spent on code that will be rewritten, rehomed and rebased. A minimal, conditional hardware plan is supplied at the end for when the blockers clear.

1. Verified state of the PR against main

Check Result
ignition/components/*.py on main exactly __init__.py (not opened) + 13 modules (capacity, collectives, completion, engram, flashinfer_sampling, logprobs, ngram_delivery, readiness, sampling, state, state_transfer, vision_delivery, vision_state). No linear.py (not opened), no bf16_bmm.py.
ignition/recipes on main does not exist (verified: list_files ignition/recipes → no files). tests/preparation/test_core_boundary.py:40-48 asserts it must not exist.
tests/preparation/test_core_boundary.py:62-64 (main) assert actual == RETAINED_IGNITION_COMPONENTS — exact set equality. Adding bf16_bmm.py fails this test.
AGENTS.md:385-392 (main) "Keep ignition/components/ limited to the 13 Helios-ABI runtime interface modules… Put reusable b12x/Triton model execution mechanisms in hyperflare_recipes/components/."
PR head 0ba78eb 18 days old, predates the split; author reports an unresolved conflict in ignition/components/linear.py (not opened); head CI red.
Author's own triage comment (2026-11-24) Concedes only the ignition/preparation/tuning.py change can remain in this repository.

Blocking items confirmed, not merely review opinion:

  1. Out of repository scope. ignition/components/bf16_bmm.py (+184, new), ignition/components/linear.py (not opened) (+8/−9, file deleted on main), tests/components/test_bf16_bmm.py (not opened) (+44), tests/components/test_bf16_bmm_cuda.py (+122) — 349 of 373 added lines — belong in local-inference-lab/hyperflare-recipes. docs/design-review.md (not opened) principle 15 explicitly forbids waiving the boundary for a performance gain. Merging fails test_core_boundary.py outright.
  2. The motivating caller no longer exists. The only in-repo user of BatchedUnquantizedProjection was ignition/recipes/glm53/mla.py (not opened), which main has removed. On main this PR has zero in-repo behavioural effect on served workloads.
  3. Needs a maintainer placement decision, not just a rebase. Whether a raced BF16 batched matmul is a shared b12x-level mechanism or a recipe component is unanswered in the PR (reviewers flag b12x.gemm.plan_bmm/bmm already used by the MXFP8 sibling as a cheaper alternative). Testing cannot settle that.
  4. tuning.py hunks must be re-resolved. main's tuning.py is 829 lines with _prepare_compiler_toolchain at 53-66, the call in __init__ at 108, and declare at 799 (call at 804). The PR's deleted hunk lands at different offsets after rebase; the change must be re-reviewed, not assumed mechanical.

2. Substantive defects that must be fixed before any test run

S1 — import-time toolchain preparation inverts the documented ordering (runtime half, high risk). The PR adds a bare _prepare_compiler_toolchain() at ignition/preparation/tuning.py:66, running runtime_patches.apply() and Inductor's _set_triton_libdevice_path() at import of a module ~45 component modules, the fixtures, and every recipe bootstrap import (verified by search). ignition/cli/environment.py:5-11,36-61 documents and implements the opposite order: it sets TRITON_CACHE_DIR (line 47) and CUDA_HOME (line 54) before runtime_patches.apply() (line 61). ignition/cli/serve.py:14 imports ignition.planning at module scope, and every environment.apply(...) call is inside a function (serve.py:211/322/476/587), so the toolchain preparation now runs before the configured environment exists. Consequences:

S2 — dead custom op. ignition/components/linear.py:89-96 (not opened): the PR deletes the only caller of flare::bmm_out and leaves the op plus its fake registered. Repo-wide search for bmm_out returns only this pair and the unrelated, still-used flare::sm103_bmm_out (linear.py:452 (not opened),463-469). Dead public operator surface; delete in whichever repository the file ends up in.

S3 — conditional kernel registration. ignition/components/bf16_bmm.py:108 adds _bmm_kernel to b12x's private compile_plan._NATIVE_JITS inside the @program_cache-decorated compile_bmm (line 99), so registration happens only on a program-cache miss. The sibling components register unconditionally at module scope (sm103_projection.py:258 (not opened), moe_sm103.py:357 (not opened)/387 per reviewers). The comment at bf16_bmm.py:105-107 states a requirement that the placement only half-satisfies; the fix is a two-line move and is strictly safer.

S4 — new rejection of layouts torch.bmm accepted. query_from_call (bf16_bmm.py:142-153) now refuses non-16-byte-aligned bases, non-contiguous source/output rows, and weights contiguous in neither K nor N. That is correct for the Triton tile, but it is a behavioural regression for any existing caller and directly collides with open PR #471, which rewrites the same class with the opposite (staging copy) policy. This must be resolved as a decision before the component is rehomed.

Lower-severity, fix while touching the code (not worth their own test cycle): bf16_bmm.py:174 omits session=session, so fixtures/resources.py:30-33 never releases the session's benchmark cache before the race allocates (memory spike only — the owners tuple keeps storage alive, so no correctness break); bf16_bmm.py:176-179 hand-rolls the PreparedCall that fixtures/bf16_gemv.py:10-16 (not opened) already provides; bf16_bmm.py:120-123 re-validates shapes/strides on every captured replay when query_from_call already enforced them (hot-path cost, and inconsistent with siblings); the module docstring at bf16_bmm.py:7-9 and the PR description claim FP32 accumulation with one BF16 rounding as the operator invariant while the champion tactic is torch.bmm (reduced-precision BF16 reduction may be enabled by default); docs/TODO.txt:185-187 on the head records exactly the libdevice failure class this change addresses and is neither updated nor closed; a stray print at test_bf16_bmm_cuda.py:92.

Not defects: kernel code (charter permits concrete defects only — none found), tactic filtering matches the unmasked loads, scratch_bytes=0 holds for both tactics, the mutating-op + fake registration follows house pattern, and the relocated stride/dtype validation is not weakened.

3. Expected value of a hardware test right now: low

4. Minimal hardware plan — run only after blockers clear

Execute once, after (a) the split is done — component in hyperflare-recipes, runtime change rebased onto main — and (b) S1-S4, the session= omission and the docstring claim are fixed. Budget ~1.5 GPU-hours total; nothing here is worth repeating per-architecture "just in case".

Stage 0 — CPU only, no GPU allocation (gate).

  1. Rebase check: pytest tests/preparation/test_core_boundary.py green on the rebased runtime branch.
  2. Extended toolchain test (the missing one): subprocess that imports ignition.preparation.tuning (and one component module) with CUDA_HOME/TRITON_CACHE_DIR unset, then calls ignition.cli.environment.apply(...) with a configuration whose [paths] cuda is a non-default directory; assert (i) the libdevice recorded in CUDAOptions().extern_libs equals Path(cuda)/"nvvm/libdevice/libdevice.10.bc" after apply, (ii) CUDAOptions().hash() equality with the post-switch identity, (iii) not torch.cuda.is_initialized(), (iv) the version-mismatch path raises at the documented point. Run against main (A) and the PR (B).
    • This is the only change that touches every entry point; if it fails, stop — no GPU time.

Stage 1 — kernel correctness on cn7 GB10 (1 × GB10). Run the two CUDA test files once: tests/components/test_bf16_bmm_cuda.py (≤1 BF16 ulp vs torch.bmm for every tactic, row-tail NaN masking, raced selection, captured-graph replay with zero allocation) and the CPU selection tests. Compare A/B only in the sense that A = the same tests against the pre-PR torch.bmm path. Expected: 5 tests pass, allocation counters unchanged across replay.

Stage 2 — A/B throughput on cn7 GB10 (the one measurement that matters). Same checkpoint, same package, projection wired to (A) plain torch.bmm and (B) the raced component, one exported core, the two GLM head-projection geometries the PR cites (8,192-row absorption n-major, 8,192-row expansion k-major), plus a decode-shaped run (~32 rows) to confirm the race does not pick a slower tactic where cuBLAS wins. Record selected tactic per geometry, ms per operator against the plain-copy byte floor, and one end-to-end prefill tok/s pair. Three repetitions, take the median; report the copy floor in the same table. Do not re-measure the other five tile shapes — the race already covers selection.

Stage 3 — cn5 (4 × RTX PRO 6000 / SM120), only if Stage 2 shows the race selecting a non-cuBLAS tactic on GB10. One run of the same CUDA test file plus the Stage-2 geometry table on one card. Skip entirely if the PR description's SM120 claim is replaced by a measurement in the rehomed PR.

Explicitly out of scope for testing: the _TILES table contents, the kernel body, and docstring/prose fixes; SM103 (not covered by this component and named only as an unrun check); TP2/TP4 multi-GPU projections (cn7 has one GPU, and the operator is per-rank).

5. What would change this recommendation

Refer to a test engineer if the author instead splits the PR now and the runtime-only PR (the tuning.py change + test_toolchain.py) arrives rebased with S1 fixed and its ordering test included — that PR is 2 files and is validated by Stage 0 only (no GPU allocation), so it can be verified in minutes. The recipe-repository PR becomes a separate, ordinary review with Stages 1-2 attached.