Skip to content

Profiles: the inspected head kernels issue HGMMA (wgmma), and all 14 accumulate BF16 as the Hopper model says (k = 16, F = 25, truncation) - #186

Merged
SamMausberg merged 10 commits into
mainfrom
profile/tensor-core
Oct 2, 2026
Merged

SamMausberg merged 10 commits into
mainfrom
profile/tensor-core

Conversation

@SamMausberg

@SamMausberg SamMausberg commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

The certified head's Hopper error model assumes that the stock head GEMM adds each block of 16 BF16 products and the FP32 accumulator in one aligned multi-term adder. The adder keeps F = 25 fractional bits below the largest addend's leading bit, truncates what it drops and truncates the sum to FP32. The paper attributes this model to Khattak and Mikaitis, who measured it through the warp-level mma (SASS HMMA). This PR measures, on this GPU, which instruction the stock kernels issue and how that instruction accumulates.

Based on main now that #173 has merged; its commits are f00f50e through cabbab2. tensor_instructions.py imports metric_rows from #173's ncu_summary.py.

Results (measured; evidence/profiles/README.md, "Which tensor-core instruction the head uses, and how it accumulates")

Instruction. In the ncu reports of the head GEMM at M = 1 (nvjet_sm90_tst_512x8_64x3_2x1_v_bz_TNT) and M = 32 (..._384x32_...), all BF16-to-FP32 tensor operations are on the HGMMA (warpgroup wgmma) path and none on the HMMA path. The captured SASS has 64 and 48 HGMMA instructions (HGMMA.64x8x16.F32.BF16, HGMMA.64x32x16.F32.BF16) and no HMMA (head_tensor_instructions.json). The other head kernels cannot be read statically, because cuobjdump -symbols lists no nvjet_sm90 function in libcublasLt.so.13 or libcublas.so.13.

Accumulation. wgmma_precision.py uses crafted rows whose exact sums are known, so that one property of the adder decides each result. It runs through Triton tl.dot (four wgmma.mma_async in the PTX, HGMMA.64x16x16.F32.BF16 in the SASS) and through the head's own torch.matmul(ones, W.T) at W = 248320 x 2560, at one row count per head kernel. The profiler confirmed all 14 kernels of evidence/certified_head/README.md. Triton and all 14 kernels give the same answers:

  • F = 25 fractional bits. {1, 2^-e, -1} returns 2^-e up to e = 25 and 0 from 26.
  • Dropped bits truncated toward zero. Dropped fractions of 0.25 to 0.875 of the 2^-25 quantum vanish for both signs; rounding to nearest would keep one above 0.5. The negative mirror of the power-of-two test also rules out rounding toward minus infinity.
  • Accumulator inside the aligned sum (Triton). With C = 1 and products {2^-e, -1}, survival stops at 25.
  • Blocks of 16 products. A 2^-60 term is lost inside the block of a cancelling pair and survives from k = 16.
  • Running accumulator joins the next block. A 2^-60 term placed before the pair is lost at every position.
  • Sum truncated to FP32. On Triton, two ties and two non-tie sums 0.75 of an FP32 step above a representable value give the toward-zero result. On cuBLAS, FP32-exact control rows show the BF16 epilogue rounds to nearest even, and under that epilogue the tie and quarter-step rows give the toward-zero result.

This matches the paper's Hopper model (k = 16, F = 25, truncation) and satisfies the conservative model. It is a measurement on crafted inputs of one GH200 (driver 570.195.03, CUDA 13.0, PyTorch 2.13's cuBLAS), not a vendor contract. The operands are powers of two and short sums of them, with one operand of each product equal to 1. Full-significand products, subnormals, K offsets beyond 128 and other GPUs or libraries were not probed. The README states this scope.

Changes

  • experiments/profiling/tensor_instructions.py (new; run by analyze_all.sh) and wgmma_precision.py (new; run_all.sh wgmma, GPU for a few seconds, no timing).
  • evidence/profiles/head_tensor_instructions.json (repo_commit f850e97) and wgmma_precision.json (every row and result, component versions, repo_commit 5e3a1fc). Both were produced in exclusive CPU-window holds with main's approval for this probe.
  • Evidence README section with the probe design, the result each hypothesis gives, and the scope. Files table rows.
  • evidence/certified_head/README.md: the hopper-wgmma model's published form is now attributed to HMMA measurements, and this evidence is cited for the wgmma the stock kernels issue.
  • The paper text (Appendix proofs: "Khattak and Mikaitis model Hopper's BF16 wgmma ...") is not changed here; the wording goes to the paper agent.

Validation

  • pre-commit (ruff, ruff-format, mypy, codespell, shellcheck, host-identity guard) on every changed file, in the CPU windows that produced the evidence: passed. The last README edit was checked with codespell and the host-identity script.
  • scripts/check_host_identity.sh on the new evidence and both READMEs: no matches.
  • The probe ran four times. Every row the runs share gave the same result: Triton and M = 1 and 32 in the first run (uncommitted script) match row for row, and the f00f50e and f850e97 runs (11 and 14 row counts) gave the same summaries. The 02b921b run added the non-tie and epilogue rows; the committed file is the 5e3a1fc run, identical to it apart from the added version keys.

Codex review

  • run_all.sh:84, include the wgmma probe in the default run: added (362dc5d).
  • wgmma_precision.py:209, distinguish nearest-even before reporting truncation: non-tie dropped fractions, non-tie FP32-rounding sums and BF16-epilogue controls added (02b921b); evidence rerun (cabbab2). All results support truncation.
  • evidence/certified_head/README.md:36, limit the wgmma assertion to the inspected kernels: done (030355d).
  • analyze_all.sh:129, require both head reports: done (030355d).
  • Reviewer (optional): the conservative model "covers adders that keep at least FP32's 23 fraction bits (F = 25 here)" (a5517c5).
  • wgmma_precision.py:343, preserve the Triton version: a separate versions key (PyTorch, CUDA, Triton, Triton's ptxas, cuBLASLt, driver) plus the Triton kernel's PTX version and target (5e3a1fc); evidence regenerated with identical rows (f6a9e75).

tensor_instructions.py reads, from the head GEMM's Nsight Compute reports,
the tensor operations on the HGMMA and HMMA paths and the executed SASS, and
searches cuBLAS's libraries for the nvjet kernels with cuobjdump.

wgmma_precision.py probes how the tensor cores accumulate BF16 products into
FP32 with crafted inputs whose exact sums are known: the fractional bits kept
after alignment, the truncation direction of dropped bits, the block size,
whether the accumulator joins the aligned sum, and the rounding to FP32. It
runs through Triton's tl.dot (wgmma on sm_90, checked in the PTX and SASS)
and through the head's own torch.matmul at one row count per head kernel.
run_all.sh gains a wgmma step; analyze_all.sh runs tensor_instructions.py.
mypy could not type the result rows; they are now list[dict[str, Any]].
The cuBLAS check adds M = 40, 80 and 160, so it covers all 14 head kernels
named in evidence/certified_head/README.md.
head_tensor_instructions.json (tensor_instructions.py at f850e97): in the
head GEMM's ncu reports at M = 1 and 32, every BF16-to-FP32 tensor operation
is on the HGMMA path and the SASS has 64 and 48 HGMMA instructions and no
HMMA; cuobjdump finds no nvjet function in libcublasLt.so.13 or
libcublas.so.13.

wgmma_precision.json (wgmma_precision.py at f850e97, a few seconds of GPU in
a CPU-window hold, no timing): through Triton's wgmma and through the head's
own torch.matmul at one row count for each of the 14 head kernels, the BF16
accumulation keeps 25 fractional bits below the largest addend, truncates
dropped bits toward zero, adds blocks of 16 products together with the FP32
accumulator, and truncates the sum to FP32. That matches the paper's Hopper
model (k = 16, F = 25, truncation) on the probed inputs.

The evidence README describes the probe, the result each hypothesis would
give and the scope; evidence/certified_head/README.md now says the Hopper
model's published form was measured through HMMA and cites this evidence for
the wgmma the stock kernels issue.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T05:10:15.183398Z f6a9e75 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea234a197b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +83 to +84
wgmma) "${LOCK[@]}" python experiments/profiling/wgmma_precision.py \
--out evidence/profiles/wgmma_precision.json ;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include the WGMMA probe in the default run

