Repository navigation
Triton int8 TMA fault: needs Triton >= 3.8.0 and ptxas >= 13.3 to go away (evidence/triton_tma) - #142
Conversation
int8_tma_check.py runs the certified head's raw-product kernel (TMA path) and a minimal kernel against an FP64 reference, for 64- and 128-byte int8 boxes, three sizes and random or real head data, each case twice. run_versions.sh runs it under Triton 3.7.1, 3.8.0 and main with their own and swapped ptxas, and summarize.py reduces the cases to per-tile counts.
Main passes with ptxas 13.4 and fails with 12.9, so the 3.8.0 runs separate a ptxas fix from a Triton one.
… ptxas >= 13.3 to go away Run evidence-20261001T160757Z at deb77cf. The certified head's raw-product kernel gives wrong products with 64-byte int8 boxes at 65,536 and 248,320 rows on Triton 3.7.1 (with ptxas 12.8 or 13.4), 3.8.0 with ptxas 12.9, and main with ptxas 12.9; it is correct on 3.8.0 with ptxas 13.3 or 13.4 and on main with 13.4. The minimal kernel is never wrong.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 068109010b
ℹ️ 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".
| The run, under the shared GPU lock, from the repository root: | ||
|
|
||
| ```sh | ||
| scripts/gpu_lock.sh -s experiments/triton_tma/run_versions.sh ~/vp-data/upstream/triton/runs/evidence-20261001T160757Z |
There was a problem hiding this comment.
Source the required environment before the GPU run
The documented reproduction command starts a GPU workload without first sourcing scripts/sglang_env.sh. Although run_versions.sh reconstructs part of the CUDA environment, it does not apply the complete pinned PATH and SGLang setup, so this is not a supported invocation on the Lambda host and may select different tooling as the machine environment changes. Prefix the command with source scripts/sglang_env.sh.
AGENTS.md reference: AGENTS.md:L9-L10
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
| env TRITON_CACHE_DIR="$out/cache-$name" "${override/#-/TRITON_PTXAS_UNSET=1}" \ | ||
| timeout --foreground 900 "$py" "$repo/experiments/triton_tma/int8_tma_check.py" --real \ |
There was a problem hiding this comment.
Clear inherited ptxas overrides for bundled runs
When the caller already has TRITON_PTXAS_PATH or TRITON_PTXAS_BLACKWELL_PATH set, env inherits it; assigning the unrelated TRITON_PTXAS_UNSET variable for - does not unset either override. In that scenario the supposedly bundled t371, t380, or tmain cases silently use the caller's compiler, invalidating the build comparison. Explicitly unset both override variables before applying the per-run override.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 4b54d73: every run now starts from env -u TRITON_PTXAS_PATH -u TRITON_PTXAS_BLACKWELL_PATH, and only that run's own override is added, so a caller's setting cannot reach the bundled runs.
| timeout --foreground 900 "$py" "$repo/experiments/triton_tma/int8_tma_check.py" --real \ | ||
| --out "$out/$name.jsonl" >"$out/$name.log" 2>&1 & | ||
| pids+=($!) |
There was a problem hiding this comment.
Keep the shared GPU job within its memory budget
The README runs this under gpu_lock.sh -s, whose shared-job contract limits non-server jobs to 20 GB, but this loop backgrounds all seven experiments simultaneously. At the largest case, each process holds the roughly 0.64 GB int8 head, two roughly 0.51 GB FP64 reference arrays, and several result/comparison buffers, so the combined peak exceeds that shared allocation before CUDA-context and allocator overhead. Run the variants sequentially or require the exclusive lock so concurrently admitted jobs are not starved or OOM-killed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 4b54d73: the seven builds now run one at a time (each process peaks at about 3.5 GB), which keeps the job within the shared budget. The committed evidence comes from the sequential run (evidence-20261001T171930Z); the README describes the earlier concurrent run as superseded.
| with args.out.open('a') as f: | ||
| f.write(json.dumps({'env': environment()}) + '\n') |
There was a problem hiding this comment.
Replace prior output instead of appending another run
When int8_tma_check.py is invoked directly as documented and the output path already exists—for example after an interrupted run—append mode leaves the previous header and cases in place. A subsequent summarize.py call then treats the second {"env": ...} header as a case and raises KeyError: 'kernel' (or duplicated cases distort consumers that do not reject it). Open a fresh file in write mode or fail explicitly if the path exists.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 4b54d73: int8_tma_check.py now opens --out in write mode, so an existing file is replaced, and the docstring says so.
|
Verdict: REQUEST CHANGES (0681090, 4 blocking: Codex's four comments; the evidence itself checks out) Review of 946f24c, deb77cf and 0681090. Evidence: every claim checks out.
Blocking: Codex's four comments on 0681090 are valid.
If the README states what the committed run did, the evidence can stay; a rerun after the script fixes is not required. The fixes need pre-commit; I could not run it here because an exclusive hold is running, and I will run it on the fix head. Suggestions (not blocking)
|
Address Codex on #142: run_versions.sh sources scripts/sglang_env.sh, clears TRITON_PTXAS_PATH and TRITON_PTXAS_BLACKWELL_PATH before each run's own override, and runs the seven builds sequentially to stay within the shared-job memory budget; int8_tma_check.py replaces an existing --out instead of appending.
|
@codex review |
|
Verdict: APPROVE (provisional, on 08113d8: Codex has not yet reviewed this head, and pre-commit is queued in the CPU window. I will confirm or withdraw once both finish.) 4b54d73 and 08113d8 resolve all four Codex comments from 0681090.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08113d8175
ℹ️ 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".
| twice on the same inputs. One JSON line per case, after a header line with the environment; an existing output file is | ||
| replaced. | ||
|
|
||
| scripts/gpu_lock.sh -s python experiments/triton_tma/int8_tma_check.py --out cases.jsonl |
There was a problem hiding this comment.
Source the CUDA environment in the direct invocation
Although run_versions.sh now sources the required environment, this separate documented command still launches python through gpu_lock.sh using the caller's environment; the lock wrapper only serializes the job and does not configure CUDA. From a fresh shell on the prescribed Lambda host, this can omit the CUDA 13 compatibility libraries or select a different Python/Triton installation, causing the reproducer to fail or test the wrong toolchain. Source scripts/sglang_env.sh as part of this invocation.
AGENTS.md reference: AGENTS.md:L7-L10
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 0bc2339: the documented direct run is now scripts/gpu_lock.sh -s bash -c 'source scripts/sglang_env.sh && python experiments/triton_tma/int8_tma_check.py --out cases.jsonl', and the docstring points to run_versions.sh for the build comparison. Only the docstring changed; the committed evidence comes from run_versions.sh, which already sourced the environment.
|
Verdict: REQUEST CHANGES (08113d8; withdraws my provisional approval; 1 blocking, a one-line docstring fix) Codex r4159453606 (P1) is valid. The docstring of Write it as |
|
@codex review |
|
Verdict: APPROVE (provisional, on 0bc2339: Codex has not yet reviewed this head. I will confirm or withdraw once it does.) 0bc2339 fixes my one item (Codex r4159453606). The docstring's direct run now sources |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Verdict: APPROVE (confirmed on 0bc2339) This confirms my provisional approval. Codex found no issues on this head (19:25 UTC). |
…vidence # Conflicts: # experiments/README.md
evidence/certified_head (tma_repro.json and its README section) merged with #45, so the README points to it instead of describing the runs.
|
Verdict: APPROVE (provisional, on 8e90e62: Codex has not reviewed this head yet.)
I will confirm once Codex reviews 8e90e62. |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Verdict: APPROVE (confirmed on 8e90e62) This confirms my provisional approval. Codex found no issues on this head. |
#142 (evidence/triton_tma) tested the certified head's int8 TMA kernel on seven Triton and ptxas builds: the four without both Triton >= 3.8.0 and ptxas >= 13.3 gave wrong products, the three with both did not, a version pattern that matches the closed issue triton-lang/triton#9433 (the README's attribution rests on that pattern alone). Section 4.5 now says so with a new register entry, triton-tma, added after kernel-tma with the appendix editor's agreement; the issue is named in text, not cited, so references.bib is unchanged. To keep the page budget, Section 4.5 drops a parenthetical on how compaction keeps whole tiles.
…atches - gumbel_sample ran its two guards after a refused batch too. With no candidates, the small-probability guard compared -inf with a stale ymax and could add its bit to rows already marked refused (x9e's GPU tests caught it: status 576 instead of 64 in test_quantization_data_must_belong_to_the_weight). The guards check a decision, so they now run only after one; a refused batch keeps the single status refused. A CPU test with stale buffers fails without the fix. Outputs never changed (refused rows take the stock chain), and no committed evidence or paper number counts the extra bit: every certified-head evidence file was produced at or before 9f7f369, before the guards (09bf64e, ec46d55, 2c36737), and no other workstream's committed evidence ran the certified head. - Codex on 00f305f: in check mode, the fixed-noise comparison with SGLang's seeded sampler adds its mismatches after attach_ids has written the counters, so a mismatch on the last sampled replay was never recorded. Patch 0008 (engine/kernel a28946e0d4) writes them again after the comparison. - Main now carries #142: the evidence README cites evidence/triton_tma for the first TMA fault (clean only with Triton >= 3.8.0 and ptxas >= 13.3 together, matching triton-lang/triton#9433 by version pattern; the 64-byte refusal stays on Triton 3.7.1).
Adds
evidence/triton_tma/andexperiments/triton_tma/: which Triton builds give wrong products when an int8 tile loaded through a 64-byte TMA box is converted to BF16 fortl.dot. This is the certified head's 64-byte-box fault, and the question was whether it lies in Triton's generated code or inptxas, and which builds fix it. Correctness only; nothing is timed.Result (
evidence/triton_tma/README.md, runevidence-20261001T171930Zat 4b54d73). The certified head's raw-product kernel (TMA path) gives wrong products, NaN and Inf among them, in builds that lack either Triton 3.8.0 or newer orptxas13.3 or newer:ptxas-blackwell)Every wrong case uses
BLOCK_K = 64(a 64-byte int8 box) at 65,536 or 248,320 int8 rows, with random and with real head data. None fails at 8,192 rows or withBLOCK_K = 128. The two identical runs of a wrong case almost always differ in their counts (72 of 72 on 3.7.1). The pattern matches triton-lang/triton#9433, which is closed: a register-operandwgmmahazard whose fix has a Triton half (#9514 and #9530, in 3.8.0) and aptxashalf (CUDA 13.3). I did not inspect the SASS, so that attribution rests on the version pattern. The fix is already upstream, so no Triton issue was filed.Consequence for the certified head. On Triton 3.7.1, the SGLang venv's version, refusing 64-byte int8 boxes stays necessary. On Triton 3.8.0,
TRITON_PTXAS_PATHset to the wheel's ownptxas-blackwellgave correct results in every case here.How it was produced.
scripts/gpu_lock.sh -s experiments/triton_tma/run_versions.sh <dir>. The script runs the seven builds one at a time. An earlier concurrent run at deb77cf gave the same pattern and is described in the README as superseded.cases/<build>.jsonlheader records the Triton version, theptxasit used for sm_90, the override variables, the GPU and driver, andrepo_commit/repo_dirty.Not covered. The certified head's second fault (envelope misses with a 128-byte box) is not tested. Nor is why the minimal kernel never fails.
Files: about 350 KB in total.
int8_tma_summary.json(55 KB) is the per-tile summary;cases/*.jsonl(about 42 KB each) hold every case.Codex review of 0681090. All four comments were right. 4b54d73 fixes them, and the evidence was regenerated with the fixed script (08113d8):
run_versions.shnow sourcesscripts/sglang_env.sh.TRITON_PTXAS_PATHandTRITON_PTXAS_BLACKWELL_PATHbefore applying each run's own override.int8_tma_check.pyreplaces an existing--outinstead of appending to it.