Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[one-cmds] Introduce config file for optimization options #7513

Closed
mhs4670go opened this issue Aug 18, 2021 · 4 comments
Closed

[one-cmds] Introduce config file for optimization options #7513

mhs4670go opened this issue Aug 18, 2021 · 4 comments
Labels
type/discussion We need discussion. Discussion itself can help. Even without conclusions!

Comments

@mhs4670go
Copy link
Contributor

What

Let's introduce configuration file for optimization options.

Related: #5784

Why

Current optimization options are included in a configuration file.

$ cat one-build.cfg
[one-build]
one-import-tf=True
one-optimize=True
[one-import-tf]
...
[one-optimize]
input_path='model.circle'
output_path='model.opt.circle'
nchw_to_nhwc_input_shape=True
nchw_to_nhwc_output_shape=True
..
$ ./one-build -C one-build.cfg

How about introduce another configuration file for opt options?

$ cat one-build.cfg
[one-build]
one-import-tf=True
one-optimize=True
[one-import-tf]
...
[one-optimize]
input_path='model.circle'
output_path='model.opt.circle'
..
$ cat O1.cfg
[one-optimize]
nchw_to_nhwc_input_shape=True
nchw_to_nhwc_output_shape=True

$ cat OAI_SOUND.cfg
[one-optimize]
convert_nchw_to_nhwc=True
nchw_to_nhwc_input_shape=True
nchw_to_nhwc_output_shape=True
forward_reshape_to_unaryop=True
fuse_batchnorm_with_conv=True
remove_redundant_transpose=True
remove_redundant_reshape=True
[one-codegen]
command=--verbose

$ ./one-build -C one-build.cfg -O1
# read one-build.cfg and O1.cfg
$ ./one-build -C one-build.cfg -OAI_SOUND
# read one-build.cfg and OAI_SOUND.cfg

This idea is suggested by @lemmaa. Let me know if what I've written in this issue is a bit different from what we were talking about.

@glistening @jyoungyun Feel free to give opinions:)

@mhs4670go mhs4670go added the type/discussion We need discussion. Discussion itself can help. Even without conclusions! label Aug 18, 2021
@lemmaa
Copy link
Member

lemmaa commented Aug 19, 2021

Let me know if what I've written in this issue is a bit different from what we were talking about.

@mhs4670go , Thanks! Let me explain briefly.

  1. Its main purpose is to provide higher-level optimization options such as -O0 -O1 . In other words, from a list of numerous individual optimization options, it is intended to increase the convenience of use by handling several necessary items as a set.

  2. In doing this, our toolchain runs through several stages, so the individual options composing onecc's -O option need to be able to control all of the toolchain stages.

Based on this, I was thinking about how to set the default list for each stage component of the toolchain, and I agreed that the format of the *.cfg file currently used in onecc -C is one of the good way.

Considering the interaction with the IDE environment and maintenance, it was considered to maintain a separate *.cfg file for each -O option.

Furthermore, by extending this method, keep the possibility of generalized use such as -ONCHW, -OONNX, etc., rather than a limited use such as -O1, -O2, is opened. (However, I think this is optional, not mandatory for this work.)

That's all.

@lemmaa
Copy link
Member

lemmaa commented Aug 19, 2021

/cc @winstone77

@seanshpark
Copy link
Contributor

From #7868 (comment)

@seanshpark It should be one-build -O " Hello World" -C ${config_file}. Or one-build "-O Hello World" -C ${config_file}

We can use " for O files having space in the name.
But this may give confusion to the users.
This is optional but what do you think about NOT perimitting spaces in the name?

@mhs4670go
Copy link
Contributor Author

@seanshpark Okay. I'll apply it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/discussion We need discussion. Discussion itself can help. Even without conclusions!
Projects
None yet
Development

No branches or pull requests

3 participants