Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1723,6 +1723,22 @@ void TransformationsPipeline::apply(std::shared_ptr<ov::Model> func) {
return true;
}
}

// 4-bit FC is memory-bound by the int4 weights, so on the discrete-GPU oneDNN
// path an i8 activation adds a per-token quantize + i8 GEMM without any win over
// f16. Keep f16 (all batches) for discrete GPU + 4-bit weights; iGPU/8-bit keep DQ.
{
const auto& dev_info = m_context->get_engine().get_device_info();
const bool is_wei_4bit = cldnn::one_of(root->get_input_element_type(1),
{ov::element::i4, ov::element::u4});
if (dev_info.dev_type == cldnn::device_type::discrete_gpu && is_wei_4bit) {
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.

}
}

uint64_t adj_group_size = dynamic_quantization_group_size;
const bool is_wei_i8u8 = cldnn::one_of(root->get_input_element_type(1), {ov::element::i8, ov::element::u8});
if (ov::intel_gpu::DynamicQuantizeFullyConnected::ShouldUseGs128(is_wei_i8u8, use_gs128_for_int8_per_token, adj_group_size, use_gs128_for_linear_attention)) {
Expand Down
Loading