A high-throughput and memory-efficient inference and serving engine for LLMs
[Refactor] Remove dead quantization code and tests (#45454)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Wentao Ye committed
Jun 17, 2026 at 16:12 UTC
2659f60a1a240243baf17e32fce2318f99ac3d49
5 files changed
-120
tests/kernels/quantization/test_awq.py
-20
@@ -27,23 +27,3 @@ def test_awq_dequantize_opcheck(monkeypatch: pytest.MonkeyPatch):
27
torch.ops._C.awq_dequantize,
28
(qweight, scales, zeros, split_k_iters, thx, thy),
29
)
30
-
31
-
32
-@pytest.mark.skip(reason="Not working; needs investigation.")
33
-@pytest.mark.skipif(
34
- not hasattr(torch.ops._C, "awq_gemm"),
35
- reason="AWQ is not supported on this GPU type.",
36
-)
37
-def test_awq_gemm_opcheck(monkeypatch: pytest.MonkeyPatch):
38
- with monkeypatch.context() as m:
39
- m.setenv("VLLM_USE_TRITON_AWQ", "0")
40
- input = torch.rand((2, 8192), device="cuda", dtype=torch.float16)
41
- qweight = torch.randint(
42
- -2000000000, 2000000000, (8192, 256), device="cuda", dtype=torch.int32
43
- )
44
- scales = torch.empty((64, 2048), device="cuda", dtype=torch.float16)
45
- qzeros = torch.randint(
46
- -2000000000, 2000000000, (64, 256), device="cuda", dtype=torch.int32
47
- )
48
- split_k_iters = 8
49
- opcheck(torch.ops._C.awq_gemm, (input, qweight, scales, qzeros, split_k_iters))
tests/quantization/fp_quant.py
deleted
-32
@@ -1,32 +0,0 @@
1
-# SPDX-License-Identifier: Apache-2.0
2
-# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
-"""Test model set-up and inference for quantized HF models supported
4
-on the GPU backend using FPQuant.
5
-
6
-Validating the configuration and printing results for manual checking.
7
-
8
-Run `pytest tests/quantization/test_fp_quant.py`.
9
-"""
10
-
11
-import pytest
12
-
13
-from tests.quantization.utils import is_quant_method_supported
14
-
15
-MODELS = [
16
- "ISTA-DASLab/Qwen3-0.6B-RTN-NVFP4",
17
- "ISTA-DASLab/Qwen3-0.6B-RTN-MXFP4",
18
-]
19
-DTYPE = ["bfloat16"]
20
-EAGER = [True, False]
21
-
22
-
23
-@pytest.mark.skipif(
24
- not is_quant_method_supported("fp_quant"),
25
- reason="FPQuant is not supported on this GPU type.",
26
-)
27
-@pytest.mark.parametrize("model", MODELS)
28
-@pytest.mark.parametrize("eager", EAGER)
29
-def test_fpquant(vllm_runner, model, eager):
30
- with vllm_runner(model, enforce_eager=eager) as llm:
31
- output = llm.generate_greedy(["1 2 3 4 5"], max_tokens=2)
32
- assert output[0][1] == "1 2 3 4 5 6"
tests/quantization/test_fp8.py
-64
@@ -67,70 +67,6 @@ def test_model_load_and_run(
67
print(outputs[0][1])
68
69
70
-KV_CACHE_MODELS = [
71
- # AutoFP8 format using separate .k_scale and .v_scale
72
- # The original checkpoint below was removed from the Hub. To unblock CI and
73
- # until a small replacement with split K/V scales is found, skip this case.
74
- # See PR #27717 for context.
75
- pytest.param(
76
- "nm-testing/Qwen2-1.5B-Instruct-FP8-K-V",
77
- marks=pytest.mark.skip(
78
- reason=(
79
- "Checkpoint removed from HF; temporarily disabling this "
80
- "AutoFP8 split K/V case (PR #27717)."
81
- )
82
- ),
83
- ),
84
-]
85
-
86
-
87
-@pytest.mark.skipif(
88
- not is_quant_method_supported("fp8"),
89
- reason="FP8 is not supported on this GPU type.",
90
-)
91
-@pytest.mark.parametrize("model_id", KV_CACHE_MODELS)
92
-@pytest.mark.parametrize(
93
- "use_rocm_aiter", [True, False] if current_platform.is_rocm() else [False]
94
-)
95
-def test_kv_cache_model_load_and_run(
96
- vllm_runner, model_id: str, use_rocm_aiter: bool, monkeypatch
97
-):
98
- if use_rocm_aiter:
99
- monkeypatch.setenv("VLLM_ROCM_USE_AITER", "1")
100
-
101
- # `LLM.apply_model` requires pickling a function.
102
- monkeypatch.setenv("VLLM_ALLOW_INSECURE_SERIALIZATION", "1")
103
- with vllm_runner(model_id, kv_cache_dtype="fp8", enforce_eager=True) as llm:
104
-
105
- def check_model(model):
106
- attn = model.model.layers[0].self_attn.attn
107
-
108
- assert isinstance(attn.quant_method, Fp8KVCacheMethod)
109
-
110
- if not current_platform.is_rocm():
111
- # NOTE: This code path requires validation on Non-CUDA platform
112
- # NOTE: it is valid for scales to be 1.0 (default value), but
113
- # we know these checkpoints have scales < 1.0
114
- assert 0.0 < attn._k_scale < 1.0
115
- assert 0.0 < attn._v_scale < 1.0
116
- else:
117
- # NOTE: This code path is for ROCm platform
118
- # NOTE: it is valid for scales to be 1.0 (default value), but
119
- # we know these checkpoints have scales < 1.0
120
- # However on ROCm platform, the _k_scale and _v_scale will be
121
- # scaled by a factor of 2 as described in
122
- # vllm/model_executor/layers/quantization/kv_cache.py
123
- assert 0.0 < attn._k_scale < (1.0 * 2.0)
124
- assert 0.0 < attn._v_scale < (1.0 * 2.0)
125
-
126
- llm.apply_model(check_model)
127
-
128
- # note: this does not test accuracy, just that we can run through
129
- # see lm-eval tests for accuracy
130
- outputs = llm.generate_greedy(["Hello my name is"], max_tokens=4)
131
- print(outputs[0][1])
132
-
133
-
70
@pytest.mark.skipif(
71
not is_quant_method_supported("fp8"),
72
reason="FP8 is not supported on this GPU type.",
vllm/model_executor/layers/quantization/__init__.py
-1
@@ -156,7 +156,6 @@ def get_quantization_config(quantization: str) -> type[QuantizationConfig]:
156
"quark": QuarkConfig,
157
"moe_wna16": MoeWNA16Config,
158
"torchao": TorchAOConfig,
159
- "auto-round": INCConfig,
159
"inc": INCConfig,
160
"mxfp4": Mxfp4Config,
161
"gpt_oss_mxfp4": GptOssMxfp4Config,
vllm/model_executor/layers/quantization/fp8.py
-3
@@ -486,9 +486,6 @@ class Fp8LinearMethod(LinearMethodBase):
486
weight_bf16 = weight_fp8 * weight_scale
487
return torch.nn.functional.linear(x, weight_bf16.t(), bias)
488
489
- if self.use_marlin:
490
- return self.fp8_linear.apply_weights(layer, x, bias)
491
-
489
return self.fp8_linear.apply_weights(layer, x, bias)
490
491