-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add TVM application extension with WASM runtime #5892
Conversation
Thanks @leonwanghui Given that TVM is a compilation stack, directly generating generic ops may not give the best performance for deployment, as the compilation approach takes a lot of shape specialization and fusions. A better approach for integration might be creating a relay or TIR-level integration from the framework to the TVM's unified IR, then let the compilation produces a standalone module. |
@tqchen Thanks for your suggestion, if we target relay or TIR-level integration, does that mean we need to create Rust FFI for them at first? |
@jroesch is already working on some of the RUST FFI access. We can also do that through python or other language binding and only use the rust runtime to execute in wasm. |
Thanks @tqchen, it seems promising to me. I will finish the PoC and update this PR later. |
0e858d8
to
6187bd8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the csv file as we cannot checkin binary to the codebase
5a0e4de
to
7d5be42
Compare
@tqchen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @leonwanghui some high level comments, please also check the CI error and add the license header to the related files
65b22df
to
17bc8ec
Compare
cc @tqchen Please review it again, thanks! |
@tqchen It seems that the + docker/bash.sh tvmai/ci-lint:v0.61 ./tests/scripts/task_lint.sh
WORKSPACE: /scratch/jenkins-tvm/cudabuild/workspace/exec_3/tvm/sanity
DOCKER CONTAINER NAME: tvmai/ci-lint:v0.61
Running './tests/scripts/task_lint.sh' inside tvmai/ci-lint:v0.61...
mesg: ttyname failed: Inappropriate ioctl for device
Adding group `tvm' (GID 1000) ...
Done.
Check file types...
------File type check report----
apps/wasm-standalone/wasm-graph/.cargo/config
Found 1 files that are now allowed
We do not check in binary files into the repo.
If necessary, please discuss with committers andmodify tests/lint/check_file_type.py to enable the file you need.
script returned exit code 255 |
@leonwanghui it seems that we might want to include .cargo/config, can you modify |
cc @kazum |
30b5d66
to
a7958bf
Compare
cc @kazum I have resolved your comments, PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
a9baaf2
to
5696d19
Compare
cc @tqchen |
41e6556
to
69d4eaa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the style fixes. Please remember to also run cargo clippy
!
Signed-off-by: leonwanghui <[email protected]>
69d4eaa
to
750d47e
Compare
@leonwanghui please send another commit to trigger the CI, @jroesch @nhynes please followup and take another look |
@tqchen This PR looks fine. I have a few style nits, but I don't think they'd be well received. Thanks @leonwanghui for the contribution! |
cc @tqchen Your comments have been addressed, PTAL |
Thanks @leonwanghui @jroesch @nhynes @kazum ! this PR is now merged |
* Refactor wasm runtime module and resovle conflict errors Signed-off-by: leonwanghui <[email protected]> * Fix some cargo clippy warnings Signed-off-by: leonwanghui <[email protected]>
* Refactor wasm runtime module and resovle conflict errors Signed-off-by: leonwanghui <[email protected]> * Fix some cargo clippy warnings Signed-off-by: leonwanghui <[email protected]>
* Refactor wasm runtime module and resovle conflict errors Signed-off-by: leonwanghui <[email protected]> * Fix some cargo clippy warnings Signed-off-by: leonwanghui <[email protected]>
* Refactor wasm runtime module and resovle conflict errors Signed-off-by: leonwanghui <[email protected]> * Fix some cargo clippy warnings Signed-off-by: leonwanghui <[email protected]>
* Refactor wasm runtime module and resovle conflict errors Signed-off-by: leonwanghui <[email protected]> * Fix some cargo clippy warnings Signed-off-by: leonwanghui <[email protected]>
Background
As demonstrated in TVM runtime tutorials, TVM already supports WASM as the optional hardware backend, so we can leverage the features of WebAssembly (portability, security) and TVM runtime (domain-specific, optimization) to build a flexible and auto-optimized operator backend for all deep learning frameworks.
Proposal Summary
This PR is mainly proposed to add new TVM application extension that provides WASM operator backend for deep learning frameworks with TVM runtime. We believe it would bring some new ideas by combining WASM runtime with TVM compiler stack.
Thanks for reviewing this proposal, considering it's at the experimental stage to incubation, so any suggestions or questions are welcomed. And we wish more contributors can join in to make it grow up.
@tqchen @jroesch @kazum PTAL, thanks!