Skip to content

Commit bf2a0f9

Browse files
committed
Minor bug fix
Signed-off-by: Suguna Velury <[email protected]>
1 parent 994a3a0 commit bf2a0f9

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
@@ -612,6 +612,8 @@ def process_layer_quant_config(layer_config_dict):
612612
# Get the corresponding AWQ block size
613613
block_size_value = layer_config_dict.get(awq_key, 0)
614614

615+
# print(f"DEBUG LOG: Processing layer {k} with quantization {v}, block size {block_size_value}")
616+
615617
if v == "fp8":
616618
layer_config = {"quant_algo": "FP8"}
617619
elif v == "fp8_pc_pt":
@@ -1085,9 +1087,11 @@ def get_quant_config(named_modules: nn.Module | dict[str, nn.Module]) -> dict[st
10851087
if block_size == 0:
10861088
block_size = get_weight_block_size(module)
10871089

1088-
# Construct per layer config dictionary
1089-
layer_config_dict[name + ".quantization"] = quantization_format
1090-
layer_config_dict[name + ".awq_block_size"] = block_size
1090+
# Handles case if default weight quantizer is not enabled or is None
1091+
if block_size != 0:
1092+
# Construct per layer config dictionary
1093+
layer_config_dict[name + ".quantization"] = quantization_format
1094+
layer_config_dict[name + ".awq_block_size"] = block_size
10911095

10921096
# Find kv cache quant format
10931097
if (

0 commit comments

Comments
 (0)