Skip to content

[PWGEM,Tools] Update EMCal Conversion ML Model and enable batching of… - #17768

Merged
mhemmer-cern merged 3 commits into
AliceO2Group:masterfrom
mhemmer-cern:emcal-ml
Sep 7, 2026
Merged

[PWGEM,Tools] Update EMCal Conversion ML Model and enable batching of…#17768
mhemmer-cern merged 3 commits into
AliceO2Group:masterfrom
mhemmer-cern:emcal-ml

Conversation

@mhemmer-cern

Copy link
Copy Markdown
Collaborator

… ml models

  • Add option to use ml models in batches, instead of testing one candidate per call to reduce speed up application of ml models
  • Update emcalPhotonMcTask.cxx to incoporate these changes
  • Update histograms that will be stored and filled

… ml models

- Add option to use ml models in batches, instead of testing one candidate per call to reduce speed up application of ml models
- Update `emcalPhotonMcTask.cxx` to incoporate these changes
- Update histograms that will be stored and filled
@github-actions github-actions Bot added pwgem photon Photon and neutral meson PAG label tools labels Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

O2 linter results: ❌ 0 errors, ⚠️ 0 warnings, 🔕 2 disabled

@mhemmer-cern mhemmer-cern changed the title [PWGEM,TOOLS] Update EMCal Conversion ML Model and enable batching of… [PWGEM, Tools] Update EMCal Conversion ML Model and enable batching of… Sep 4, 2026
@mhemmer-cern mhemmer-cern changed the title [PWGEM, Tools] Update EMCal Conversion ML Model and enable batching of… [PWGEM,Tools] Update EMCal Conversion ML Model and enable batching of… Sep 4, 2026
@mhemmer-cern

Copy link
Copy Markdown
Collaborator Author

Hello @fcatalan92 @fmazzasc
While working on some ML model for EMCal cluster, I tried adding the option to use the ml output in batches. Also looking into model.h it looked to me like there is a potential memory issue where a pointer gets created pointing to a local variable inside the function. After return is called the memory for the variable should be freed making the pointer point to garbage.
Could you please have a look into the changes and the comment made by this commit to the ML code?

@fmazzasc

fmazzasc commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Hi @mhemmer-cern , the PR looks good to me and I am approving it for the ML side. @ChSonnabend , could you maybe check the memory issue in model.h? It seems to me that @mhemmer-cern is right

@ChSonnabend

Copy link
Copy Markdown
Contributor

Hi all,
Yes Marvin is right and I discussed already with him privately about the issue. It is not an issue if the output of the model is read directly after execution because the memory is not overwritten. However it is correct that it should be fixed. I wrote this code several years ago but will fix it in the near future. As far as I am aware not many other people are using model.h as it was replaced by MlResponse.h (which I never knew existed so far). I can't give a direct ETA but will try to fix it this week still. Thanks for finding it @mhemmer-cern

@mhemmer-cern
mhemmer-cern enabled auto-merge (squash) September 7, 2026 21:17

@alibuild alibuild left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approving on behalf of @mhemmer-cern.

@mhemmer-cern
mhemmer-cern merged commit 06a9594 into AliceO2Group:master Sep 7, 2026
14 of 15 checks passed
@mhemmer-cern
mhemmer-cern deleted the emcal-ml branch September 7, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

photon Photon and neutral meson PAG label pwgem tools

Development

Successfully merging this pull request may close these issues.

4 participants