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-08 23:05:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 31 errors and 423 warnings.'
Found 31 errors and 423 warnings.
++ [[ 31 -gt 0 ]]
++ cat /sw/BUILD/b088a632e6c8eedd183a55a21a1e8d65ddacd550/O2Physics-code-check/errors.txt
Common/Tools/PID/pidTPCModule.h:188:28: error: 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,-warnings-as-errors]
Common/Tools/PID/pidTPCModule.h:313:45: error: the const qualified parameter 'particle' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param,-warnings-as-errors]
Common/Tools/PID/pidTPCModule.h:817:16: error: variable 'hadronicRate' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
Common/Tools/PID/pidTPCModule.h:818:13: error: variable 'occupancy' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGDQ/Tasks/quarkoniaToHyperons.cxx:101:9: error: function-like macro 'BITSET' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGDQ/Tasks/quarkoniaToHyperons.cxx:102:9: error: function-like macro 'BITCHECK' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGDQ/Tasks/quarkoniaToHyperons.cxx:104:8: error: constructor does not initialize these fields: ccdb, mRunNumber, magField, lut, pdgDB, maskTopological, maskTopoNoV0Radius, maskTopoNoDCANegToPV, maskTopoNoDCAPosToPV, maskTopoNoCosPA, maskTopoNoDCAV0Dau, maskTopoNoDCAV0ToPV, maskTrackProperties, maskK0ShortSpecific, maskLambdaSpecific, maskAntiLambdaSpecific, maskSelectionK0Short, maskSelectionLambda, maskSelectionAntiLambda, secondaryMaskSelectionLambda, secondaryMaskSelectionAntiLambda [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGDQ/Tasks/quarkoniaToHyperons.cxx:324:65: error: 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,-warnings-as-errors]
PWGDQ/Tasks/quarkoniaToHyperons.cxx:1356:64: error: repeated branch body in conditional chain [bugprone-branch-clone,-warnings-as-errors]
PWGHF/TableProducer/candidateSelectorLcPidMl.cxx:89:94: error: 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,-warnings-as-errors]
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]
PWGLF/TableProducer/Strangeness/lambdakzeromlselection.cxx:61:8: error: constructor does not initialize these fields: ccdb [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx:188:9: error: function-like macro 'BITSET' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx:190:8: error: constructor does not initialize these fields: ccdb, mRunNumber [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx:318:50: error: 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,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx:453:67: error: 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,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx:457:63: error: 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,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx:458:71: error: 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,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx:459:63: error: 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,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx:460:63: error: 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,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx:536:10: error: constructor does not initialize these fields: xyz, posP, negP, momentum [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx:555:10: error: constructor does not initialize these fields: label, motherLabel, mcCollision, pdgCode, pdgCodeMother, pdgCodeV0, pdgCodePositive, pdgCodeNegative, pdgCodeBachelor, isPhysicalPrimary, xyz, lxyz, posP, negP, bachP, momentum, mcParticlePositive, mcParticleNegative, mcParticleBachelor [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx:913:7: error: uninitialized record type: 'v0DuplicateInfo' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx:1803:11: error: uninitialized record type: 'positivePositionIU' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx:1804:11: error: uninitialized record type: 'negativePositionIU' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx:2738:7: error: uninitialized record type: 'dcaInfo' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:91:9: error: function-like macro 'BITSET' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:92:9: error: function-like macro 'BITCHECK' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:103:8: error: constructor does not initialize these fields: ccdb [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx:203:67: error: 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,-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]
++ [[ 423 -gt 0 ]]
++ cat /sw/BUILD/b088a632e6c8eedd183a55a21a1e8d65ddacd550/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: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]
[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