[tmva][sofie] Added RModelProfiler and named ROperator s
Profiler for inspecting C++ models generated with SOFIE
Added a new class called RModelProfiler that allows to generate an hardcoded C++ header that automatically measures the time that each operator took during one or more runs of the infer function. In other words it profiles the model by means of code instrumentation.
Under the hood
RModelProfiler is a friend class of RModel that initializes a private reference to an existing RModel object.
When the code is generated through RModelProfiler::Generate() (rewritten to inject profiling code in between operators), the latter access the private member fGC, thus generating the model directly into the RModel object.
In the generated code, profiling info such as time (microseconds) are saved in ::profiler_results.
Affine changes
- Added public member
std::string nameinROperator(e.g. Gemm_1, ..). - Changed
make_ROperator()so that is assignsnameof the operator with the one it had within the original ONNX model. - Added an example of how to use the profiler in
README.md.
Can one of the admins verify this patch?