When experiments/profiling/run_all.sh is invoked without step arguments—as advertised at the top of the script to reproduce every profile—main() replaces the arguments with a list that still ends at ncu. Consequently this newly added step is never run by the default reproducer, leaving evidence/profiles/wgmma_precision.json missing or stale unless the caller knows to request wgmma explicitly; add it to the default step list.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 362dc5d: the default step list now ends with wgmma.

Address Codex review on #186: without step arguments run_all.sh stopped at
ncu, so the default reproduction never ran the new wgmma step.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 362dc5deb0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +204 to +209
beyond = [r for r in rows if r['test'] == 'align_neg' and r['param'] > f_pos]
neg = sorted({r['result'] for r in beyond})
if neg == [0.0]:
neg_trunc = 'toward zero'
elif all(v == -(2.0**-f_pos) for v in neg):
neg_trunc = 'toward minus infinity'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Distinguish nearest-even before reporting truncation

When the alignment stage rounds dropped addends to nearest-even, these probes produce the same neg == [0.0]: at e = 26, 2^-e is exactly half of the retained 2^-25 quantum and rounds to zero, while every larger e is closer to zero. Thus this branch only rules out rounding toward minus infinity (and similar modes); it does not establish that aligned addends are truncated toward zero, despite that conclusion being used to claim the measured head matches the truncating Hopper model. Add a non-tie input such as 3 * 2^-27, or report the result as ambiguous.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 02b921b, with evidence regenerated in cabbab2. The probe adds dropped fractions of 0.25, 0.5, 0.625, 0.75 and 0.875 of the 2^-25 quantum, both signs. All vanish on Triton and on all 14 head kernels, so dropped bits are truncated toward zero; rounding to nearest would keep a quantum above 0.5. It also adds two non-tie FP32-rounding sums (0.75 step above a representable value), which rule out nearest with ties toward zero, and FP32-exact control rows showing the cuBLAS BF16 epilogue rounds to nearest even, which the cuBLAS rounding reading assumes. The README table lists each row and the result every hypothesis gives.

@SamMausberg
SamMausberg changed the base branch from profile/ncu-dflash to main October 2, 2026 04:05
Address Codex review on #186: powers of two cannot separate truncation of the
dropped bits from rounding to nearest, because 2^-26 is a tie at F = 25. The
probe adds dropped fractions of 0.25 to 0.875 of the last kept quantum (both
signs), two non-tie sums 0.75 of an FP32 step above a representable value for
the Triton rounding test, and a quarter-step BF16-tie case on the cuBLAS path,
so nearest with ties toward zero is told apart from truncation as well.

Reviewer pre-review: the cuBLAS rows read the accumulator's rounding through
the FP32-to-BF16 epilogue, which assumes that epilogue rounds to nearest
even. Four control rows whose FP32 sums are exact classify the epilogue, and
the accumulator's rounding is reported only when the epilogue is nearest-even.
wgmma_precision.json from 02b921b. The dropped fractions 0.25-0.875 of the
2^-25 quantum vanish for both signs, so dropped bits are truncated toward
zero, not rounded to nearest. The Triton sums 0.75 of an FP32 step above a
representable value truncate, which rules out round to nearest with ties
toward zero. On the cuBLAS path the FP32-exact control rows show the BF16
epilogue rounds to nearest even, and under that epilogue the quarter-step
rows show the sum is truncated to FP32. All 14 head kernels and Triton give
the same answers. The README's test table states each new row and the
result every hypothesis would give.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cabbab244c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread evidence/certified_head/README.md Outdated
Comment on lines +35 to +36
split-K allowance (1.19e-4). The stock head kernels issue the warpgroup `wgmma`
(SASS `HGMMA`) instead; on this GPU a probe with crafted inputs finds the same

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Limit the WGMMA assertion to the inspected kernels

