Skip to content

[CUDA][CI] Bump CUDA 13.0 docker images from 13.0.2 to 13.0.3 to match cuBLAS 13.1.1.3 used by CD - #196869

Closed
nWEIdia wants to merge 2 commits into
pytorch:mainfrom
nWEIdia:fix-cuda-13.0.3-cublas-mismatch
Closed

nWEIdia wants to merge 2 commits into
pytorch:mainfrom
nWEIdia:fix-cuda-13.0.3-cublas-mismatch

Conversation

@nWEIdia

@nWEIdia nWEIdia commented Sep 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

CI docker images for CUDA 13.0 (.ci/docker/build.sh, install_cuda.sh) are still pinned to CUDA
toolkit 13.0.2, but the CD binary build matrix
(generate_binary_build_matrix.py)
already builds cu130 wheels against cuBLAS 13.1.1.3, which ships with CUDA toolkit 13.0.3, not
13.0.2. This CI/CD toolkit skew means CI tests run the CD-built wheel's cuBLAS 13.1.1.3 against an
older 13.0.2 driver/runtime stack than what it was built/validated for.

This is the root cause of the illegal-memory-access failures in
TestGroupedMMCUDA.test_grouped_mm_u64_indexing_cuda_float16 on the periodic CUDA 13.0 B200 smoke lane
(e.g. https://github.com/pytorch/pytorch/actions/runs/34476417747/job/102891503623), which only started
showing up after 3c71eadba6ffd0d19c4524e723afd4cba966517a added coverage exercising this path, and which
#196775 worked around by skipping the test rather than fixing the underlying version mismatch.

Test plan

  • CI docker images rebuild successfully with CUDA 13.0.3.
  • TestGroupedMMCUDA.test_grouped_mm_u64_indexing_cuda_float16 passes on the periodic CUDA 13.0
    B200 smoke lane without the skip from [CUDA] Skip grouped_mm u64 indexing on SM100 CUDA 13.0 #196775.
  • FA3 wheel build workflow (_binary-build-flash-attention-wheel-linux.yml) succeeds for both
    x86_64 and aarch64 cu130 legs with the new installer.

Debugged by @nWEIdia manually but 🤖 Generated with Claude Code
p.s. the timing is a bit awkward that we are sunsetting cuda 13.0 CI, so... I think it is a good fyi anyways.
cc @ptrblck @eqy @fbxai @tinglvv @malfet @atalman @slayton58

nWEIdia and others added 2 commits September 11, 2026 23:11
CD build matrix (generate_binary_build_matrix.py) already builds CUDA 13.0
wheels against cuBLAS 13.1.1.3, which ships with CUDA toolkit 13.0.3 --
but CI docker images (.ci/docker/build.sh, install_cuda.sh) were still
pinned to CUDA 13.0.2. This toolkit/cuBLAS mismatch is the root cause of
the illegal-memory-access failures in TestGroupedMMCUDA.test_grouped_mm_u64_indexing_cuda_float16
on the periodic CUDA 13.0 B200 smoke lane (surfaced by 3c71ead, which
added coverage for that path), which PR pytorch#196775 worked around by skipping
the test instead of fixing the underlying version skew.

- .ci/docker/build.sh, .ci/docker/common/install_cuda.sh,
  .ci/docker/common/install_inductor_benchmark_deps.sh: CUDA_VERSION
  13.0.2 -> 13.0.3, installer runfile/driver bumped to
  cuda_13.0.3_580.126.20_linux (verified installer exists at
  https://developer.download.nvidia.com/compute/cuda/13.0.3/local_installers/).
- .github/workflows/_binary-build-flash-attention-wheel-linux.yml: same
  bump for the FA3 wheel build matrix (x86_64 + aarch64 legs).
- RELEASE.md: supported-architectures table version bump.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@nWEIdia
nWEIdia requested review from a team, lezcano and nikitaved as code owners September 12, 2026 06:12
@pytorch-bot

pytorch-bot Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/196869

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 95a17d4 with merge base d1ae7ee (image):

CRCR (non-blocking) - The following CRCR downstream CI job failed but is non-blocking:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@slayton58

Copy link
Copy Markdown
Contributor

...against cuBLAS 13.1.1.3, which ships with CUDA toolkit 13.0.3, not
13.0.2. This CI/CD toolkit skew means CI tests run the CD-built wheel's cuBLAS 13.1.1.3 against an
older 13.0.2 driver/runtime stack than what it was built/validated for.

This is the root cause of the illegal-memory-access failures in
TestGroupedMMCUDA.test_grouped_mm_u64_indexing_cuda_float16

Well that explains why I couldn't repro on my local node... Glad to have an actual root cause here, not just the somewhat-informed guess I could come up with.

Is there an explanation as to why this specific test case fails so hard while almost all others run fine?

@nWEIdia

nWEIdia commented Sep 12, 2026 •

Copy link
Copy Markdown
Collaborator Author

Is there an explanation as to why this specific test case fails so hard while almost all others run fine?

Yes, libcublasLt.so.13 version was the root-cause as it contains a bug that was fixed by a later libcublasLt.so.13.
From nightly cu13 wheel, after installation, do "pip install cuda-toolkit[cublas]==13.0.2" would install libcublasLt.so.13 versioned 13.1.0.3 and the IMA would reproduce on B200 or GB200. Then "pip install cuda-toolkit[cublas]==13.0.3" would pull libcublasLt.so.13.1.1.3 and the IMA would be gone.
Consulting the cublas release notes from 13.1.1.3, below stands out:

"
Large Leading Dimension Faults: Resolved a problem where cublasLtMatmul() returned incorrect data or caused invalid memory access errors when handling massive matrix leading dimensions (specifically when the product of the data type size and leading dimension breached the signed 32-bit integer limits). This occurred on Compute Capability 9.0, 10.x, and 11.0 hardware. [1] (https://docs.nvidia.com/cuda/cublas-patch-release-notes/#cublas-patch-release-13-1-1)
"

Comment thread .ci/docker/build.sh
pytorch-linux-jammy-cuda13.0-cudnn9-py3.10-linter)
PYTHON_VERSION=3.10
CUDA_VERSION=13.0.2
CUDA_VERSION=13.0.3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We don't need to update CUDA pypi wheel

@Skylion007

Copy link
Copy Markdown
Collaborator

Ah nvm, yeah we should have a static lint check on here at some point to detect these regressions.

@Skylion007

Copy link
Copy Markdown
Collaborator

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 12, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

webern added a commit to webern/deslag that referenced this pull request Sep 27, 2026
## Summary

deslag's corpus is Markdown quoted from public repositories. Each file,
a fixture, is labeled `human`, `llm` or `mixed` from its git history:
which commits touched it, when, and whether an AI agent made them. The
lints are measured against those labels, so a wrong label is a wrong
measurement.

The rule behind the labels was too loose. It looked for tool names
anywhere in a commit, so a mention, a suggestion a person accepted, or a
squash of many commits could make a file `llm` or `mixed`. This PR
replaces it with a table of the marks each agent writes itself, matched
only where the agent writes them. A GitHub squash-merge proves its marks
only when GitHub shows that every commit of its pull request carries
one. Then it rechecks every fixture of the big tier against the new
rule, from full-depth clones: 384 of the 1200 no longer hold (204 `llm`,
180 `mixed`, no `human`).

The 384 exclusions ship with the next harvest, in one batch with the
fixtures that replace them, and the tree drops and refills in that same
change. Dropping them now would take `llm` to 196 fixtures and `mixed`
to 220, under the 350 per label that `tests/corpus.rs` requires. So this
PR publishes nothing: no new image, and no change to `blobs.lock`,
`tests/corpus/` or the golden files.

What ships:

- The new rule, in `scripts/llm-detection/collect.py` (`MARKS`,
`label_history`) and `docs/design/corpus.md` section 3, with the table
of marks and a real commit for each.
- `PullRequests` in `collect.py`, which asks GitHub what a
squash-merge's pull request held.
- `collect.py recheck`, which clones each repository the big tier
quotes, derives every live label again, and writes the ones that fail to
`exclude.jsonl` in its work directory.
- `collect.py pack --exclude`, which writes those exclusions into a new
batch.
- A test that a batch may hold exclusions alone, and
`docs/design/corpus.asbuilt.md` brought up to date.

### What was wrong

The old rule searched the author, the committer and the whole message
for tool names. So:

- A mention counted. [lima-vm/lima
a4ab936](lima-vm/lima@a4ab936)
is a person's commit whose message links to `google-gemini/gemini-cli`.
The file it added was labeled `llm`, written by "gemini". In
[reisxd/TizenTubeCobalt
8a45a90](reisxd/TizenTubeCobalt@8a45a90)
a person writes "Fix the build error manually or by Gemini-CLI", and
that made the file `mixed`.
- A suggestion counted. [stellar/rs-stellar-xdr
e0d289a](stellar/rs-stellar-xdr@e0d289a)
squashes a person's pull request of 77 commits and 553 files. One of its
`Co-authored-by:` lines is Copilot Autofix, a fix a person accepted in
review. Its file was labeled `llm`.
- A squash counted. A squash carries the marks of all its commits but
cannot say which of them wrote a given file.
- A squash-merge hid its commits. GitHub ends a squash-merge's subject
in "(#N)", and its message may look like a single commit's.
[Kometa-Team/Kometa
94d7c16](Kometa-Team/Kometa@94d7c16)
carries the Copilot agent's mark, and its file was labeled `llm`, but
pull request #3497 held five commits, and a person's commit in it
touched the file. In [nrwl/nx
8cec6ce](nrwl/nx@8cec6ce),
pull request #31380 held two commits, and neither carries an agent's
mark.
- A shallow clone hid when a file began. The harvest cloned with
`--shallow-since=2018-01-01`, so an older file seemed to begin at that
boundary. 69 of the 400 `mixed` sidecars say the file was "begun by a
person, unmarked" on a day in January 2018, and 47 `human` sidecars
record a first commit then. For `llm`, a cut history could hide a
person's older commits.
- "Before 2022" went by the author date alone, though a commit can be
authored long before it is committed.

### The new rule

- `human`: every commit that touched the file is a person's from before
2022-01-01, by both its author date and its committer date, and none
carries any mark.
- `llm`: every commit is an agent's, and the file's text is no older
than that history.
- `mixed`: at least one commit is a person's from before 2022-01-01 with
no mark, and at least one is an agent's.
- A commit by a bot rules out every label.

A commit is an agent's when it carries a mark that counts and is not a
squash. A mark is a regular expression matched in one place: `identity`
(the author, the committer, or the value of a `Co-authored-by:`
trailer), `trailer` (another line of the trailer block that ends the
message), or `footer` (a line a tool writes into that block, such as
"Generated with Claude Code" after a robot emoji). Its kind is
`agent-identity` or `agent-session`, which count, or `assist`, which
never does. An assist is a tool's suggestion that a person committed.

In short, the 32 marks are:

| Tool | Counts | Assist, never counts |
|---|---|---|
| claude-code | `[email protected]`, `claude[bot]`, the
`Claude-Session:` trailer, the session link and "Generated with Claude
Code" footers | |
| copilot | the coding agent's and the CLI's accounts, the
`Copilot-Session:` and `Agent-Logs-Url:` trailers, the Copilot Workspace
footer | a review's suggestion, Copilot Autofix, VS Code's
`[email protected]` co-author |
| cursor | `[email protected]`, the `Made-with: Cursor` trailer,
the "Made with Cursor" footer | |
| codex | `Codex <[email protected]>`, `[email protected]`, the `codex`
account | |
| jules, devin, kiro, openhands | each tool's own account or address | |
| aider | `Name (aider)`, `[email protected]` | |
| amp | `[email protected]`, the `Amp-Thread-ID:` trailer | |
| opencode | `[email protected]`, the "Generated with OpenCode" footer
| |
| gemini | | `gemini-code-assist[bot]`, a review's suggestion |
| any | | the `Assisted-by:` trailer |

The full table, with the exact patterns and an example commit for each,
is in `docs/design/corpus.md` section 3.

Three shapes make a commit a squash: two or more paragraphs that open
with `* `, as GitHub lists squashed commits; the header `git merge
--squash` writes; or a last line of nine dashes followed only by
trailers, which is how GitHub gathers the squashed commits' co-authors.

A marked commit whose subject ends in "(#N)" is taken for a GitHub
squash-merge. It proves its marks only when every commit of the pull
request merged as it carries a mark that counts. `collect.py` asks
GitHub with `gh api`, one request at a time and at most two a second,
and keeps the answers in its work directory. When GitHub cannot show the
pull request, because none was merged as the commit or GitHub refuses,
the commit proves nothing, and a label that needs it fails with its own
reason, `unverified`.

`llm` also needs the text to be the agents'. When the commit that added
the file deleted a Markdown file of the same name, or one that git's
rename detection pairs with it, or when a merge added the file, the text
may be older than its history, so the file gets no label. A history that
ends at a shallow boundary says so in its basis and rules out `llm`. The
cutoff stays at 2022-01-01, as #5 set it.

### What the recheck found

`collect.py recheck` made full-depth blobless clones of all 1072
repositories the big tier quotes and derived each of the 1200 labels
again. No repository was gone. The clones took about five minutes with
12 jobs, and the questions to GitHub about 13 minutes.

| | human | llm | mixed |
|---|---|---|---|
| holds | 400 | 196 | 220 |
| a commit that is a squash | | 153 | 126 |
| a squash-merge with a commit that carries no agent's mark | | 25 | 28
|
| a squash-merge GitHub could not show (`unverified`) | | 4 | 3 |
| a commit marked only by an assist | | 6 | 17 |
| a commit that is not an agent's, made after 2022 | | 12 | |
| the text moved from another file | | 3 | |
| no agent's commit at all | | | 5 |
| a bot's commit | | 1 | 1 |
| excluded | 0 | 204 | 180 |

Each fixture is counted once, under one reason. The mention cases above
land in "a commit that is not an agent's" and "no agent's commit at
all".

The squash-merge rule adds 61 of the 384 exclusions: 26 `llm` and 35
`mixed`. 4 of those `mixed` are counted under "a squash", since they
also hold one. 3 `llm` fixtures that the first pass excluded because
their text moved now fail on a squash-merge first.

292 marked squash-merges were asked about. 185 were proven, 119 of them
pull requests of one commit. 88 had a commit with no agent's mark. For
18, GitHub shows no pull request merged as the commit: [pytorch/pytorch
#196869](pytorch/pytorch#196869) and
[facebook/metro #1632](react/metro#1632), for
example, were closed, not merged, and their commits landed another way.
1 request was refused: `DataDog/datadog-agent` requires SAML access that
the token used did not have. The 7 `unverified` fixtures come from
those.

Of the squashes, the first pass found 112 `llm` and 96 `mixed` that list
the squashed commits and 41 and 25 with only the nine-dashes shape. A
pull request of one commit gives that shape too, so I looked up the pull
request of each of those 66: none had one commit, and in 36 of them a
person's commit in the pull request touched the file.

### The floors the exclusions would break

With the 384 fixtures dropped from a local copy of the tree, three tests
of `tests/corpus.rs` fail:

- `every_category_is_well_stocked`: `llm` would hold 196 and `mixed`
220, fewer than `MIN_PER_CATEGORY`, 350.
- `the_default_groups_flag_llm_text_far_more_than_human_text`:
`banned_chars` would flag 57 `human` fixtures and 133 `llm`, and the
test needs `llm` to be at least 4 times `human`, 228. As a rate it still
holds: 68% of `llm` fixtures against 14% of `human`.
- `the_corpus_layouts_read_from_the_text_alone`: 6 layouts, where it
needs 10.

The floors stay as they are. The next harvest has to bring at least 154
`llm` and 130 `mixed` fixtures that hold under these rules, and, for the
layout test, files with real layouts. The tree was restored after the
dry run.

### How far the labels that hold can be trusted

Before the squash-merge rule, I took a stratified sample of 123 fixtures
that held under an earlier draft of these rules (seed 20260927), and
checked each by hand against its commits and pull requests on GitHub:

- `human`: 30 of 30 right.
- `llm`: 56 sampled, 2 wrong, 5 could not be checked.
- `mixed`: 37 sampled, 3 wrong, 1 could not be checked.

Every wrong label in the sample rested on a GitHub squash-merge, and all
five are now excluded. No fixture that rests on direct commits was
wrong: 0 of 32 `llm` checked and 0 of 15 `mixed`.

I also checked every squash-merge a label rested on against a looser
test: did a commit of the pull request that is not an agent's touch the
file? That found 16 `llm` and 17 `mixed` labels wrong, and all 33 are
excluded now. The rule in this PR is stricter, since it does not ask
which files a commit touched. It also excludes 5 `llm` and 15 `mixed`
fixtures that the looser test found right.

### Deviations and doubts

- A merge commit inside a pull request, such as a person merging the
base branch in, carries no mark, so it makes the squash-merge fail. 13
squash-merges fail only on such commits. They decide at most 2 `llm` and
3 `mixed` fixtures.
- The one `unverified` fixture from `DataDog/datadog-agent` fails only
because the token used lacks SAML access to that organization. A run
with such access would ask again.
- `harvest` does not ask GitHub yet. With the rule as it is, it leaves
out any file whose label rests on a squash-merge, which costs the next
harvest fixtures unless it asks.
- A `Co-authored-by:` value is matched as an identity, like the author
and committer, not as a trailer.
- The nine-dashes shape counts as a squash with or without blank lines
around the dashes.
- git's `(cherry picked from commit ...)` line is read as a footer, so
it does not hide the trailers above it.
- `[email protected]` is typed as an assist. It comes from VS Code's
`git.addAICoAuthor` setting, which I read as a sign of help, not of an
agent's commit.
- The `codex` account (267193182) is a User account, not a Bot. It is
listed because its profile names it "OpenAI's coding agent", with
company OpenAI and a link to openai.com/codex.
- Some tools have no mark listed, because I could not confirm one the
tool writes itself: Windsurf (`[email protected]` was seen as a
co-author), Antigravity (`[email protected]`), a
`[email protected]` co-author, and Pi. Leaving a mark out can only cost
fixtures. It never makes a label wrong, since an unlisted mark makes the
commit a person's commit after the cutoff.
- Copilot's completions were in a technical preview from mid 2021,
before the cutoff, and leave no mark. The cutoff stays where #5 put it.
- Sidecars are never rewritten once published, so the v1 sidecars that
hold keep their old basis, including those that say a file began in
January 2018 only because of a shallow clone.
- A copy of older text into a new file is not caught.

### Left for later

- The next harvest: new `llm` and `mixed` fixtures under these rules,
then one batch with them and the 384 exclusions, the tree dropped and
refilled, and the golden files regenerated, in one change.
- `harvest` asking GitHub about squash-merges, as `recheck` does.
- New sidecars for v1 fixtures whose basis is wrong about when the file
began.

## Testing

- [x] `make ci`: exit 0
- [x] Each of the 32 marks' example commits fetched from GitHub. Each
carries its mark in the listed place and is not a squash, and a script
checked that `corpus.md`'s table matches `MARKS` row for row.
- [x] `collect.py recheck` over all 1200 fixtures of v1 at full depth,
then again with the squash-merge rule. A run on the kept evidence and
answers takes about 5 seconds and writes the same `exclude.jsonl`.
- [x] The squash-merge lookup checked by hand on known cases: two proven
pull requests, Kometa #3497 and nx #31380 failing, and the refused
DataDog request.
- [x] A dry run dropping the 384 fixtures from the tree: the three
corpus tests failed as listed, and the tree was restored.
- [x] The precision checks above, against GitHub pull requests.

## References

- Related: #5 (closed), which set the 2022-01-01 cutoff that this keeps.
- Related: #33, which will measure on these labels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants