Repository navigation
Add an "executable tutorial" going from zero to tracy on android - #3664
Conversation
benchmark. Draft, comments welcome. The idea is that a beginner would run it a few times, then it'd be mostly useful as a tutorial to read steps from, not intended to be used long term as a black box tool. Just try running it. It'll complain a bit that you need to define environment variables IREE_ROOT and ANDROID_NDK, and once you do that, it should figure all the rest, including building tracy UI, going through the whole steps of compiling an android benchmark workload, running that in tracy, setting up port forwarding, and finally telling you to run a command to run your (newly built) tracy UI to connect and show the trace.
| -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
| -DIREE_BUILD_COMPILER=OFF \ | ||
| -DIREE_BUILD_SAMPLES=OFF \ | ||
| -DIREE_HOST_C_COMPILER=`which clang` \ |
There was a problem hiding this comment.
do you want to use the $CXX you define above?
| # FUNCTION_INPUTS | ||
| # ENTRY_FUNCTION | ||
|
|
||
| DEFAULT_IREE_INPUT_MLIR="/tmp/iree/modules/MobileBertSquad/iree_input.mlir" |
There was a problem hiding this comment.
Lots of Linux/Debian specific things in here. Maybe add a note in the top comment about not being Windows friendly.
| -DIREE_HOST_CXX_COMPILER=`which "$CXX"` \ | ||
| -DIREE_ENABLE_RUNTIME_TRACING=ON | ||
|
|
||
| cmake --build . |
There was a problem hiding this comment.
Could pick a subset of targets to build instead of building all
|
|
||
| print_status "Compiling the input MLIR file into a IREE module..." | ||
|
|
||
| IREE_COMPILED_MODULE=/tmp/android_module.fbvm |
There was a problem hiding this comment.
| IREE_COMPILED_MODULE=/tmp/android_module.fbvm | |
| IREE_COMPILED_MODULE=/tmp/android_module.vmfb |
vmfb is the preferred extension for these files
| @@ -0,0 +1,238 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
nit: replace - with _ in file name to match the other scripts in https://github.com/google/iree/tree/main/scripts?
| echo | ||
|
|
||
| print_status "Pushing the IREE benchmarking program to the device..." | ||
| adb push "${IREE_BUILD_ANDROID}"/iree/tools/iree-benchmark-module /data/local/tmp |
There was a problem hiding this comment.
Does this also need to be built (see the cmake --build . --target <targets> above)?
Draft, comments welcome.
The idea is that a beginner would run it a few times, then it'd be
mostly useful as a tutorial to read steps from, not intended to be used
long term as a black box tool.
Just try running it (on a Debian linux desktop, with and Android device attached by ADB). It'll complain a bit that you need to define
environment variables IREE_ROOT and ANDROID_NDK, and once you do that,
it should figure all the rest, including building tracy UI, going
through the whole steps of compiling an android benchmark workload,
running that in tracy, setting up port forwarding, and finally telling
you to run a command to run your (newly built) tracy UI to connect
and show the trace.