Only the M=1 and M=32 kernels have instruction counters and captured SASS; evidence/profiles/README.md explicitly states that the other kernels' SASS could not be read and only their numerical behavior was measured. Because the HMMA implementation is described as exhibiting the same accumulation behavior, those behavioral results cannot establish that the other 12 kernels issue HGMMA, so narrow this statement to the two inspected kernels or collect instruction evidence for the remainder.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 030355d: the README now claims wgmma (HGMMA) only for the two kernels whose SASS and counters were inspected (M = 1 and 32), and says the other 12 head kernels were measured numerically, behave the same way on the probed inputs, and had their instruction left unread.

Comment thread experiments/profiling/analyze_all.sh Outdated
Comment on lines +126 to +129
if [ "${#head_ncu[@]}" -gt 0 ]; then
run tensor_instructions.py --ncu "${head_ncu[@]}" \
--search-libs "$libdir/libcublasLt.so.13" "$libdir/libcublas.so.13" \
--out "$EV/head_tensor_instructions.json" > /dev/null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require both head reports before regenerating evidence

In the inspected analyze_all.sh flow, an interrupted run_ncu.sh that leaves only one of head_gemm_m1.ncu-rep and head_gemm_m32.ncu-rep still makes this condition true. tensor_instructions.py accepts a single report, so the analysis exits successfully after overwriting head_tensor_instructions.json with incomplete evidence even though the README claims both row counts; validate the two exact inputs before regenerating the file.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 030355d: analyze_all.sh names both head reports explicitly and stops if only one exists. Both exist for the committed run. The step is skipped only when neither exists.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES at cabbab2

The probe and its evidence are sound. Two Codex comments on this head are valid and unanswered; the first narrows a claim.

Blocking

  1. Codex 4162917621, evidence/certified_head/README.md:36: "The stock head kernels issue the warpgroup wgmma (SASS HGMMA) instead" overstates what was measured. Instruction counters and SASS exist only for the M = 1 and M = 32 kernels (head_tensor_instructions.json). For the other twelve, evidence/profiles/README.md says the SASS could not be read. Their measured accumulation (k = 16, F = 25, truncation) cannot tell the instruction apart, because the published HMMA model has the same form. Fix: "The two head kernels whose instructions were read (M = 1 and 32) issue wgmma (SASS HGMMA), not mma; all 14 head kernels show the same accumulation (16-term blocks, 25 fractional bits, truncation) in the probe". The paper text that main routes to the paper agent should carry the same scope.
  2. Codex 4162917626, experiments/profiling/analyze_all.sh:129: the instruction step runs when only one of head_gemm_m1.ncu-rep and head_gemm_m32.ncu-rep exists, and then overwrites head_tensor_instructions.json with half the evidence. Require both reports, or have tensor_instructions.py refuse a missing one, and exit non-zero. Then reply on both threads.

