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][VM] Fix constant folding issue in VM compiler #4077

Merged
merged 12 commits into from
Oct 10, 2019

Conversation

wweic
Copy link
Contributor

@wweic wweic commented Oct 7, 2019

This speeds up mxnet resnset18 by 4x because it fixes constant folding. Now vm is just
1.4x slower than relay graph runtime.

  1. allow pass params when compile a module
  2. enhance profiler robustness

cc @jroesch @zhiics @icemelon9

@zhiics
Copy link
Member

zhiics commented Oct 7, 2019

Is the performance now caused by pass or vm related things, like dispatching and memory allocation?

@wweic wweic force-pushed the vm-compiler branch 2 times, most recently from e622648 to b11b9d2 Compare October 7, 2019 20:30
@wweic
Copy link
Contributor Author

wweic commented Oct 8, 2019

Is the performance now caused by pass or vm related things, like dispatching and memory allocation?

Yes. Most of the time spent other than packed function execution are AllocTensor and LoadConst. @icemelon9 told me to switch to pooled allocator and it improved the 2 instruction significantly(by 5x).

@zhiics
Copy link
Member

zhiics commented Oct 8, 2019

@wweic That sounds cool at some extent. @jroesch's memory pass should help.

1. allow pass params when compile a module
2. enhance profiler robustness
@wweic wweic force-pushed the vm-compiler branch 3 times, most recently from 8af82d3 to 9543ede Compare October 9, 2019 02:53
Copy link
Member

@zhiics zhiics left a comment

Choose a reason for hiding this comment

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

LGTM

src/relay/backend/vm/compiler.h Outdated Show resolved Hide resolved
src/relay/backend/vm/compiler.h Show resolved Hide resolved
python/tvm/relay/backend/vm.py Outdated Show resolved Hide resolved
src/relay/backend/vm/compiler.cc Outdated Show resolved Hide resolved
src/relay/backend/vm/compiler.cc Outdated Show resolved Hide resolved
@zhiics zhiics merged commit fc2713e into apache:master Oct 10, 2019
@wweic wweic deleted the vm-compiler branch October 10, 2019 01:19
anijain2305 pushed a commit to anijain2305/tvm that referenced this pull request Oct 17, 2019
* [Relay][VM] Fix constant folding issue in VM compiler

1. allow pass params when compile a module
2. enhance profiler robustness

* remove dead code

* fix lint

* add get_params

* fix test

* don't pass params back

* remove get_params

* docs

* move compile function to api

* compile clashes with builtin name

* fix compilation error

* remove dead code
wweic added a commit to neo-ai/tvm that referenced this pull request Oct 18, 2019
* [Relay][VM] Fix constant folding issue in VM compiler

1. allow pass params when compile a module
2. enhance profiler robustness

* remove dead code

* fix lint

* add get_params

* fix test

* don't pass params back

* remove get_params

* docs

* move compile function to api

* compile clashes with builtin name

* fix compilation error

* remove dead code
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.

3 participants