Skip to content

Commit

Permalink
Refine op_types_to_quantize argument handling in matmul_4bits_quant…
Browse files Browse the repository at this point in the history
…izer.py (#21815)

### Description
<!-- Describe your changes. -->

Refine `op_types_to_quantize` argument handling in
matmul_4bits_quantizer.py

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
The default `op_types_to_quantize "MatMul"` will cause
`tuple(args.op_types_to_quantize)` to become `('M', 'a', 't', 'M', 'u',
'l')`, which is not expected.
  • Loading branch information
duanshengliu authored Aug 23, 2024
1 parent 44dcc3a commit 4af6291
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,6 @@ def parse_args():
)
parser.add_argument(
"--op_types_to_quantize",
default="MatMul",
type=str,
nargs="+",
choices=["MatMul", "Gather"],
Expand All @@ -1089,7 +1088,7 @@ def parse_args():
input_model_path = args.input_model
output_model_path = args.output_model
quant_format = QuantFormat[args.quant_format]
op_types_to_quantize = tuple(args.op_types_to_quantize) if args.op_types_to_quantize else None
op_types_to_quantize = tuple(args.op_types_to_quantize) if args.op_types_to_quantize else ("MatMul",)
quant_axes = tuple(args.quant_axes) if args.quant_axes else None

if os.path.exists(output_model_path):
Expand Down

0 comments on commit 4af6291

Please sign in to comment.