mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-19 13:52:07 +00:00
Small test and typing fixes (#3078)
* test_weights: add modules_to_not_convert * More typing fixes
This commit is contained in:
parent
cae0cbe87d
commit
c5ecc7a4de
@ -25,6 +25,7 @@ def gptq_weights_loader():
|
|||||||
quant_method="gptq",
|
quant_method="gptq",
|
||||||
quantize="gptq",
|
quantize="gptq",
|
||||||
sym=True,
|
sym=True,
|
||||||
|
modules_to_not_convert=[],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -37,6 +38,7 @@ def gptq_weights_loader_awq():
|
|||||||
quant_method="awq",
|
quant_method="awq",
|
||||||
quantize="awq",
|
quantize="awq",
|
||||||
sym=True,
|
sym=True,
|
||||||
|
modules_to_not_convert=[],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -188,8 +188,6 @@ class GPTQWeightsLoader(WeightsLoader):
|
|||||||
def is_layer_skipped_quantization(
|
def is_layer_skipped_quantization(
|
||||||
self, prefix: str, modules_to_not_convert: List[str]
|
self, prefix: str, modules_to_not_convert: List[str]
|
||||||
):
|
):
|
||||||
if modules_to_not_convert is None:
|
|
||||||
return False
|
|
||||||
return any(module_name in prefix for module_name in modules_to_not_convert)
|
return any(module_name in prefix for module_name in modules_to_not_convert)
|
||||||
|
|
||||||
def get_weights_col_packed(
|
def get_weights_col_packed(
|
||||||
|
@ -21,7 +21,7 @@ class _QuantizerConfig:
|
|||||||
quant_method: str
|
quant_method: str
|
||||||
sym: bool
|
sym: bool
|
||||||
weight_block_size: Optional[List[int]]
|
weight_block_size: Optional[List[int]]
|
||||||
modules_to_not_convert: Optional[List[str]]
|
modules_to_not_convert: List[str]
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@ -52,7 +52,7 @@ def _get_quantizer_config(model_id, revision):
|
|||||||
sym = False
|
sym = False
|
||||||
desc_act = False
|
desc_act = False
|
||||||
weight_block_size = None
|
weight_block_size = None
|
||||||
modules_to_not_convert = None
|
modules_to_not_convert = []
|
||||||
|
|
||||||
filename = "config.json"
|
filename = "config.json"
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user