Checked at cabbab2

  • Instruction evidence (M = 1 and 32): ncu counts every BF16-to-FP32 tensor operation on the HGMMA path and none on HMMA. The SASS has 64 and 48 HGMMA instructions, 2,488,320 executed each, and no HMMA. tensor_instructions.py is unchanged since f850e97, the commit the file records.
  • Probe design. Each crafted row isolates one property of the adder. The two new families close the earlier gaps:
    • the non-tie dropped fractions (0.25-0.875 of the 2^-25 quantum, both signs) separate truncation from rounding to nearest;
    • the non-tie FP32 sums separate the six rounding modes.
      The four epilogue_* controls have FP32-exact sums, so the BF16 epilogue alone decides them, and they give six distinct signatures. The cuBLAS rounding_to_fp32 is reported only when the epilogue is nearest-even.
  • Results (wgmma_precision.json, repo 02b921b, 449 KB). All 15 paths (Triton plus the 14 head kernels, whose names match evidence/certified_head/README.md) agree:
    • 25 fractional bits; dropped bits truncated toward zero (every align_round row is 0);
    • blocks of 16; the running accumulator joins the next block (block_before all 0); for Triton, the accumulator sits inside the aligned sum;
    • the sum truncated to FP32. For Triton this is read directly. For cuBLAS, the epilogue rows give (1 + 2^-6, 1, 1 + 2^-6, -(1 + 2^-6)), nearest-even, in all 14 kernels, and all four bf16tie rows land on 1 + 2^-7.
  • Scope. The README states it: crafted power-of-two operands, one GH200, this driver, CUDA and cuBLAS, not a vendor contract, with full-significand products, subnormals and K offsets beyond 128 untested. The earlier two Codex comments are fixed and answered.
  • Hygiene. Host identity is clean, and all 6 commits are Sam's.

Optional: evidence/profiles/README.md says the conservative model "needs FP32's 24 bits". It is sufficient for adders that keep at least 23 fractional bits per 8- to 32-term block, by Lemma A.1 with the adder unit of app_proofs.tex:53, which is the wording the writing lead is putting in the paper. "covers adders keeping at least 23 bits (F = 25 here)" would match.

…orts

Address Codex review on #186. evidence/certified_head/README.md claimed that
every head kernel issues wgmma, but only the M = 1 and 32 kernels' SASS and
counters were read; the other 12 were measured numerically only. It now says
so. analyze_all.sh regenerates head_tensor_instructions.json only when both
head ncu reports exist and stops if only one does.
@SamMausberg SamMausberg changed the title Profiles: the head GEMM issues HGMMA (wgmma), and its BF16 accumulation matches the Hopper model (k = 16, F = 25, truncation) Profiles: the inspected head kernels issue HGMMA (wgmma), and all 14 accumulate BF16 as the Hopper model says (k = 16, F = 25, truncation) Oct 2, 2026
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

Reviewer suggestion on #186: the conservative model covers multi-term adders
that keep at least FP32's 23 fraction bits; the measured F is 25.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a5517c5029

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

tri = summarize(rows)
tri['rounding_to_fp32'] = rounding_mode(rnd)
tri['round_acc_tie_odd_result_minus_1'] = rnd['round_acc_tie_odd'] - 1.0
result['triton'] = {'k': args.k, 'instructions': info, 'summary': tri, 'rows': rows}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the Triton version in the evidence output

On every probe run, this assignment replaces the triton.__version__ string stored in result at line 330, so the generated evidence never records which Triton compiler produced the inspected PTX/SASS (the committed JSON confirms that triton contains only the probe results). Because compiler lowering is central to this measurement, retain the version under a distinct key such as triton_version or include it in the nested Triton result.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5e3a1fc, with evidence regenerated in f6a9e75. A separate 'versions' key records PyTorch 2.13.0+cu130 (CUDA 13.0), Triton 3.7.1, Triton's ptxas (CUDA 12.8 build), cuBLASLt 130101 and its library, and driver 570.195.03. The Triton path also records its PTX version (8.7) and target (sm_90a). Every row and summary is identical to the previous run apart from these keys, checked in the CPU window. The README's scope paragraph names the versions.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES at a5517c5

Both items from my review at cabbab2 are fixed and answered:

  • The certified_head README claims wgmma (HGMMA) only for the two kernels whose SASS and counters were read (M = 1 and 32). For all 14 kernels it claims only the measured accumulation.
  • analyze_all.sh names both head reports and stops if only one exists.
  • The optional wording ("covers adders that keep at least FP32's 23 fraction bits") is in.

