[ROCm][Kimi-K3] Add opt-in gfx942 MXFP4-to-int4 conversion (#51274)
Signed-off-by: Markus Hartikainen <markus.hartikainen@amd.com> Signed-off-by: Hartikainen <mahartik@amd.com>
This commit is contained in:
@@ -23,6 +23,7 @@ from vllm.model_executor.layers.quantization.utils.quant_utils import (
|
||||
kFp8DynamicTokenSym,
|
||||
kFp8Static128BlockSym,
|
||||
kFp8StaticTensorSym,
|
||||
kInt4Static32,
|
||||
kInt8StaticChannelSym,
|
||||
kMxfp8Dynamic,
|
||||
)
|
||||
@@ -46,6 +47,12 @@ def test_quant_spec_string_representation_uses_quantization_name():
|
||||
assert str(quant_spec(weight="mxfp4")) == "mxfp4"
|
||||
|
||||
|
||||
def test_quant_spec_resolves_groupwise_int4_weight():
|
||||
spec = QuantSpec(weight="int4_per_group_32")
|
||||
assert spec.weight == kInt4Static32
|
||||
assert spec.activation is None
|
||||
|
||||
|
||||
def test_quant_spec_rejects_unknown_name():
|
||||
with pytest.raises(ValueError, match="unknown quantization name"):
|
||||
quant_spec(weight="not_a_real_format")
|
||||
|
||||
Reference in New Issue
Block a user