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

[relay][frontend] Return Module from get_workload #3483

Merged
merged 7 commits into from
Jul 6, 2019

Conversation

zhiics
Copy link
Member

@zhiics zhiics commented Jul 3, 2019

This PR makes the relay testing frontend returns Module as the frontend parsers also return Module.

cc @tqchen @jroesch @wweic @MarisaKirisame

@jroesch
Copy link
Member

jroesch commented Jul 3, 2019

Could we add a Python property to Module such as main so we don't have to write so much boiler plate everywhere?

@zhiics
Copy link
Member Author

zhiics commented Jul 3, 2019

@jroesch Sure. I will update the rest part of the code for this PR tomorrow.

Copy link
Contributor

@wweic wweic left a comment

Choose a reason for hiding this comment

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

lgtm. marked remaining mod[mod.entry_point]

python/tvm/relay/testing/init.py Outdated Show resolved Hide resolved
tests/python/frontend/mxnet/test_graph.py Outdated Show resolved Hide resolved
tests/python/frontend/mxnet/test_graph.py Outdated Show resolved Hide resolved
tests/python/relay/test_autotvm_task_extraction.py Outdated Show resolved Hide resolved
tests/python/relay/test_autotvm_task_extraction.py Outdated Show resolved Hide resolved
tutorials/autotvm/tune_relay_arm.py Outdated Show resolved Hide resolved
tutorials/autotvm/tune_relay_cuda.py Outdated Show resolved Hide resolved
tutorials/autotvm/tune_relay_mobile_gpu.py Outdated Show resolved Hide resolved
tutorials/autotvm/tune_relay_x86.py Outdated Show resolved Hide resolved
tutorials/autotvm/tune_relay_x86.py Outdated Show resolved Hide resolved
@zhiics
Copy link
Member Author

zhiics commented Jul 3, 2019

@wweic Thanks. I just refactored part of the code last night. Now everything should be updated to main

@tqchen
Copy link
Member

tqchen commented Jul 3, 2019

@zhiics @jroesch I feel we should avoid introducing the additional field mod.main, but instead, directly use mod["main"], so it is no different from getting other functions (remove one level of abstraction). We could likely remove mod.entry_func later.

@zhiics
Copy link
Member Author

zhiics commented Jul 3, 2019

@jroesch do you have any comments? I am okay with either way. I can refactor to mod["main"] if you are okay as well.

@jroesch
Copy link
Member

jroesch commented Jul 4, 2019

Tianqi and I discussed some more, he argues we should just remove and make it so there is no special main function, and we just use main as convention but allow the specification of multiple entry points in the future to passes that do liveness, etc.

Sorry for the back and forth, enjoy the holiday!

@zhiics
Copy link
Member Author

zhiics commented Jul 4, 2019

@jroesch No worries.

I have one question about the updating the function for a globalvar in a module. I might miss something about the multiple entry points.

For example, we may create a module (mod) using from_expr where a main is created or directly create a module using module({"main": func}). Now if I have mod["main"] = func1, should I update the function for main, or should I keep both? I think we should just check if main is in the global list, if so, we then just update the function, right? Originally, we just update the function for entry_func

@tqchen
Copy link
Member

tqchen commented Jul 5, 2019

@zhiics I think we should update the "main" just as if it is a normal function

@jroesch
Copy link
Member

jroesch commented Jul 5, 2019

I think we should just treat all functions uniformly, there are a couple places where we might need to specify an entry point, and we can just default to main.

@jroesch jroesch merged commit f35f227 into apache:master Jul 6, 2019
wweic pushed a commit to wweic/tvm that referenced this pull request Jul 11, 2019
* [relay][frontend] Return Module from get_workload

* pass entry_func to autotvm

* disable tune

* add property to module

* mod.entry_func to main

* .main -> mod["main"]

* fix
wweic pushed a commit to wweic/tvm that referenced this pull request Jul 11, 2019
* [relay][frontend] Return Module from get_workload

* pass entry_func to autotvm

* disable tune

* add property to module

* mod.entry_func to main

* .main -> mod["main"]

* fix
wweic pushed a commit to neo-ai/tvm that referenced this pull request Jul 11, 2019
* [relay][frontend] Return Module from get_workload

* pass entry_func to autotvm

* disable tune

* add property to module

* mod.entry_func to main

* .main -> mod["main"]

* fix
@zhiics zhiics deleted the get_workload branch July 21, 2019 06:38
tqchen pushed a commit to tqchen/tvm that referenced this pull request Mar 29, 2020
* [relay][frontend] Return Module from get_workload

* pass entry_func to autotvm

* disable tune

* add property to module

* mod.entry_func to main

* .main -> mod["main"]

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants