Fix circular import in quantization modules (#17372)

This commit is contained in:
Sam Shleifer
2026-01-21 15:47:09 +08:00
committed by GitHub
parent 0a7a2017a0
commit 0d49b13fdd
5 changed files with 10 additions and 6 deletions
+2 -1
View File
@@ -31,7 +31,6 @@ from sglang.srt.layers.parameter import (
RowvLLMParameter,
_ColumnvLLMParameter,
)
from sglang.srt.layers.quantization.unquant import UnquantizedLinearMethod
from sglang.srt.layers.utils import pad_or_narrow_weight
from sglang.srt.utils import get_bool_env_var, is_cpu, is_hip, is_npu, set_weight_attrs
@@ -165,6 +164,8 @@ class LinearBase(torch.nn.Module):
self.params_dtype = params_dtype
self.quant_config = quant_config
if quant_config is None:
from sglang.srt.layers.quantization.unquant import UnquantizedLinearMethod
self.quant_method: Optional[QuantizeMethodBase] = UnquantizedLinearMethod()
else:
self.quant_method = quant_config.get_quant_method(self, prefix=prefix)