Skip to content

Commit b48ff81

Browse files
authored
Neural Coder mod launcher arg: "strategy" to "approach" (#201)
1 parent 01899d6 commit b48ff81

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

neural_coder/__main__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def parse_args():
2828
parser.add_argument("--opt", type=str, default="",
2929
help="optimization feature to enable")
3030

31-
parser.add_argument("--strategy", type=str, default="static",
32-
help="quantization strategy")
31+
parser.add_argument("--approach", type=str, default="static",
32+
help="quantization approach (strategy)")
3333

3434
parser.add_argument('--config', type=str, default="",
3535
help='quantization configuration file path')
@@ -53,11 +53,11 @@ def parse_args():
5353
# optimize on copied script with Neural Coder
5454
from neural_coder import enable
5555
if args.opt == "":
56-
if args.strategy == "static":
56+
if args.approach == "static":
5757
features=["pytorch_inc_static_quant_fx"]
58-
if args.strategy == "static_ipex":
58+
if args.approach == "static_ipex":
5959
features=["pytorch_inc_static_quant_ipex"]
60-
if args.strategy == "dynamic":
60+
if args.approach == "dynamic":
6161
features=["pytorch_inc_dynamic_quant"]
6262
else:
6363
features=[args.opt]

neural_coder/docs/PythonLauncher.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Note: Any modification on the optimized code ```run_glue_optimized.py``` will be
2727

2828
Users can specify which Deep Learning optimization they want to conduct using ```--opt``` argument. The list of supported Deep Learning optimization features can be found [here](SupportMatrix.md).
2929

30-
Note that if specifically optimizing with INT8 quantization by Intel® Neural Compressor, ```--strategy``` argument can be specified with either ```static```, ```static_ipex``` or ```dynamic```. For example, to run INT8 dynamic quantization by Intel® Neural Compressor instead of the default static quantization:
30+
Note that if specifically optimizing with INT8 quantization by Intel® Neural Compressor, to choose a quantization approach (strategy), ```--approach``` argument can be specified with either ```static```, ```static_ipex``` or ```dynamic```. For example, to run INT8 dynamic quantization by Intel® Neural Compressor instead of the default static quantization:
3131
```bash
32-
python -m neural_coder --strategy dynamic run_glue.py --model_name_or_path bert-base-cased --task_name mrpc --do_eval --output_dir result
32+
python -m neural_coder --approach dynamic run_glue.py --model_name_or_path bert-base-cased --task_name mrpc --do_eval --output_dir result
3333
```

0 commit comments

Comments
 (0)