From 924a8ef58f919b8144933e5a7a945f0c66a84d85 Mon Sep 17 00:00:00 2001 From: Ryan Riley Date: Fri, 25 Sep 2026 16:41:19 -0500 Subject: [PATCH] vulkan: extend PTQ1_0 fast integer-dot path to INTEL_XE1 iGPUs (Arrow Lake-H) PR #238 gated the PTQ1_0 fast integer-dot shader on INTEL_XE2 classification (minSubgroupSize == 16). Intel Arc 140T (Arrow Lake-H, Xe-LPG+) reports minSubgroupSize == 8 and classifies as INTEL_XE1 instead, so it falls through to the blanket Intel-Windows opt-out and stays on the slow dequant path, even though the shader only needs integerDotProduct4x8BitPackedSignedAccelerated, which INTEL_XE1 classification already guarantees. Extends the existing check to also allow PTQ1_0 through under INTEL_XE1 when integer_dot_product is set. Measured on Intel Arc 140T (Arrow Lake-H, driver 101.8860), Ternary-Bonsai-2-27B-PTQ1_0: 1.3 -> 8.8 tok/s. Co-Authored-By: Claude Sonnet 5 --- ggml/src/ggml-vulkan/ggml-vulkan.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ggml/src/ggml-vulkan/ggml-vulkan.cpp b/ggml/src/ggml-vulkan/ggml-vulkan.cpp index f4fa37d2cc92..183f592b25e5 100644 --- a/ggml/src/ggml-vulkan/ggml-vulkan.cpp +++ b/ggml/src/ggml-vulkan/ggml-vulkan.cpp @@ -9573,12 +9573,17 @@ static bool ggml_vk_should_use_mmvq(const vk_device& device, uint32_t m, uint32_ return true; } case VK_VENDOR_ID_INTEL: - if (device->architecture == vk_device_architecture::INTEL_XE2) { + if (device->architecture == vk_device_architecture::INTEL_XE2 || + (device->architecture == vk_device_architecture::INTEL_XE1 && device->integer_dot_product && src0_type == GGML_TYPE_PTQ1_0)) { // PTQ1_0 is listed here because it has a dedicated integer-dot mat-vec shader // (mul_mat_vecq_ptq1_0.comp); without it the blanket Intel-Windows opt-out below // keeps PTQ1_0 on the dequant path. Measured on Arc B390 (Bonsai 2 27B, tg128): // 1.62 -> 13.16 t/s. PQ2_0 is deliberately NOT listed - measured 11.56 -> 11.63 t/s, // i.e. no gain over its dequant mat-vec, so it stays on the existing path. + // INTEL_XE1-classified iGPUs (e.g. Intel Arc 140T, Arrow Lake-H, Xe-LPG+) also + // qualify for PTQ1_0 when integer_dot_product is set, since that classification + // already guarantees the accelerated 4x8 integer dot product the shader needs. + // Measured on Arc 140T (Bonsai 2 27B, tg): 1.3 -> 8.8 t/s. if (src0_type == GGML_TYPE_Q2_0 || src0_type == GGML_TYPE_Q2_K || src0_type == GGML_TYPE_Q3_K || src0_type == GGML_TYPE_Q6_K || src0_type == GGML_TYPE_PTQ1_0) { return true;