Skip to content

fix(intrinsics): validate authored PTX floors against hardware introductions - #1261

Merged
nihalpasham merged 4 commits into
NVIDIA:mainfrom
almightychang:arch-introduction-ptx
Sep 23, 2026
Merged

nihalpasham merged 4 commits into
NVIDIA:mainfrom
almightychang:arch-introduction-ptx

Conversation

@almightychang

@almightychang almightychang commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

What this fixes

Counted bar.sync and bar.arrive claimed PTX 1.0 despite requiring PTX 2.0 and sm_20. Correct those authored records and regenerate their outputs.

before: matching overlay/recipe values could share an impossible floor
 after: authored floor must also meet its hardware's PTX introduction

The new table belongs to cuda-target-spec and remains separate from LLVM's backend-default table. Native hardware floors take precedence over project support floors for packed operations. Backend-profile evidence floors retain their existing meaning.

The instruction-specific authored floor remains necessary: newer instructions can require a newer PTX version on an already-existing GPU.

Verification

  • All 326 generator/target tests passed, including the CLI mutation rejecting PTX 1.0 on sm_80 and the full-catalog control.
  • ABI history preserves all 1,025 existing entries. Regenerated the book catalog stamp after CI identified stale derived documentation. Strict Clippy, formatting and warning-free docs passed.
  • Official PTX release history confirms the historical hardware-introduction rows. This change does not claim a GPU performance or code-generation improvement for existing supported targets.
  • All seven hosted workflows passed at 85e0d080. Per the issue's agreed sequencing, land after fix(codegen): reject invalid device architecture hints on both backends #1256.

Addresses #1213.

@almightychang
almightychang marked this pull request as ready for review September 13, 2026 03:18
`RECORDED_PTX_FLOORS` holds the LLVM 23 default `.version` per target and
its doc marks those as backend defaults rather than CUDA facts. The lower
bound a floor must clear is a different fact: the PTX ISA version in which
a target spelling first became nameable. Keep it in its own table so the
two cannot be confused at the use site.

Entries from sm_75 onward were measured with CUDA 13.2 ptxas by assembling
an empty kernel at successive `.version` spellings. Earlier entries are
pinned from the PTX ISA release notes.

Nothing consumes this yet; it is the input a lower-bound check on catalog
floors would need (NVIDIA#1213).

Signed-off-by: Sam, Joochul Chang <[email protected]>
…ions

Matching overlay and recipe floors can agree on an impossible ISA claim.
Require each top-level hardware floor's introduction PTX to be no newer
than the authored minimum_ptx. Preserve instruction-specific floors for
LLVM predicates, evidence validation and codegen fallback, and leave
backend-profile route floors out of this comparison.

Keep only the 13 introduction rows consumed today: sm_70/75/80/86/89/90/100
and historical sm_11/20/30/53/60/61. The older rows remain hardware facts
for instructions emitted on newer GPUs; packed ALU and packed atomic
native floors require sm_53 and sm_60. Unused targets and suffixes do not
belong in this check's table, which stays separate from LLVM defaults.

Counted bar.sync and bar.arrive had no minimum_sm for the new check to
inspect. Correct their authored floors to PTX 2.0 / sm_20 per the ISA;
retain barrier.* requirements and backend evidence, and regenerate.

The CLI regression asserts that PTX 1.0 on sm_80 fails check with the new
diagnostic; the full-catalog control passes with native and route floors
preserved. Target-spec and generator tests, ABI history, and the existing
LLVM per-target comparison probes pass in the Nix shell.

Signed-off-by: Sam, Joochul Chang <[email protected]>
The introduction check now rejects the old SM mutations before their
recipe validators run. Merely changing the expected diagnostics hides
coverage of the stricter recipe requirements.

Use SM mutations that remain nameable at the unchanged authored PTX
version. Assert the introduction check succeeds, then require the original
recipe diagnostic, so the two validation layers stay independently covered.
The CLI regression still rejects PTX 1.0 on sm_80 and accepts the full
catalog control.

Signed-off-by: Sam, Joochul Chang <[email protected]>
@nihalpasham nihalpasham added bug Something isn't working codegen Device code-generation pipeline (Rust MIR to IR to PTX) Depends Blocked on another PR/issue or an upstream dependency intrinsics Device intrinsics and libdevice math mappings tests Adds or improves test coverage labels Sep 23, 2026

@nihalpasham nihalpasham left a comment •

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.

I checked the authored floors separately from LLVM defaults and backend-profile evidence. The counted-barrier correction and the native packed-operation floors now agree with that distinction.

All 326 generator/target tests, ABI-history checks, strict Clippy and docs pass on the current-main rebase. All seven hosted workflows passed at 85e0d080; this should follow #1256 as agreed in the issue.

This addresses #1213.

@nihalpasham
nihalpasham merged commit 931a05a into NVIDIA:main Sep 23, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working codegen Device code-generation pipeline (Rust MIR to IR to PTX) Depends Blocked on another PR/issue or an upstream dependency intrinsics Device intrinsics and libdevice math mappings tests Adds or improves test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants