#1 [high] PR 231 shape: files, what changes
PR 231 "Race a Triton tile kernel against cuBLAS for GLM's BF16 head projections". Files: ignition/components/bf16_bmm.py (new, 184), ignition/components/linear.py (+8/-9), ignition/preparation/tuning.py (+9/-5), tests/components/test_bf16_bmm.py (new 44), tests/components/test_bf16_bmm_cuda.py (new 122), tests/preparation/test_toolchain.py (+6/-2).
Content: new prepared component flare.bf16_bmm (native_contract/native_plan from
ignition/components/native_operator.py) racing cuBLAS (torch.bmm) vs Triton tiled kernel over
declared [G,M,K]x[G,K,N] strides; BatchedUnquantizedProjection (linear.py:69-86) now declares that
plan instead of calling flare::bmm_out; tuning.py calls _prepare_compiler_toolchain() at module
import (line 66) instead of in RecordedPreparationSession.init / declare().
Comments: original-el8 triage (2026-11-08) = kernel perf, triage:design-review, model:glm-5.3; 2026-11-13 merge conflict in ignition/components/linear.py vs main (PR head 0ba78ebe vs main 97cfeb0); 2026-11-24 repository-split triage: BF16 bmm impl + projection wiring + component tests belong in hyperflare-recipes; this repo keeps only ignition/preparation/tuning.py change.
#2 [high] Charter checks for PR 231
Charter (read_charter) key clauses relevant to PR 231:
- "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210)."
- "Solve the right problem in the right place... smallest footprint in shared code".
- Vision: "squeeze the most out of workstation and compact hardware—specifically SM120/SM121 workstations and DGX Spark".
- Principle 4 (design-review.md:53): "Use FlashInfer/b12x and NVIDIA directly... avoid interchangeable backends or portability layers."
- Priority contributors: @voipmonitor, @original-el8, @lukealonso ("carry extra weight—we never close their PRs out of hand as 'low value'"). PR 231 author = original-el8.
- Captured-graph op contract requires owner approval (matters for the new
flare::bf16_bmmcustom op).
#3 [high] PR 231 is pre-split; component violates enforced boundary
The repo has since been split; the PR branch is from before it.
- main (1922 files) has NO ignition/components/linear.py, no bf16_bmm.py, no ignition/recipes/. ignition/components/ on main has only 14 files: init, capacity, collectives, completion, engram, flashinfer_sampling, logprobs, ngram_delivery, readiness, sampling, state, state_transfer, vision_delivery, vision_state.
- AGENTS.md:385-392 (main): "Keep ignition/components/ in this repository limited to the 13 Helios-ABI runtime interface modules ... enforced by tests/preparation/test_core_boundary.py. Put reusable b12x/Triton model execution mechanisms in hyperflare_recipes/components/".
- tests/preparation/test_core_boundary.py:62-64 on main asserts that exact set. PR 231 adds ignition/components/bf16_bmm.py and edits ignition/components/linear.py -> would fail that test after rebasing.
- docs/model-development.md:276 (main) links UnquantizedProjection to hyperflare_recipes/components/linear.py — i.e. linear.py now lives in the recipes repo.
- AGENTS.md:12/224-225/379-392: recipes, reusable b12x model components, operator-tuning fixtures, numerical references, model test suites live in local-inference-lab/hyperflare-recipes. => The whole bf16_bmm.py + linear.py + tests/components/test_bf16_bmm* payload belongs in hyperflare-recipes; only the ignition/preparation/tuning.py hunk is core-repo work. Consistent with maintainer triage comment 2026-11-24 on PR 231. Rebase also needed: main's tuning.py has collective_tuning/collective_ladder/tuning_shards that the branch lacks; merge conflict in linear.py reported 2026-11-13 for head 0ba78ebe vs main 97cfeb0.
#4 [high] tuning.py import-time toolchain: in scope, small, with import-time risk
Where the runtime hunk actually lands:
- main ignition/preparation/tuning.py:53-66 has _prepare_compiler_toolchain() unchanged; called at init (line 108) and in declare() (line 804).
- PR moves the call to module import (tuning.py:66) and deletes both deferred calls.
- It is a process-wide bootstrap: runtime_patches.apply() (pins torch==2.14.1+cu132, triton==3.8.0 per runtime_patches/init.py:21-22) plus _set_triton_libdevice_path() under config.patch(emulate_precision_casts=_OPTIONS["emulate_precision_casts"]) (compilation.py:26-29).
- Motivation stated in PR: Triton memoizes compiled kernels by specialization+launch options only, so a kernel compiled before the libdevice switch is later reused under an undiscovered identity ("preparation used undeclared programs"). Fix = switch identity before anything can compile.
- tests/preparation/test_toolchain.py gains a third subprocess mode "import" asserting CUDAOptions() observed at import already matches toolkit libdevice and that CUDA is not initialized. Runs in 3 subprocesses with CUDA_VISIBLE_DEVICES=""; skips (77) if CUDA_HOME/libdevice missing.
- Risk: any import of ignition.preparation.tuning (many, incl. ignition.cli.preparation -> ignition.recipes.resolve) now applies runtime patches, which raise PreparationError if torch/triton versions differ (e.g. CPU-only test envs, rust fixture tests importing it, tooling). That is a real behavior change on the import path; needs a check that non-preparation imports still work. This hunk is genuinely in-scope for THIS repo (it's core preparation code, not a recipe component).
#5 [high] Benefit arithmetic, evidence gaps, concrete side issues
Evidence quality (charter #210 requires "benchmarks showing an actual speedup over main on a served workload"):
- PR body gives per-op microbenchmarks on one GB10 at 8,192 rows: TP2 absorption 3.53 -> 2.02 ms (copy floor 1.84), TP2 expansion 2.62 -> 2.02, TP4 absorption 1.77 -> 1.00, TP4 expansion 1.27 -> 1.01.
- Only end-to-end number: exported package with this + other prefill changes = 2945 tok/s vs 2620-2631 for packages without them; PR itself says "That difference is not attributed to this PR alone."
- Untested on this branch: GB10, the GLM MLA checkpoint test, SM103 (PR Limitations section).
- Rough isolated gain (my arithmetic): GLM 5.3 has 45 layers (ignition/recipes/glm53/weights.py:145). Absorption saves 1.51 ms/layer x45 = 68 ms; expansion 0.60 x45 = 27 ms -> ~95 ms per 8,192-token prefill pass. At 2945 tok/s (2.78 s for 8,192 tokens) that is ~3.4% of prefill; decode rows are tiny and cuBLAS may win there, so decode gain ~0.
Side issues found:
flare::bmm_out(PR head ignition/components/linear.py:89-96) is left defined+registered but unused after the wiring change -> dead code; only flare::sm103_bmm_out remains used (linear.py:452).- Import-time toolchain: in the CLI path environment.apply() sets os.environ["CUDA_HOME"] from [paths] cuda (ignition/cli/environment.py:36-61; config.py:161-164; serve.py:211/322/476/587) but recipe modules that import ignition.preparation.tuning (e.g. ignition/recipes/glm53/bootstrap.py:47) are imported while resolving the model, i.e. before environment.apply. Moving _set_triton_libdevice_path() to import time can therefore resolve the toolkit libdevice before the configured CUDA_HOME is installed. Needs verification before merging.
- runtime_patches.apply() raises PreparationError on torch/triton version mismatch (ignition/runtime_patches/init.py:81-82,103-105); thousands of test modules and tools import ignition.preparation.tuning, so the failure now surfaces at import rather than at session construction.
- docs/TODO.txt (main, lines 185-187) already records "Invalidate b12x preparation discovery's cached compiler context when Inductor selects a different libdevice in the same process. Repeated GPU test preparation can restore program keys for the preceding library." This PR addresses that entry but does not update it.
- Private b12x coupling (_NATIVE_JITS, _lib.compile_plan/compile_pool/program_cache) is NOT novel: the same pattern is already in ignition/components/moe_sm103.py:31-33,357,387, gated_norm_preparation.py:10-12, qk_norm_rope.py:11-17, region_selection.py:10-12, selected_attention.py:9-11, window_attention.py:9-11, window_staging.py:6-8, msa_attention.py:11-13.
- Duplication question: the MXFP8 sibling BatchedQuantizedProjection already uses b12x's own gemm.plan_bmm / gemm.bmm (linear.py:406-458) with a_dtype="bfloat16". The BF16 path instead grows a new Triton kernel in-tree; whether b12x's bmm accepts bf16 x bf16 (b_dtype="bfloat16") should be answered before adding a second BMM implementation.
- Blast radius in-repo is one recipe: the only consumer of BatchedUnquantizedProjection is ignition/recipes/glm53/mla.py:244/252-257/321-329/340-344. All declarative shapes are token-major transposes with [heads=16/32/64, rows, 256|512] operands.
- b12x coalesces equivalent declarations across layers (docs/core-design.md:770-778), so the added compile/race cost is bounded by distinct shapes, not by 45 layers.