From e6a7d70de02e975c3dd918c069dcf2fbd406be20 Mon Sep 17 00:00:00 2001 From: Alessandro Pappalardo Date: Tue, 27 Jun 2023 17:36:33 +0100 Subject: [PATCH] Fix validate --- src/brevitas_examples/llm/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/brevitas_examples/llm/main.py b/src/brevitas_examples/llm/main.py index 592c0e446..459705185 100644 --- a/src/brevitas_examples/llm/main.py +++ b/src/brevitas_examples/llm/main.py @@ -164,13 +164,13 @@ def validate(args): assert args.weight_quant_granularity != 'per_group', "ONNX QCDQ export doesn't support group weight quantization." if args.weight_quant_type == 'asym': assert args.quantize_weight_zero_point, "Quantized weight zero point required." - if args.input_quant_type == 'asym': + if args.input_bit_width is not None and args.input_quant_type == 'asym': assert args.quantize_input_zero_point, "Quantized input zero point required." if args.export_target == 'torch_qcdq': assert args.weight_quant_granularity != 'per_group', "TorchScript QCDQ export doesn't support group weight quantization." if args.weight_quant_type == 'asym': assert args.quantize_weight_zero_point, "Quantized weight zero point required." - if args.input_quant_type == 'asym': + if args.input_bit_width is not None and args.input_quant_type == 'asym': assert args.quantize_input_zero_point, "Quantized input zero point required." if args.input_bit_width: assert args.act_calibration, "Input quantization is being applied without activation calibration. Set --act-calibration."