Closed YongseopKim closed 2 years ago
eg) In ONE-explorer, user creates a cfg file with
$model_type=tflite
$quant_type=q8
, $quant_gran=channel
$backend=dummy
$input_file=./inception_v3.tflite
$output_file=./inception_v3.bin
The new cfg file contains like
[onecc]
one-import-tflite=True
one-quantize=True
one-codegen=True
[one-import-tflite]
input_path=./inception_v3.tflite
output_path=./inception_v3.circle # basename.circle
[one-quantize]
input_path=./inception_v3.circle
output_path=./inception_v3.q8.circle # basename.q.circle
granularity=channel
[one-codegen]
backend=dummy
command=-o inception_v3.bin ./inception_v3.q8.circle
Let's investigate args to create a cfg file.
$model_type=tflite
: this can be infered because user creates a cfg file with model file.$quant_type=q8
, $quant_gran=channel
: this should be passed$backend=dummy
$input_file=./inception_v3.tflite
$output_file=./inception_v3.bin
one-init
mandantory
optional
[tf|tflite|onnx|bcq] -> optimize -> quantize -> codegen
$rm -f mycfg.cfg && bash ./one-new-config -i a.tflite -o b.tvn -b dummy mycfg.cfg && cat mycfg.cfg
[onecc]
one-import-tflite=True
one-optimize=True
one-quantize=True
one-codegen=True
[one-import-tflite]
input_path=a.tflite
output_path=a.circle
[one-optimize]
input_path=a.circle
output_path=a.opt.circle
[one-quantize]
input_path=a.opt.circle
output_path=a.q8.circle
granularity=channel
[one-codegen]
backend=dummy
command=-o b.tvn a.q8.circle
$ rm -f mycfg.cfg && bash ./one-new-config --init mycfg.cfg && cat mycfg.cfg
[onecc]
one-import-{model_type}=True
one-optimize=True
one-quantize=True
one-codegen=True
[one-import-{model_type}]
input_path={input}
output_path={model}.circle
[one-optimize]
input_path={model}.circle
output_path={model}.opt.circle
[one-quantize]
input_path={model}.opt.circle
output_path={model}.{quant}.circle
granularity={granu}
[one-codegen]
backend={backend}
command=-o {output} {model}.{quant}.circle
$ bash onecc new mycfg.cfg
# or
$ bash onecc new -i a.tflite -o b.tvn -b dummy mycfg.cfg
What?
Let's support the default compile options.
How?
When a cfg file is created, the cfg file contains some options if necessary as default.