-
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
[Relay][Runtime] Add VM compiler. #3139
Conversation
@tqchen @wweic @MarisaKirisame @weberlo @icemelon9 @zhiics final bit of VM to review tests are green. |
include/tvm/relay/vm_compiler.h
Outdated
|
||
bool IsClosure(const Function& func); | ||
Module LambdaLift(const Module& module); | ||
Module InlinePrimitives(const Module& module); |
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.
Add comments and an example?
|
||
if __name__ == '__main__': | ||
test_resnet() | ||
# test_vgg() |
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.
enable all the tests here.
|
||
inline std::string GenerateName(const Function& func) { | ||
size_t hash = StructuralHash()(func); | ||
return std::string("lifted_name") + std::to_string(hash); |
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.
what if hash collision? just do a unique binder
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.
Hash collision is low, I will just prefix function name too
Co-Authored-By: 雾雨魔理沙 <[email protected]>
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.
lgtm
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.
some minor nits
using ConstTensorShapeMap = NodeMap<TensorType, std::pair<Index, NDArray>>; | ||
|
||
struct VMCompilerContext { | ||
Module module; |
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.
document the fields.
* Implement the VM compiler * Fix issues * Fix ASF headers * Fix test issue * Apply typo fixes. * Update src/relay/backend/vm/compiler.cc Co-Authored-By: 雾雨魔理沙 <[email protected]> * Refactor compiler * Fix * Fix * Fix in benchmark * Fix * Address comments
* Implement the VM compiler * Fix issues * Fix ASF headers * Fix test issue * Apply typo fixes. * Update src/relay/backend/vm/compiler.cc Co-Authored-By: 雾雨魔理沙 <[email protected]> * Refactor compiler * Fix * Fix * Fix in benchmark * Fix * Address comments
The final PR for the runtime series, adds the VM compiler and its associated test cases.
Blocked on: #2889.