I have stumbled across a use case which could be an interesting addition to the CRT runtime.
Consider the following scenario:
- A host is running AutoTVM, executing the generated code in another platform thanks to microTVM and RPC (for example, an ARM or RISCV development board).
- Suppose this platform has an accelerator which provides specific custom performance counters (or any custom data) which gives more information about the execution of the model than just the average execution time, as measured nowadays by TVM.
I would like to find a way of integrating this custom data into TVM, so that I can retrieve the performance counters values for each run from the host side.
I was looking where to add this information, in order to make it generic enough so that any custom data can be added. So far I was able to find that the following changes should be done:
- Inside the RuntimeEvaluator of the CRT runtime api, a platform-specific function (similar to TVMPlatformTimerStart) should be added to integrate all the data that needs to be returned to the TVM host.
- I also understand that a change should be done in the HandleNormalCallFunc function of the minrpc, in order to actually return this values to the host.
- In the Python function run_through_rpc, the returned object of class MeasureResult should also be modified.
- The MeasureResult class should probably be modified to support this custom data (perhaps add an array of dictionaries to hold the custom data?)