Repository navigation
Fix CUDA GatherBlockQuantized block indexing - #32665
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
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.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Tianlei Wu (tianleiwu)
left a comment
There was a problem hiding this comment.
Re-reviewed the per-row scale indexing, the independently padded packed-zero-point indexing, and the CUDA-specific test setup. The earlier packing and CPU-fallback concerns are addressed; no additional actionable findings.
An independent host arithmetic check matches all 72 values in the odd-block regression and verifies padded byte indices for 2/4/8-bit packing. git diff --check passes. These are not CUDA runtime tests, and this head currently has no reported CI checks, so please obtain current-head CUDA validation before merging. No approval submitted.
Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
The row-aware packed zero-point indexing correctly subtracts the second row's zero point instead of reading the previous row's padding nibble. Update the stale 4-bit expected output and restore the no-zero-point regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…antized CUDA tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6186209 to
42e540b
Compare
Incorporate the diagnosed SentencePiece pin and valid owned CUDA stream fixes. Preserve the passing axis-zero and odd-zero-point-block Gather regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Akshay Sonawane (apsonawane)
left a comment
There was a problem hiding this comment.
AI-assisted source review at d43a594486cdec442fc4f9a739ca5a6fd299b018.
Traced packed input expansion, gather offsets, dense scale indexing, and separately row-padded packed zero points against the schema and CPU implementation. Also checked CUDA-only test selection and disabled CPU fallback. The prior packed-zero-point and fallback concerns are resolved at this head.
No new actionable findings in this pass. Independent host-side indexing probes covered supported 2/4/8-bit examples and reproduced the new odd-block expected values. Reported head checks are 100 successful and one neutral. No CUDA compilation, GPU execution, or local ORT suite was performed.
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.