-
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 MicroTVM tutorial using the STM32F746 discovery board #5655
Conversation
with a sample tflite model Signed-off-by: Tom Gall <[email protected]>
@tom-gall please look into the CI failure |
Hey Tom, to get this to build further along in the CI, I think you can add the following line to docs/conf.py:
I added this around line 168 and it kept building |
Signed-off-by: Tom Gall <[email protected]>
Signed-off-by: Tom Gall <[email protected]>
Signed-off-by: Tom Gall <[email protected]>
Signed-off-by: Tom Gall <[email protected]>
comment out portion of tutorial that will not run without a physical board available Signed-off-by: Tom Gall <[email protected]>
The block is commented out since it can only run on device Signed-off-by: Tom Gall <[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.
Thanks @tom-gall for your valuable contribution on the uTVM tutorial. I've rendered your tutorial and it's not displayed correctly as expected. Please try generate the html by running
make html
in the <tvm_root>/docs
directory, so that you could preview the rendered html (in <tvm_root>/docs/_build/html
) and fix the syntax errors.
# install tflite | ||
# .. code-block:: bash | ||
# | ||
# pip install tflite=2.1.0 --user |
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 follow RST syntax to put the extra indentation, otherwise it's not rendered as code.
Please try reproduce the the rendered html by running
make html
in <tvm_root>/docs
directory, so that the tutorial could be more reader friendly.
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.
Interestingly make html dies with an exception :
python3 -m sphinx -b html -d _build/doctrees . _build/html
Running Sphinx v3.1.0
loading pickled environment... done
[autosummary] generating autosummary for: api/links.rst, api/python/autotvm.rst, api/python/contrib.rst, api/python/driver.rst, api/python/error.rst, api/python/graph_runtime.rst, api/python/index.rst, api/python/ir.rst, api/python/micro.rst, api/python/ndarray.rst, ..., vta/index.rst, vta/install.rst, vta/tutorials/autotvm/tune_relay_vta.rst, vta/tutorials/frontend/deploy_classification.rst, vta/tutorials/frontend/deploy_detection.rst, vta/tutorials/index.rst, vta/tutorials/matrix_multiply.rst, vta/tutorials/optimize/convolution_opt.rst, vta/tutorials/optimize/matrix_multiply_opt.rst, vta/tutorials/vta_get_started.rst
generating gallery...
generating gallery for tutorials... [ 33%] relay_quick_start.py
Extension error:
Handler <function generate_gallery_rst at 0x7f23e55b04d0> for event 'builder-inited' threw an exception
make: *** [Makefile:70: html] Error 2
I'm using ./tests/scripts/task_sphinx_precheck.sh which seems to generate less than perfect html when viewed elsewhere. I'm less than confident that the html generated is acceptable :-/
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.
I was able to get this to work by deleting the other tutorials. I haven't seen that specific exception, though. I did build your tutorial locally and I think it looks okay now. i'll add a couple of small nitpicks which you could fix if you want to be a perfectionist about it.
Within docs/conf.py place the microTVM tutorial prior to the VTA tutorials Within the micro_tflite - rework section headers - reorder code so model prep code is all in one place as well as code for running on device - address indentation feedback - remove '' '' usage which I mistakenly thought was getting around a sphinx issue involving ** Signed-off-by: Tom Gall <[email protected]>
…assContext Change to pull example model from github with download_testdata Add 2.5K tflite model Couple of small changes following https://sphinx-gallery.github.io/stable/syntax.html Signed-off-by: Tom Gall <[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.
We cannot check in binary files into the codebase, please place the model elsewhere where we can download via download_testdata
Signed-off-by: Tom Gall <[email protected]>
Signed-off-by: Tom Gall <[email protected]>
…abling FuseOps Signed-off-by: Tom Gall <[email protected]>
Change download_testdata back to pull model from linaro server Signed-off-by: Tom Gall <[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.
my parts of comments has been addressed. @liangfu @areusch please followup and https://tvm.apache.org/docs/contribute/code_review.html#approve-and-request-changes-explicitly
# install tflite | ||
# .. code-block:: bash | ||
# | ||
# pip install tflite=2.1.0 --user |
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.
I was able to get this to work by deleting the other tutorials. I haven't seen that specific exception, though. I did build your tutorial locally and I think it looks okay now. i'll add a couple of small nitpicks which you could fix if you want to be a perfectionist about it.
Signed-off-by: Tom Gall <[email protected]>
Signed-off-by: Tom Gall <[email protected]>
* Add MicroTVM tutorial using the STM32F746 discovery board with a sample tflite model Signed-off-by: Tom Gall <[email protected]> * Fix: add a reference to the new turtorials/micro directory Signed-off-by: Tom Gall <[email protected]> * fix: Cosmetic, align Micro TVM text with divider Signed-off-by: Tom Gall <[email protected]> * Fixes to remove warnings, spaces for readability, code blocks Signed-off-by: Tom Gall <[email protected]> * remove use of dload in favor of requests for obtaining the TFLite model Signed-off-by: Tom Gall <[email protected]> * add setup for CMSIS_ST_PATH comment out portion of tutorial that will not run without a physical board available Signed-off-by: Tom Gall <[email protected]> * Fix warning due to ** in python but part of a comment block The block is commented out since it can only run on device Signed-off-by: Tom Gall <[email protected]> * Numerous reworks to address feedback. Within docs/conf.py place the microTVM tutorial prior to the VTA tutorials Within the micro_tflite - rework section headers - reorder code so model prep code is all in one place as well as code for running on device - address indentation feedback - remove '' '' usage which I mistakenly thought was getting around a sphinx issue involving ** Signed-off-by: Tom Gall <[email protected]> * Change disable_vectorize to use current approach with tvm.transform.PassContext Change to pull example model from github with download_testdata Add 2.5K tflite model Couple of small changes following https://sphinx-gallery.github.io/stable/syntax.html Signed-off-by: Tom Gall <[email protected]> * remove use of relay.build_config in favor of PassContext Signed-off-by: Tom Gall <[email protected]> * Couple of minor 4 space fix ups Signed-off-by: Tom Gall <[email protected]> * Change to use tvm.transform.PassContext for disable_victorize and disabling FuseOps Signed-off-by: Tom Gall <[email protected]> * Remove binary module from repo Change download_testdata back to pull model from linaro server Signed-off-by: Tom Gall <[email protected]> * Couple of small cosmetic changes. (spaces and extra lines) Signed-off-by: Tom Gall <[email protected]> * Convert link to tf docs to examine a tf lite model to use RST syntax Signed-off-by: Tom Gall <[email protected]>
* Add MicroTVM tutorial using the STM32F746 discovery board with a sample tflite model Signed-off-by: Tom Gall <[email protected]> * Fix: add a reference to the new turtorials/micro directory Signed-off-by: Tom Gall <[email protected]> * fix: Cosmetic, align Micro TVM text with divider Signed-off-by: Tom Gall <[email protected]> * Fixes to remove warnings, spaces for readability, code blocks Signed-off-by: Tom Gall <[email protected]> * remove use of dload in favor of requests for obtaining the TFLite model Signed-off-by: Tom Gall <[email protected]> * add setup for CMSIS_ST_PATH comment out portion of tutorial that will not run without a physical board available Signed-off-by: Tom Gall <[email protected]> * Fix warning due to ** in python but part of a comment block The block is commented out since it can only run on device Signed-off-by: Tom Gall <[email protected]> * Numerous reworks to address feedback. Within docs/conf.py place the microTVM tutorial prior to the VTA tutorials Within the micro_tflite - rework section headers - reorder code so model prep code is all in one place as well as code for running on device - address indentation feedback - remove '' '' usage which I mistakenly thought was getting around a sphinx issue involving ** Signed-off-by: Tom Gall <[email protected]> * Change disable_vectorize to use current approach with tvm.transform.PassContext Change to pull example model from github with download_testdata Add 2.5K tflite model Couple of small changes following https://sphinx-gallery.github.io/stable/syntax.html Signed-off-by: Tom Gall <[email protected]> * remove use of relay.build_config in favor of PassContext Signed-off-by: Tom Gall <[email protected]> * Couple of minor 4 space fix ups Signed-off-by: Tom Gall <[email protected]> * Change to use tvm.transform.PassContext for disable_victorize and disabling FuseOps Signed-off-by: Tom Gall <[email protected]> * Remove binary module from repo Change download_testdata back to pull model from linaro server Signed-off-by: Tom Gall <[email protected]> * Couple of small cosmetic changes. (spaces and extra lines) Signed-off-by: Tom Gall <[email protected]> * Convert link to tf docs to examine a tf lite model to use RST syntax Signed-off-by: Tom Gall <[email protected]>
Add MicroTVM tutorial using the STM32F746 discovery board
with a sample tflite model
Signed-off-by: Tom Gall [email protected]
Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.