Skip to content
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

[Run3 PromptReco] TMVA in BaseMVAValueMapProducer<pat::{Electron,Muon}> uses 11 MB memory per stream #46449

Open
makortel opened this issue Oct 18, 2024 · 10 comments

Comments

@makortel
Copy link
Contributor

From #46040 (comment)

The function reco::details::loadTMVAWeights() uses 11 MB memory per stream (1 thread/stream profile vs 4 thread/stream profile), corresponding to 87 MB in 8-thread PromptReco job.

The function is called by BaseMVAValueMapProducer<pat::Electron> and BaseMVAValueMapProducer<pat::Muon> constructors.

Avoiding the replication would reduce PromptReco memory by 76 MB. I don't know if TMVA is thread safe (i.e. if it could be easily moved to a edm::GlobalCache). If it is not, then probably some other inference engine should be considered.

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 18, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

A new Issue was created by @makortel.

@Dr15Jones, @antoniovilela, @makortel, @mandrenguyen, @rappoccio, @sextonkennedy, @smuzaffar can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@makortel
Copy link
Contributor Author

assign PhysicsTools/PatAlgos

@cmsbuild
Copy link
Contributor

New categories assigned: reconstruction,xpog

@ftorrresd,@hqucms,@jfernan2,@mandrenguyen you have been requested to review this Pull request/Issue and eventually sign? Thanks

@makortel
Copy link
Contributor Author

assign CommonTools/MVAUtils

@makortel
Copy link
Contributor Author

assign ml

@cmsbuild
Copy link
Contributor

New categories assigned: ml

@valsdav,@y19y19 you have been requested to review this Pull request/Issue and eventually sign? Thanks

@makortel
Copy link
Contributor Author

type performance-improvements

@valsdav
Copy link
Contributor

valsdav commented Oct 24, 2024

TMVA::Reader is not thread safe. There is a new interface called RBDT. https://root-forum.cern.ch/t/rdataframe-multithreading-loses-events/49338/9

I can check if we can convert these models without changes.

@makortel
Copy link
Contributor Author

The thread had a further comment https://root-forum.cern.ch/t/rdataframe-multithreading-loses-events/49338/11

Actually looking at the code, I see that there should be a lock guard in the RReader::Compute for protecting multiple model evaluations. I will look into this why it is not thread safe.

Do you know if this was resolved? (we want to avoid locks)

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

No branches or pull requests

3 participants