Skip to content

Commit 7b7188e

Browse files
committed
Minor bug fix
Signed-off-by: Suguna Velury <[email protected]>
1 parent 8b97a10 commit 7b7188e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

modelopt/torch/export/quant_utils.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,8 @@ def process_layer_quant_config(layer_config_dict):
608608
# Get the corresponding AWQ block size
609609
block_size_value = layer_config_dict.get(awq_key, 0)
610610

611+
# print(f"DEBUG LOG: Processing layer {k} with quantization {v}, block size {block_size_value}")
612+
611613
if v == "fp8":
612614
layer_config = {"quant_algo": "FP8"}
613615
elif v == "fp8_pc_pt":
@@ -1079,9 +1081,11 @@ def get_quant_config(named_modules: nn.Module | dict[str, nn.Module]) -> dict[st
10791081
if block_size == 0:
10801082
block_size = get_weight_block_size(module)
10811083

1082-
# Construct per layer config dictionary
1083-
layer_config_dict[name + ".quantization"] = quantization_format
1084-
layer_config_dict[name + ".awq_block_size"] = block_size
1084+
# Handles case if default weight quantizer is not enabled or is None
1085+
if block_size != 0:
1086+
# Construct per layer config dictionary
1087+
layer_config_dict[name + ".quantization"] = quantization_format
1088+
layer_config_dict[name + ".awq_block_size"] = block_size
10851089

10861090
# Find kv cache quant format
10871091
if (

0 commit comments

Comments
 (0)