[CUDA] Refine fpA-intB GEMV support checks - #32338
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refines CUDA fpA-intB GEMV eligibility by separating physical device architecture from kernel layout architecture.
Changes:
- Updates support checks and dispatch architecture handling.
- Adds compact/full support-matrix coverage.
- Adjusts Python tests to exercise compact-compatible kernels.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
fpA_intB_gemv.h |
Expands the support-query API. |
fpA_intB_gemv.cu |
Implements device/layout-aware eligibility checks. |
matmul_nbits.h |
Passes device and packing architectures. |
fpA_intB_gemm_kernel_test.cc |
Tests architecture and kernel combinations. |
test_op_matmulnbits_prepacked_cuda.py |
Uses compact-compatible block size. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Nenad Banfic (nenad1002)
approved these changes
Aug 31, 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
Refine fpA-intB GEMV support checks and test coverage for the compact kernel configuration introduced by PR #32324. The support query now evaluates the physical device architecture separately from the selected kernel/layout architecture, while compact mode remains limited to FP16 groupwise kernels using the non-SM90 layout.
Summary of Changes
GEMV support and dispatch
onnxruntime/contrib_ops/cuda/llm/fpA_intB_gemv/fpA_intB_gemv.honnxruntime/contrib_ops/cuda/llm/fpA_intB_gemv/fpA_intB_gemv.cuonnxruntime/contrib_ops/cuda/quantization/matmul_nbits.hTests
onnxruntime/test/contrib_ops/cuda_kernels/fpA_intB_gemm_kernel_test.cconnxruntime/test/python/quantization/test_op_matmulnbits_prepacked_cuda.pyblock_size=32in the configuration-key fixture so the test exercises fpA-intB instead of falling back.Testing
FpAIntBGemvTest.SupportUsesDeviceAndKernelArchitectures.git show --checkpassed with no whitespace errors.lintrunner -awas attempted; the Ruff, Ruff-format, and ClangFormat adapters failed without reporting violations in the changed files.Motivation and Context
A Hopper device can use either the SM80-compatible packing/layout or the native SM90 layout. Treating the selected layout architecture as the device architecture incorrectly rejected valid compatibility-layout dispatch, while ignoring the layout allowed compact mode to select unsupported kernels. Keeping these inputs separate makes the support matrix reflect both hardware capability and the compiled kernel path.
Checklist