[compressed-tensors] Asymmetric support for MoE WNA16 marlin (#44025)

Signed-off-by: Brian Dellabetta <bdellabe@redhat.com>
This commit is contained in:
Brian Dellabetta
2026-06-02 08:51:45 -07:00
committed by GitHub
parent 53fa09d085
commit 774e552397
5 changed files with 126 additions and 12 deletions
@@ -45,6 +45,8 @@ from vllm.model_executor.layers.quantization.utils.quant_utils import (
kFp8StaticTensorSym,
kInt4Static,
kInt4Static32,
kInt4Static32Asym,
kInt4StaticAsym,
kInt8Static,
kMxfp4Static,
kMxfp8Static,
@@ -611,6 +613,8 @@ class MarlinExpertsBase(mk.FusedMoEExpertsModular):
kInt4Static,
kInt8Static,
kInt4Static32,
kInt4StaticAsym,
kInt4Static32Asym,
]
return weight_key in SUPPORTED_W
@@ -32,6 +32,7 @@ from vllm.model_executor.layers.quantization.utils.marlin_utils import (
marlin_moe_permute_scales,
marlin_permute_bias,
moe_awq_to_marlin_zero_points,
moe_packed_to_marlin_zero_points,
)
from vllm.model_executor.layers.quantization.utils.quant_utils import (
QuantKey,
@@ -496,6 +497,23 @@ def _process_weights_marlin(
marlin_w2_scales
)
# --- Permute zero points ---
if w13_qzeros is not None and w2_qzeros is not None:
w13_qzeros = moe_packed_to_marlin_zero_points(
w13_qzeros,
size_k=w13_qzeros.shape[1],
size_n=w13_qzeros.shape[2] * pack_factor,
num_bits=num_bits,
is_a_8bit=is_a_8bit,
)
w2_qzeros = moe_packed_to_marlin_zero_points(
w2_qzeros,
size_k=w2_qzeros.shape[1],
size_n=w2_qzeros.shape[2] * pack_factor,
num_bits=num_bits,
is_a_8bit=is_a_8bit,
)
# --- Permute bias ---
if w13_bias is not None:
w13_bias_out = marlin_permute_bias(w13_bias)