Fix circular import in quantization modules (#17372)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user