[CUDA] Guard FP8 XQA test by compute capability - #32559
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The capability check must target the same CUDA device used by the test.
Pull request overview
Guards FP8 XQA tests to run only on GPUs with SM89+ capability, preventing failures on SM86 while retaining UINT8/INT8 coverage.
Changes:
- Added capability detection and simulated SM86/SM89/SM90 tests.
- Conditionally includes FP8 test cases.
File summaries
| File | Summary |
|---|---|
onnxruntime/test/python/transformers/test_paged_attention_int4.py |
Adds the capability guard; the device queried should match the CUDA device used by run_case. |
Review details
Suppressed comments (1)
onnxruntime/test/python/transformers/test_paged_attention_int4.py:31
- This reads PyTorch's current device, but
run_casebinds every ORT tensor/session to CUDA device 0 (lines 302-324). If another test leaves a different device current, the guard can skip FP8 coverage on device 0 or run it on an SM<89 device; query the same device that the test executes on.
major, minor = torch.cuda.get_device_capability()
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Hariharan Seshadri (hariharans29)
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Windows CUDA CI runner for PR #32515 uses an SM86 A10-4Q.
PagedAttentionintentionally enables FP8 XQA only on SM89 or SM90+, so the FP8 cases intest_xqa_large_attention_scale_and_k_scalefell back to portable kernels and failed the XQA dispatch assertion.Mirror the runtime capability predicate in the test and include the FP8 variant only on supported GPUs. UINT8 and INT8 remain covered on SM80 and newer devices. This is a capability guard, not a memory guard: the failed job completed pytest normally and reported two assertion failures rather than a CUDA allocation failure or process crash.
Failed job: https://github.com/microsoft/onnxruntime/actions/runs/34435175610/job/102757939916?pr=32515
Motivation and Context
Fixes the Windows GPU CUDA CI regression introduced by #32515 without skipping valid XQA coverage on SM86.
Testing
TestPagedAttentionInt4Helpers: 4 tests passed, including simulated SM86, SM89, and SM90 capability cases.lintrunner onnxruntime/test/python/transformers/test_paged_attention_int4.pypython -m py_compile onnxruntime/test/python/transformers/test_paged_attention_int4.pygit diff --check