-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[tmva][sofie] Profiler code generation for SOFIE #19829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Is there perhaps a way in which we could test this new nice feature? |
Test Results 20 files 20 suites 3d 11h 19m 38s ⏱️ For more details on these failures, see this check. Results for commit 32d38a2. ♻️ This comment has been updated with latest results. |
|
Yes, I think we should add a tutorial for this, generting code instrumented with timers and then producing the results. |
|
Yes, thank you. I will look how to add some testing and will add a tutorial. |
Add missing support for Dynamic tensors for some operators. With this commit a full support for dynamic tensor is available for ParticleNet model. Fix also a bug in Concat operator when the concat axis is not the first one
Since we use now for boolean tensors a std::vector<uint8_t> it is not needed to have a special treatment when the output ttype of the operator is a boolean (e.g. in Comparison)
…ensors Add a new function in SOFIE_common OrganizeMemory which computes the total memory and the offset for each tensor given tensor begin /end life and size. Fix also some small issue with dynamic tensor. One is for the bias of Gemm and Conv. The broadcasting of bias is done for dynamic tensor in the Session constructor only if needed. For the broadcasted tensor there is no need to create a new tensor, but the existing one is resized to the broadcasted needed size using vector::resize
… broadcasting The assert that was generated when broadcasting dynamic tensors was not correct
Apply also other fixes for the SOFIE tests and add a new test for StackMul
The order execution ws not set for tensor inputs to operators added using the GNN Sofie classes. This is now fixed and the correct memory mangement can be performed.
SOme fixes are needed for the test, since the session is not used for this tests. Need also to force using Session in case of Dynamic tensors Fix also a warning in Gemm operator and RModel
f5d5684 to
ff6a141
Compare
…on ctor Do an alphabetical order of Session shape parameters for dynamic tensors, otherwise they may get a random order. Observed different order on different platforms Add some small improvements in the generated code (add nunber and shape informations) when generating Gemm code
ff6a141 to
a121471
Compare
…on ctor Avoid creating a broadcasted bias tensor which uses lots of memory. Do broadcasting of the bias on the fly before computing Gemm by using the output tensor. This saves a large amount of memory on models using large Gemm calss like the atlas GNN model used for tracking
a121471 to
1585356
Compare
Add alias tensors to cope with identity operators. In this case just a pointer assignment is performed by the operator. Exclude this tensors in the allocation and take care of them in the dynamic memory pool Optimise Slice operator when slice is an identity and also ScatterElements
Compute also the error on the average when printing results and sort them in decreasing order in time
1585356 to
32d38a2
Compare
This PR introduces a time-based profiler for the SOFIE inference engine. It provides developers with the tools to analyze the performance of generated C++ models by measuring the execution time of each individual operator, as well as the total inference time.
Changes or fixes:
A new option, SOFIE::Options::kProfile, is added to the RModel::Generate() method to enable the feature.
When enabled, a new RModelProfiler helper class instruments the generated doInfer() method with std::chrono timers.
Utility functions like PrintProfilingResults() and GetOpAvgTime() are added to the generated Session struct to access the collected timing data.
Checklist:
Tested changes locally by running inference in a loop and verifying the timing results.
updated the docs (if necessary)
This PR replaces #19558 by fixing the conflicts with rebasing to master