Skip to content

Add 2-bit quantization support to WebGPU GatherBlockQuantized operator - #29054

Merged
guschmue merged 1 commit into
microsoft:mainfrom
Shivani767:webgpu-gather-2bit-support
Jun 15, 2026
Merged

Add 2-bit quantization support to WebGPU GatherBlockQuantized operator#29054
guschmue merged 1 commit into
microsoft:mainfrom
Shivani767:webgpu-gather-2bit-support

Conversation

@Shivani767

Copy link
Copy Markdown
Contributor

Adds complete 2‑bit quantization support to the WebGPU GatherBlockQuantized operator. The implementation includes:

  1. Sign‑extension logic for 2‑bit signed quantized values
  2. Sign‑extension logic for 2‑bit signed zero points
  3. Maintains full backward compatibility with existing 4‑bit and 8‑bit support

Motivation and Context

This change addresses GitHub issue #28895: "Add 2‑bit quantization support to the WebGPU GatherBlockQuantized operator". The existing codebase had partial 2‑bit support but was missing sign‑extension, which is critical for correct dequantization of signed 2‑bit values (range [-2, 1]).

@guschmue guschmue added the ep:WebGPU ort-web webgpu provider label Jun 15, 2026
@guschmue
guschmue merged commit 5c3c2b7 into microsoft:main Jun 15, 2026
85 checks passed
@Shivani767

Copy link
Copy Markdown
Contributor Author

Thank you for the review and merge.

This contribution adds complete 2-bit quantization support to the WebGPU GatherBlockQuantized operator by implementing proper sign-extension for signed 2-bit values and zero points, ensuring correct dequantization behavior while maintaining compatibility with existing 4-bit and 8-bit paths.

Appreciate the feedback and support from the ONNX Runtime maintainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ep:WebGPU ort-web webgpu provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants