jverma-quic opened a new pull request, #12971: URL: https://github.com/apache/tvm/pull/12971
This's done by instrumenting the code with profiling builtin calls using a TIR pass. During codegen, these builtin calls are replaced with the calls to a hexagon specific handler which records the runtime information into a buffer. This buffer is written into a JSON file ('lwp.json') which is processed to construct function and loop-level profiling information as a csv file. At a high-level, this PR makes the following changes: 1) Add a TIR pass (src/tir/transforms/profile_instrumentation.cc) to instrument the functions and loops with profilging builtins. 2) Hexagon codegen changes to replace profilng builtin calls with the call to Hexagon specific handler. This handler record the runtime data into a buffer. For all other targets, these builtin calls are ignored. 3) Add API to RPC Launcher to get the profiling data as a JSON file 4) Add a python script (python/tvm/contrib/hexagon/profiling/process_lwp_data.py) to process the profiling data and construct a CSV file 5) Add TVM script based unit tests to test and demonstrate various profiling config flags: tests/python/unittest/test_tir_transform_profiling_instr.py 6) Adds two tests in tests/python/contrib/test_hexagon/test_launcher.py to demonstrate necessary changes to enable profiling and to collect and process runtime data. For additional details, please refer to src/runtime/hexagon/profiler/README.md and apps/hexagon_launcher/README.md. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org