Blocking

  1. Codex 4162937315, new on this head and unanswered. wgmma_precision.py stores triton.__version__ under result['triton'] and then overwrites that key with the Triton path's results, so wgmma_precision.json records no Triton version. Its top-level triton is the results dict. The Triton row is one of the two measured paths, and the compiled wgmma depends on the Triton build, so the evidence should name it. Fix: store the version under its own key (e.g. triton_version). Then either regenerate the file, a few GPU-seconds in a CPU-window hold, or, if you would rather not rerun, add the version used by the committed run to the README with its source (the run's venv, e.g. pip show triton output kept with the hold log). Then reply on the thread.

Everything else from my cabbab2 review stands: the instruction evidence, the probe design, the results for all 15 paths, the epilogue gating and the scope statement.

Address Codex review on #186: result['triton'] held the Triton version and
was then overwritten by the Triton path's results, so the evidence named no
compiler for the inspected PTX and SASS. A 'versions' key now records
PyTorch, its CUDA, Triton, Triton's ptxas, the cuBLASLt version and library,
and the driver; the Triton path also records its PTX version and target.
wgmma_precision.json from 5e3a1fc. Every row and summary is identical to
the 02b921b run (checked in the CPU window); the file now records PyTorch
2.13.0+cu130, Triton 3.7.1 with its bundled ptxas from CUDA 12.8, cuBLASLt
130101, driver 570.195.03, and the Triton kernel's PTX 8.7 for sm_90a. The
README's scope paragraph names these versions.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: f6a9e75d68

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE at f6a9e75

a5517c5..f6a9e75 fixes Codex 4162937315, which has a reply.

  • wgmma_precision.json now records versions: torch 2.13.0+cu130 (CUDA 13.0), Triton 3.7.1 with its bundled ptxas (CUDA 12.8 build), cuBLASLt 130101 with its library path, and driver 570.195.03. The Triton instruction block adds ptx_version 8.7 and ptx_target sm_90a.
  • The diff of the regenerated file touches only these keys and repo_commit (5e3a1fc, which contains the probe change). Every test row and summary is unchanged from the 02b921b run.
  • The README scope paragraph names the versions.

Everything from my reviews at cabbab2 and a5517c5 stands:

  • Instruction: wgmma (HGMMA) only, read for the M = 1 and 32 kernels, and claimed for those two alone.
  • Accumulation, across all 15 paths: 25 fractional bits; dropped bits truncated toward zero; blocks of 16, with the running accumulator joining the next block; the sum truncated to FP32.
  • Epilogue: the controls show the cuBLAS BF16 epilogue rounds to nearest-even in all 14 kernels.
  • Robustness: analyze_all.sh requires both ncu reports.
  • Scope: crafted power-of-two inputs on one GH200 with the recorded toolchain, not a vendor contract.

Codex found no major issues on f6a9e75. Host identity is clean, and the commits are Sam's.

@SamMausberg
SamMausberg merged commit bf4b09b into main Oct 2, 2026
SamMausberg added a commit that referenced this pull request Oct 2, 2026
The wgmma evidence (#186, profile-wgmma) replaces the open-assumption
wording, within the probes' scope.

§2.2: Khattak and Mikaitis measured the warp-level mma path; the two stock
head kernels we inspected (at M = 1 and 32) issue the warpgroup wgmma
instead, and on crafted inputs all fourteen stock head kernels accumulate
as the Hopper model assumes (16-product blocks, 25 fractional bits,
truncation of the dropped bits and of the sum). It is a measurement on one
GPU, and neither model is a vendor contract; the 1/58 sentence stays.

Limitations: the probes find that accumulation, with more fractional bits
than the conservative model needs, but used products with one exact
operand and reached neither subnormals nor other GPUs, so neither model is
established for all inputs.

Appendix A: the Hopper-model item names the HMMA source of the published
model and gives the probe result with its full scope (operands, GH200,
driver 570.195.03, CUDA 13.0, PyTorch 2.13's cuBLAS; what was not probed);
Table A.1's row and Table 1's row 3 cite the probes. Notes: the divergence
figure's caption says the same in one clause. Both registers get an
identical profile-wgmma entry (files and producers as in
evidence/profiles/README.md).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant