[WIP] Set up CNN accelerator codegen skeleton + counting utilities #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It took a little bit of hacking to get attributes working, but I have an efficientnet import example and a codegen skeleton for the CNN accelerator. Once we have the ASM worked out, it should be pretty easy to do all the plumbing.
Right now the runtime will only print things; it won't actually do anything because I don't know what to target.
There's a small function in
ilacnn.py
that rewrites any conv2d with padding intoconv2d(pad(data), weight)
so that padding will be handled entirely by our codegen. In theory, the runtime can do that part implicitly, but doing this tiny rewrite saves us a ton of debugging.The script for running the EfficientNet trial is a little wacky. Let me know if there's anything I can better implement about it or how to improve it. Note that you will need mxnet installed for the import to work (I don't know if the dockerfile has it), though otherwise everything is handled seamlessly by TVM's importer.
Also includes some simple utilities for counting the number ops, overloads, etc
Please review and comment @AD1024 @LeeOHzzZ @Bo-Yuan-Huang @ttambe