wkcn / MobulaOP

A Simple & Flexible Cross Framework Operators Toolkit
MIT License
164 stars 21 forks source link

Add TVM example #11

Closed merrymercy closed 6 years ago

merrymercy commented 6 years ago

TVM is useful for generating high performance kernels for cpu, gpu and accelerators.

This pr adds a simple example about how to use tvm generated kernels for mxnet and pytorch on cpu and gpu.

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 201


Changes Missing Coverage Covered Lines Changed/Added Lines %
mobula/glue/th.py 0 4 0.0%
<!-- Total: 0 4 0.0% -->
Totals Coverage Status
Change from base Build 198: 0.8%
Covered Lines: 990
Relevant Lines: 1246

💛 - Coveralls
coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 206


Changes Missing Coverage Covered Lines Changed/Added Lines %
mobula/glue/th.py 0 4 0.0%
<!-- Total: 0 4 0.0% -->
Files with Coverage Reduction New Missed Lines %
mobula/test_utils.py 1 65.85%
mobula/glue/common.py 1 92.78%
mobula/op/load_module.py 4 94.57%
<!-- Total: 6 -->
Totals Coverage Status
Change from base Build 205: -0.1%
Covered Lines: 985
Relevant Lines: 1249

💛 - Coveralls
wkcn commented 6 years ago

TVM is great :-) Thank you for your contribution!

merrymercy commented 5 years ago

I like the idea of cross platform operator. TVM also supports dlpack so no memory copy happens during the integration with mxnet and pytorch (see our blog). In this project, tvm's role is similar to mobula.func. The part that I can reuse here is mainly mobula.backend

Interesting future works include supporting auto differential (related halide paper) and auto tuning (necessary to get the best performance) for the operators.

wkcn commented 5 years ago

I know TVM and DLPack. They are great. It's better to get a higher performance with TVM. Thank you!