[Refactor] Remove dead code for quantization (#52221)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2026-08-16 13:10:16 -04:00
committed by GitHub
parent 6914d60b1e
commit 7d7b6f26f4
14 changed files with 1 additions and 395 deletions
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import math
from collections.abc import Callable
from typing import TYPE_CHECKING, Any
@@ -61,11 +60,6 @@ if TYPE_CHECKING:
)
def prepare_padded_shape(shape, x):
padded_shape = math.ceil(shape / x) * x
return padded_shape, padded_shape - shape
def prepare_param(tensor, name, extra_attrs):
extra_attrs = extra_attrs.copy()
scale_type = extra_attrs.pop("scale_type", None)
@@ -129,22 +123,6 @@ def prepare_moe_param(tensor: torch.Tensor, name: str, extra_attrs: dict[str, An
return param
def may_pad_loaded_weight(param, loaded_weight):
pad_shape = getattr(param, "pad_shape", None)
if pad_shape is None:
return loaded_weight
value = 1 if loaded_weight.dtype == torch.float8_e8m0fnu else 0
padding = []
for x in pad_shape[::-1][: loaded_weight.ndim]:
padding += [0, x]
loaded_weight = torch.nn.functional.pad(
input=loaded_weight,
pad=padding,
value=value,
)
return loaded_weight
def compressed_tensors_get_config(config: dict[str, Any], key: str):
assert key in ["weights", "input_activations"]
target_group_config = None