Skip to content

Conversation

@CircleSpin
Copy link
Contributor

@CircleSpin CircleSpin commented Mar 24, 2021

This PR moves the load component from compile_module to drive_compile to make it cleaner for python scripting. It prevents "double dipping" the load in frontends more than once.
The flow is now

  1. mod, params = tvmc.load("whatever") #from frontends.py
  2. lib, etc = tvmc.compile(mod, params) #from compiler.py

See PR #7698 for import details.

TVMC behavior from command line won't change, as this only effects compile_module directly from python.

@CircleSpin
Copy link
Contributor Author

@comaniac
Copy link
Contributor

I'm fine with this change. Leave on others.

@jwfromm jwfromm changed the title [TVMC] Externalize load from compile_module (compiler.py line 132) [TVMC] Separate model loading from model compilation in TVMC. Mar 25, 2021
Copy link
Contributor

@leandron leandron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well.

@jwfromm jwfromm merged commit d12dd95 into apache:main Apr 2, 2021
@jwfromm
Copy link
Contributor

jwfromm commented Apr 2, 2021

Thanks @CircleSpin, @comaniac, and @leandron. This is now merged.

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
…#7739)

* add to init files for clean tvmc python

* adjust tests to new imports

* add to compiler.py

* update so model loads in drive_compile

* update test_compiler.py to load outside of tvmc.compile, need to correct one error

* fix mock.patch test

* remove merge artifact (circular import issue)

* change typo and merge artifact

* fix import in test_compiler.py

* black needed files

* remove unnecessary argument model_format from compile_module

* load before compile in conftest.py

* fix conftest.py issue

* fix typo in test_compiler.py

Co-authored-by: Jocelyn <jocelyn@pop-os.localdomain>
Co-authored-by: Josh Fromm <jwfromm@uw.edu>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
…#7739)

* add to init files for clean tvmc python

* adjust tests to new imports

* add to compiler.py

* update so model loads in drive_compile

* update test_compiler.py to load outside of tvmc.compile, need to correct one error

* fix mock.patch test

* remove merge artifact (circular import issue)

* change typo and merge artifact

* fix import in test_compiler.py

* black needed files

* remove unnecessary argument model_format from compile_module

* load before compile in conftest.py

* fix conftest.py issue

* fix typo in test_compiler.py

Co-authored-by: Jocelyn <jocelyn@pop-os.localdomain>
Co-authored-by: Josh Fromm <jwfromm@uw.edu>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
…#7739)

* add to init files for clean tvmc python

* adjust tests to new imports

* add to compiler.py

* update so model loads in drive_compile

* update test_compiler.py to load outside of tvmc.compile, need to correct one error

* fix mock.patch test

* remove merge artifact (circular import issue)

* change typo and merge artifact

* fix import in test_compiler.py

* black needed files

* remove unnecessary argument model_format from compile_module

* load before compile in conftest.py

* fix conftest.py issue

* fix typo in test_compiler.py

Co-authored-by: Jocelyn <jocelyn@pop-os.localdomain>
Co-authored-by: Josh Fromm <jwfromm@uw.edu>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request May 11, 2021
…#7739)

* add to init files for clean tvmc python

* adjust tests to new imports

* add to compiler.py

* update so model loads in drive_compile

* update test_compiler.py to load outside of tvmc.compile, need to correct one error

* fix mock.patch test

* remove merge artifact (circular import issue)

* change typo and merge artifact

* fix import in test_compiler.py

* black needed files

* remove unnecessary argument model_format from compile_module

* load before compile in conftest.py

* fix conftest.py issue

* fix typo in test_compiler.py

Co-authored-by: Jocelyn <jocelyn@pop-os.localdomain>
Co-authored-by: Josh Fromm <jwfromm@uw.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants