vllm.model_executor.layers.quantization.inc.schemes.inc_w4a8_linear ¶
Classes:
-
INCXPUW4A8LinearMethod–XPU linear method for INC int4 weights with dynamic int8 activations.
INCXPUW4A8LinearMethod ¶
Bases: INCXPULinearMethod
XPU linear method for INC int4 weights with dynamic int8 activations.
Uses the same GPTQ-packed "NT" qweight layout as INCXPULinearMethod — int4_gemm_w4a8 and int4_gemm_w4a16 accept bit-identical weights, so no extra repacking is needed. Activations are dynamically quantized per-token to symmetric int8, which keeps the GEMM on the int8 datapath instead of upconverting the weights to the activation dtype. That is a win for compute-bound shapes (large token counts, e.g. diffusion), where w4a16 is dominated by dequantization rather than by weight bandwidth.
Both scale tensors must be float16: the kernel reads them as fp16 regardless of the activation dtype, so bf16 scales are silently misinterpreted. The activations themselves may be bf16 or fp16.
Opt in with VLLM_XPU_INC_WNA16_BACKEND=w4a8. Whether this beats ARK is device-dependent, so it is not the default: it was measured faster on B70 (Xe2), where ARK cannot use its XMX int8 path and falls back to fp16.
Source code in vllm/model_executor/layers/quantization/inc/schemes/inc_w4a8_linear.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |