Skip to content

[CUDA] Refine fpA-intB GEMV support checks - #32338

Merged
Tianlei Wu (tianleiwu) merged 1 commit into
mainfrom
tlwu/refine_fpa_intb
Aug 31, 2026
Merged

Tianlei Wu (tianleiwu) merged 1 commit into
mainfrom
tlwu/refine_fpa_intb

Conversation

@tianleiwu

Copy link
Copy Markdown
Contributor

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

File Change
onnxruntime/contrib_ops/cuda/llm/fpA_intB_gemv/fpA_intB_gemv.h Update the support-query declaration to accept both device and kernel architectures.
onnxruntime/contrib_ops/cuda/llm/fpA_intB_gemv/fpA_intB_gemv.cu Apply compact/full build checks using separate device and kernel architecture inputs, including SM90-layout and BF16 constraints.
onnxruntime/contrib_ops/cuda/quantization/matmul_nbits.h Pass the physical device architecture and selected packing architecture to the support query.

Tests

File Change
onnxruntime/test/contrib_ops/cuda_kernels/fpA_intB_gemm_kernel_test.cc Add support-matrix coverage for combinations of device architecture, kernel/layout architecture, and kernel type.
onnxruntime/test/python/quantization/test_op_matmulnbits_prepacked_cuda.py Use compact-compatible block_size=32 in the configuration-key fixture so the test exercises fpA-intB instead of falling back.

Testing

  • CUDA internal tests passed: 123 tests, including FpAIntBGemvTest.SupportUsesDeviceAndKernelArchitectures.
  • Four Python configuration-key tests passed against a fresh native build.
  • Both modified translation units compiled successfully with compact mode disabled/full-mode settings.
  • git show --check passed with no whitespace errors.
  • lintrunner -a was 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

  • Tests added/updated
  • No breaking changes
  • Documentation updated (not applicable)

Copilot AI balanced review requested due to automatic review settings August 31, 2026 16:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@tianleiwu
Tianlei Wu (tianleiwu) merged commit 4422dd2 into main Aug 31, 2026
91 checks passed
@tianleiwu
Tianlei Wu (tianleiwu) deleted the tlwu/refine_fpa_intb branch August 31, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants