Skip to content

Commit 013a0f6

Browse files
Tweak AWQ CLI interface
1 parent 56878bb commit 013a0f6

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

optimum/commands/export/openvino.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,10 @@ def parse_args_openvino(parser: "ArgumentParser"):
130130
),
131131
)
132132
optional_group.add_argument(
133-
"--quant-method",
134-
type=str,
133+
"--awq",
134+
action="store_true",
135135
default=None,
136-
choices=["default", "awq", "hybrid"],
137-
help=("The quantization method to apply. Can be one of the following: ['default', 'awq', 'hybrid']."),
136+
help="Whether to apply AWQ algorithm. To run AWQ, please also provide a dataset.",
138137
)
139138
optional_group.add_argument(
140139
"--sensitivity-metric",
@@ -150,7 +149,7 @@ def parse_args_openvino(parser: "ArgumentParser"):
150149
"--num-samples",
151150
type=int,
152151
default=None,
153-
help=("The maximum number of samples composing the calibration dataset for quantization."),
152+
help="The maximum number of samples to take from the dataset for quantization.",
154153
)
155154
optional_group.add_argument(
156155
"--disable-stateful",
@@ -233,7 +232,6 @@ def run(self):
233232
and self.args.sym is None
234233
and self.args.all_layers is None
235234
and self.args.dataset is None
236-
and self.args.quant_method is None
237235
and self.args.sensitivity_metric is None
238236
and self.args.model in _DEFAULT_4BIT_CONFIGS
239237
):
@@ -247,7 +245,7 @@ def run(self):
247245
"all_layers": None if is_int8 else self.args.all_layers,
248246
"dataset": self.args.dataset,
249247
"num_samples": self.args.num_samples,
250-
"quant_method": self.args.quant_method,
248+
"quant_method": "awq" if self.args.awq else None,
251249
"sensitivity_metric": self.args.sensitivity_metric,
252250
}
253251

tests/openvino/test_exporters_cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class OVCLIExportTestCase(unittest.TestCase):
9292
(
9393
"text-generation-with-past",
9494
"llama_awq",
95-
"int4 --ratio 1.0 --sym --group-size 16 --quant-method awq --dataset wikitext2 --num-samples 100 "
95+
"int4 --ratio 1.0 --sym --group-size 16 --awq --dataset wikitext2 --num-samples 100 "
9696
"--sensitivity-metric max_activation_variance",
9797
4,
9898
28,

0 commit comments

Comments
 (0)