Skip to content

[GPU] Skip activation dynamic quantization for 4-bit FC on discrete GPU#36907

Closed
allnes wants to merge 2 commits into
openvinotoolkit:masterfrom
allnes:gpu-dq-skip-dgpu-int4
Closed

[GPU] Skip activation dynamic quantization for 4-bit FC on discrete GPU#36907
allnes wants to merge 2 commits into
openvinotoolkit:masterfrom
allnes:gpu-dq-skip-dgpu-int4

Conversation

@allnes

@allnes allnes commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Problem

#36078 narrowed the runtime skip of DynamicQuantize in front of FullyConnected. On discrete GPU the FC runs through oneDNN, which now consumes the i8 activation from DynamicQuantize on every token instead of the previous f16 path. This caused a decode throughput regression on discrete GPUs (e.g. ~+57% 2nd-token latency on Arc A770 for 4-bit LLMs), while integrated GPU was unaffected.

4-bit weight FC is memory-bound by the int4 weights. Quantizing the activation to i8 does not reduce that dominant weight traffic, so on the discrete-GPU oneDNN path it only adds a per-token quantize dispatch and an i8 GEMM that is slower than f16 at LLM shapes — for both decode and prefill.

Details

Skip inserting the activation DynamicQuantize for FullyConnected when:

  • the device is a discrete GPU, and
  • the weights are 4-bit (i4/u4).

The oneDNN FC then takes the f16 path for every batch size, so it stays batch-consistent (this is not a batch-size threshold switch). Integrated GPU is untouched — its bf_tiled kernel reproduces the dynamic quantization internally, as kept by #36078 — and 8-bit weights keep the existing path where i8 activations can pay off.

@allnes allnes requested review from a team as code owners July 15, 2026 19:17
@github-actions github-actions Bot added the category: GPU OpenVINO GPU plugin label Jul 15, 2026
For 4-bit weight FullyConnected the GEMM/GEMV is memory-bound by the int4
weights, so quantizing the activation to i8 does not cut the dominant weight
traffic. On the discrete-GPU oneDNN path it only adds a per-token quantize
dispatch and an i8 GEMM that is slower than f16 at LLM shapes.

Skip inserting the activation DynamicQuantize for FullyConnected when the
device is a discrete GPU and the weights are 4-bit (i4/u4). The oneDNN FC then
runs the f16 path for every batch size. Integrated GPU (bf_tiled internal DQ)
and 8-bit weights are left unchanged.
@allnes allnes force-pushed the gpu-dq-skip-dgpu-int4 branch from ad92d99 to b98cae3 Compare July 15, 2026 19:21
GPU_DEBUG_TRACE << root->get_friendly_name()
<< " dyn_quan is turned off: discrete GPU + 4-bit weights"
" (f16 FC is faster and batch-consistent)" << std::endl;
return true;

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.

we should use dynamic quantization for int4 weights because it shows performance gain.

@allnes allnes closed this Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants