Fix CUDA GatherBlockQuantized block indexing - #32665
Open
Tianlei Wu (tianleiwu) with Copilot wants to merge 3 commits into
Open
Tianlei Wu (tianleiwu) with Copilot wants to merge 3 commits into
Tianlei Wu (tianleiwu) with Copilot wants to merge 3 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix GatherBlockQuantized CUDA kernel block ID calculation
Fix CUDA GatherBlockQuantized block indexing
Sep 17, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Packed zero-point indexing remains incorrect for rows with a non-pack-aligned block count, and the CUDA test can silently run on CPU.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Fixes CUDA block indexing for non-aligned quantized-axis rows and adds regression coverage.
Changes:
- Computes scale block IDs per quantized-axis row.
- Passes the unpacked quantized-axis dimension to the CUDA kernel.
- Adds a 4-bit CUDA regression test.
File summaries
| File | Description |
|---|---|
gather_block_quantized.cc |
Supplies the logical quantized-axis dimension. |
gather_block_quantized.cu |
Corrects row-aware block indexing. |
gather_block_quantized.cuh |
Updates CUDA kernel parameters. |
gather_block_quantized_op_test.cc |
Adds non-aligned-axis coverage. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Xavier Dupré (xadupre)
previously approved these changes
Sep 17, 2026
Tianlei Wu (tianleiwu)
marked this pull request as ready for review
September 17, 2026 17:17
Tianlei Wu (tianleiwu)
enabled auto-merge (squash)
September 17, 2026 17:18
Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
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
Motivation and Context
CUDA previously derived the scale and zero-point block from the flat data index. Non-block-aligned quantized axes therefore crossed row boundaries and silently produced incorrect results.