[Quantization][Refactor][1/N] Adopt QuantKey in QuarkConfig and methods, relying on weight_quant_key, act_quant_key for quant method dispatch (#52958)

Signed-off-by: Felix Marty <Felix.Marty@amd.com>
Co-authored-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
fxmarty-amd
2026-09-01 02:55:54 -05:00
committed by GitHub
co-authored by Andreas Karatzas
parent d0e695a91b
commit 63988f3c2d
13 changed files with 1574 additions and 476 deletions
+8 -4
View File
@@ -35,6 +35,10 @@ from vllm.model_executor.layers.quantization.utils.mxfp4_utils import (
mxfp4_quantize,
quant_dequant_mxfp4,
)
from vllm.model_executor.layers.quantization.utils.quant_utils import (
kMxfp4Dynamic,
kMxfp4Static,
)
from vllm.model_executor.model_loader.weight_utils import default_weight_loader
from vllm.model_executor.utils import replace_parameter
from vllm.platforms import PlatformEnum, current_platform
@@ -346,9 +350,9 @@ def test_online_mxfp4_moe_matches_quark(
online_layer = make_layer("online_layer")
checkpoint_method = QuarkOCP_MX_MoEMethod(
weight_config={"qscheme": "per_group", "dtype": "fp4"},
input_config={"dtype": "fp4", "is_dynamic": True},
moe=checkpoint_layer.moe_config,
weight_quant_key=kMxfp4Static,
activation_quant_key=kMxfp4Dynamic,
)
online_method = Mxfp4OnlineMoEMethod(layer=online_layer)
@@ -566,8 +570,8 @@ def test_online_mxfp4_dense_matches_quark(
checkpoint_weight, checkpoint_weight_scale = mxfp4_quantize(weight)
checkpoint_scheme = QuarkOCP_MX(
weight_quant_spec={"qscheme": "per_group", "dtype": "fp4"},
input_quant_spec={"dtype": "fp4", "is_dynamic": True},
weight_quant_key=kMxfp4Static,
activation_quant_key=kMxfp4Dynamic,
)
checkpoint_scheme.create_weights(
layer=checkpoint_layer,