Summary
This feature would add the possibility for a developer to write platform-specific functions which will be called inside the RunTimeEvaluator, similar to the way we currently call TVMPlatformTimerStart, TVMPlatformTimerStop, etc.
The pre function (TVMPlatformPreFuncCall) will be called before calling TVMPlatformTimerStart in the crt RunTimeEvaluator, and it could be used, for example, to:
- Call a platform specific cache cleaning function
- Initialize custom counters in the accelerator
The post function (TVMPlatformPostFuncCall) will be called after calling TVMPlatformTimerStop in the crt RunTimeEvaluator, and it could be used, for example, to:
- Clean accelerator specific data
- Read performance counters
Motivation
Generate more accurate measurements for AutoTVM and a place for the developers to insert platform specific code like initializations, cache cleanings, etc.
Advantages
- More accurate measurements for AutoTVM.
- Weak links are provided so that this functions are not mandatory.