Skip to content

vllm.model_executor.layers.quantization.w4afp8

w4afp8 checkpoints: INT4 group-128 routed experts with FP8 activations, FP8 block-128 everywhere else.

Routed experts are remapped at load time onto the compressed-tensors W4A8 FP8 MoE method; dense layers already use the native FP8 serialization.

Classes:

W4AFP8Config

Bases: Fp8Config

Methods:

get_checkpoint_weight_mapper()

Rename routed-expert tensors to the compressed-tensors layout and drop their static input scales (the W4A8 kernels quantize per token).

_repack_signed_int4_to_uint4b8(weights)

Signed INT4 packed 2 per int8 -> uint4b8 packed 8 per int32.

XOR with 0x88 adds 8 (mod 16) to both nibbles of each byte.