Skip to content

[Infrastructure,Tools,Common,Tutorial,PWGDQ,PWGHF,PWGLF] [WIP] [ML] Fix for memory issue in ML headers - #17836

Open
ChSonnabend wants to merge 3 commits into
AliceO2Group:masterfrom
ChSonnabend:mlfix
Open

[Infrastructure,Tools,Common,Tutorial,PWGDQ,PWGHF,PWGLF] [WIP] [ML] Fix for memory issue in ML headers#17836
ChSonnabend wants to merge 3 commits into
AliceO2Group:masterfrom
ChSonnabend:mlfix

Conversation

@ChSonnabend

Copy link
Copy Markdown
Contributor

This PR fixes the dangling float* pointers and replaces it with a std::vector allocation.

@ChSonnabend ChSonnabend changed the title [ML] Fix for memory issue in ML headers [WIP] [ML] Fix for memory issue in ML headers Sep 8, 2026
@github-actions github-actions Bot changed the title [WIP] [ML] Fix for memory issue in ML headers [Infrastructure,Tools,Common,Tutorial,PWGDQ,PWGHF,PWGLF] [ML] Fix for memory issue in ML headers Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

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

@github-actions github-actions Bot changed the title [Infrastructure,Tools,Common,Tutorial,PWGDQ,PWGHF,PWGLF] [ML] Fix for memory issue in ML headers [Infrastructure,Tools,Common,Tutorial,PWGDQ,PWGHF,PWGLF] [WIP] [ML] Fix for memory issue in ML headers Sep 8, 2026
@ChSonnabend

ChSonnabend commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

This still needs to be tested but should fix a memory issue spotted by @mhemmer-cern and discussed with @fmazzasc
Please do not merge yet.

@alibuild

alibuild commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for be8a4a7 at 2026-09-08 20:34:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/Tools/ML/MlResponse.h:232:85: error: cannot convert 'std::vector<float>' to 'float*' in initialization
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

alibuild commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for be8a4a7 at 2026-09-08 20:45:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/Tools/ML/MlResponse.h:232:85: error: cannot convert 'std::vector<float>' to 'float*' in initialization
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

alibuild commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for be8a4a7 at 2026-09-08 21:04:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/Tools/ML/MlResponse.h:232:85: error: cannot convert 'std::vector<float>' to 'float*' in initialization
ninja: build stopped: subcommand failed.

Full log here.

romainschotter
romainschotter previously approved these changes Sep 8, 2026
@alibuild

alibuild commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for a31fa89 at 2026-09-10 03:14:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 2 errors and 451 warnings.'
Found 2 errors and 451 warnings.
++ [[ 2 -gt 0 ]]
++ cat /sw/BUILD/31717eb1e0eea9db0ad347699593ecbfc376bc18/O2Physics-code-check/errors.txt
PWGHF/TableProducer/candidateSelectorLcPidMl.cxx:154:11: error: 'emplace_back' is called inside a loop; consider pre-allocating the container capacity before the loop [performance-inefficient-vector-operation,-warnings-as-errors]
Tools/ML/model.h:25:1: error: included header onnxruntime_c_api.h is not used directly [misc-include-cleaner,-warnings-as-errors]
++ [[ 451 -gt 0 ]]
++ cat /sw/BUILD/31717eb1e0eea9db0ad347699593ecbfc376bc18/O2Physics-code-check/warnings.txt
Common/Tools/PID/pidTPCModule.h:60:10: warning: inclusion of deprecated C++ header 'math.h'; consider using 'cmath' instead [modernize-deprecated-headers]
Common/Tools/PID/pidTPCModule.h:62:1: warning: nested namespaces can be concatenated [modernize-concat-nested-namespaces]
Common/Tools/PID/pidTPCModule.h:101:82: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
Common/Tools/PID/pidTPCModule.h:102:76: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
Common/Tools/PID/pidTPCModule.h:107:94: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
Common/Tools/PID/pidTPCModule.h:179:5: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
Common/Tools/PID/pidTPCModule.h:188:28: warning: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay]
Common/Tools/PID/pidTPCModule.h:225:15: warning: redundant string initialization [readability-redundant-string-init]
Common/Tools/PID/pidTPCModule.h:271:13: warning: do not use 'compare' to test equality of strings; use the string equality operator instead [readability-string-compare]
Common/Tools/PID/pidTPCModule.h:275:17: warning: do not use 'compare' to test equality of strings; use the string equality operator instead [readability-string-compare]
Common/Tools/PID/pidTPCModule.h:288:15: warning: do not use 'compare' to test equality of strings; use the string equality operator instead [readability-string-compare]
Common/Tools/PID/pidTPCModule.h:351:9: warning: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty]
Common/Tools/PID/pidTPCModule.h:409:7: warning: do not use 'else' after 'return' [readability-else-after-return]
Common/Tools/PID/pidTPCModule.h:418:191: warning: use nullptr [modernize-use-nullptr]
Common/Tools/PID/pidTPCModule.h:418:241: warning: use nullptr [modernize-use-nullptr]
Common/Tools/PID/pidTPCModule.h:427:15: warning: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty]
Common/Tools/PID/pidTPCModule.h:457:13: warning: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty]
Common/Tools/PID/pidTPCModule.h:493:189: warning: use nullptr [modernize-use-nullptr]
Common/Tools/PID/pidTPCModule.h:493:239: warning: use nullptr [modernize-use-nullptr]
Common/Tools/PID/pidTPCModule.h:524:11: warning: do not use 'compare' to test equality of strings; use the string equality operator instead [readability-string-compare]
Common/Tools/PID/pidTPCModule.h:532:9: warning: do not use 'compare' to test equality of strings; use the string equality operator instead [readability-string-compare]
Common/Tools/PID/pidTPCModule.h:634:20: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:636:20: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:642:22: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:644:22: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:652:20: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:654:20: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:686:18: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:688:18: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:779:13: warning: do not use 'compare' to test equality of strings; use the string equality operator instead [readability-string-compare]
Common/Tools/PID/pidTPCModule.h:787:11: warning: do not use 'compare' to test equality of strings; use the string equality operator instead [readability-string-compare]
Common/Tools/PID/pidTPCModule.h:817:16: warning: variable 'hadronicRate' is not initialized [cppcoreguidelines-init-variables]
Common/Tools/PID/pidTPCModule.h:818:13: warning: variable 'occupancy' is not initialized [cppcoreguidelines-init-variables]
Common/Tools/PID/pidTPCModule.h:838:39: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:840:31: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:849:38: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:851:43: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:863:39: warning: statement should be inside braces [readability-braces-around-statements]
[0 more errors; see full log]

Full log here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants