A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 2, 01:00 UTC
[Refactor] Remove dead code fp quant (#44122)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Wentao Ye committed
Jun 3, 2026 at 14:22 UTC
2b9101265008f333ba69d58dabdd1da9ae653d7c
1 file changed
-21
vllm/model_executor/layers/quantization/fp_quant.py
-21
@@ -35,25 +35,19 @@ class FPQuantConfig(QuantizationConfig):
35
hadamard_group_size: int = 32,
36
forward_dtype: str = "mxfp4",
37
forward_method: str = "abs_max",
38
- pseudoquantization: bool = False,
38
modules_to_not_convert: list[str] | None = None,
39
) -> None:
40
super().__init__()
41
self.hadamard_group_size = hadamard_group_size
42
self.forward_dtype = forward_dtype
43
self.forward_method = forward_method
45
- self.pseudoquantization = pseudoquantization
44
self.modules_to_not_convert = modules_to_not_convert
45
48
- if pseudoquantization:
49
- raise ValueError("Pseudoquantization is not supported for vLLM")
50
-
46
def __repr__(self) -> str:
47
return (
48
f"FPQuantConfig(hadamard_group_size={self.hadamard_group_size}, "
49
f"forward_dtype={self.forward_dtype}, "
50
f"forward_method={self.forward_method}, "
56
- f"pseudoquantization={self.pseudoquantization}, "
51
f"modules_to_not_convert={self.modules_to_not_convert})"
52
)
53
@@ -78,13 +72,11 @@ class FPQuantConfig(QuantizationConfig):
72
hadamard_group_size = cls.get_from_keys(config, ["hadamard_group_size"])
73
forward_dtype = cls.get_from_keys(config, ["forward_dtype"])
74
forward_method = cls.get_from_keys(config, ["forward_method"])
81
- pseudoquantization = cls.get_from_keys(config, ["pseudoquantization"])
75
modules_to_not_convert = cls.get_from_keys(config, ["modules_to_not_convert"])
76
return cls(
77
hadamard_group_size,
78
forward_dtype,
79
forward_method,
87
- pseudoquantization,
80
modules_to_not_convert,
81
)
82
@@ -216,19 +208,6 @@ class FPQuantLinearMethod(LinearMethodBase):
208
)
209
layer.register_parameter("forward_hadamard_matrix", forward_hadamard_matrix)
210
219
- backward_hadamard_matrix = Parameter(
220
- torch.empty(
221
- self.quant_config.hadamard_group_size,
222
- self.quant_config.hadamard_group_size,
223
- dtype=params_dtype,
224
- ),
225
- requires_grad=False,
226
- )
227
- set_weight_attrs(
228
- backward_hadamard_matrix, {"ignore_warning": True} | extra_weight_attrs
229
- )
230
- layer.register_parameter("backward_hadamard_matrix", backward_hadamard_matrix)
231
-
211
def apply(
212
self,
213
layer: torch.nn.Module,