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:
- Out of repository scope.
ignition/components/bf16_bmm.py(+184, new),ignition/components/linear.py(not opened) (+8/−9, file deleted onmain),tests/components/test_bf16_bmm.py(not opened) (+44),tests/components/test_bf16_bmm_cuda.py(+122) — 349 of 373 added lines — belong inlocal-inference-lab/hyperflare-recipes.docs/design-review.md(not opened) principle 15 explicitly forbids waiving the boundary for a performance gain. Merging failstest_core_boundary.pyoutright. - The motivating caller no longer exists. The only in-repo user of
BatchedUnquantizedProjectionwasignition/recipes/glm53/mla.py(not opened), whichmainhas removed. Onmainthis PR has zero in-repo behavioural effect on served workloads. - 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/bmmalready used by the MXFP8 sibling as a cheaper alternative). Testing cannot settle that. tuning.pyhunks must be re-resolved.main'stuning.pyis 829 lines with_prepare_compiler_toolchainat 53-66, the call in__init__at 108, anddeclareat 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:
- The toolkit libdevice can be selected before
CUDA_HOMEis set from configuration — the identity mismatch the change exists to remove. runtime_patches.apply()hard-fails (PreparationError) on a torch/triton version mismatch at import of the components/fixtures tree, i.e. at test collection, not at session construction.- The new test case does not cover this:
tests/preparation/test_toolchain.py:76-77runs withCUDA_VISIBLE_DEVICES=""and popsTRITON_LIBDEVICE_PATH, and never callsenvironment.apply. Theimportparameter (:16,46-49) verifies the identity equals the post-switch identity, not ordering against configuration. In a parent shell that already hasCUDA_HOMEset, the test passes while the CLI path may still be wrong. - I could not read
_set_triton_libdevice_path(torch internals) to prove whether the wrong path is actually latched; that is precisely why a configuration-ordering test, not a GPU kernel test, is the required evidence.
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
- The component half would be tested on code that must move to another repository and, at minimum, change in three places (S2-S4) first. cn5 (RTX PRO 6000 / SM120) results from a stale, conflicting branch would not transfer.
- The runtime half's genuine risk (S1) is CPU/environment-ordering, not GPU compute. It is settled by a subprocess import-order test comparing
CUDAOptions().extern_libs/hash()before and afterenvironment.apply, plus the existing toolchain test — no GPU work, no cn5/cn7 allocation. - The PR's own performance numbers (GB10 8,192 rows: TP2 absorption 3.53 → 2.02 ms vs a 1.84 ms copy floor; TP4 1.77 → 1.00 ms) already answer the "is the kernel viable" question. What is missing is not more GPU time on the kernel; it is an isolated end-to-end (component on vs off) measurement per
docs/performance-work.md(not opened), which only becomes meaningful after the change is rehomed onto a rebased tree. - cn7 (single GB10, 10 CPUs) is the only host here with the architecture the motivation cites; a single GPU also means TP2/TP4 projections cannot be exercised as claimed, and
glm53is not onmain. cn5's four RTX PRO 6000 cards are SM120, already reported as passing five CUDA tests, so re-running them adds almost nothing.
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).
- Rebase check:
pytest tests/preparation/test_core_boundary.pygreen on the rebased runtime branch. - Extended toolchain test (the missing one): subprocess that imports
ignition.preparation.tuning(and one component module) withCUDA_HOME/TRITON_CACHE_DIRunset, then callsignition.cli.environment.apply(...)with a configuration whose[paths] cudais a non-default directory; assert (i) the libdevice recorded inCUDAOptions().extern_libsequalsPath(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.