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

Trim FastjetJetProducer memory #9203

Merged

Conversation

mark-grimes
Copy link

FastjetJetProducer keeps a chunk of memory between events unnecessarily. With the 24 instances in the standard sequence this amounts to more than 70 Mb at 200 pileup.
Here is the retained memory, excluding produced collection sizes, summed over all instances of the class at 200 pileup:
fastjet_before

Here is the same thing after applying this pull request:
fastjet_after

Swapping out the work vectors with empty vectors saves about 10 Mb of that 70. The remainder is from deleting the fjClusterSeq_ object in between events (it's created new each event anyway).

@lgray

@mark-grimes
Copy link
Author

please test

@cmsbuild cmsbuild added this to the Next CMSSW_6_2_X_SLHC milestone May 21, 2015
@cmsbuild
Copy link
Contributor

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @mark-grimes (Mark Grimes) for CMSSW_6_2_X_SLHC.

Trim FastjetJetProducer memory

It involves the following packages:

RecoJets/JetProducers

@cmsbuild, @cvuosalo, @nclopezo, @slava77 can you please review it and eventually sign? Thanks.
@rappoccio, @jdolen, @ahinzmann, @TaiSakuma, @yslai, @nhanvtran, @schoef, @mariadalfonso this is something you requested to watch as well.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
If you are a L2 or a release manager you can ask for tests by saying 'please test' in the first line of a comment.
@fratnikov, @mark-grimes you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@lgray
Copy link
Contributor

lgray commented May 21, 2015

nice!

On Thu, May 21, 2015 at 3:24 PM, Mark Grimes notifications@github.com
wrote:

FastjetJetProducer keeps a chunk of memory between events unnecessarily.
With the 24 instances in the standard sequence this amounts to more than 70
Mb at 200 pileup.
Here is the retained memory, excluding produced collection sizes, summed
over all instances of the class at 200 pileup:
[image: fastjet_before]
https://cloud.githubusercontent.com/assets/6480160/7749331/9f302cae-ffc4-11e4-8707-1f0e68eaaf3c.png

Here is the same thing after applying this pull request:
[image: fastjet_after]
https://cloud.githubusercontent.com/assets/6480160/7749346/bc0104c0-ffc4-11e4-8e70-d5af24658b99.png

Swapping out the work vectors with empty vectors saves about 10 Mb of that
70. The remainder is from deleting the fjClusterSeq_ object in between
events (it's created new each event anyway).

@lgray https://github.com/lgray

You can view, comment on, or merge this pull request online at:

#9203
Commit Summary

  • Swap the work vectors out to empty temps to free up memory between
    events
  • Free the Fastjet ClusterSequence between events to save memory

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#9203.

@rappoccio
Copy link
Contributor

This looks good, could we forward-port this also to the other active branches?

@mark-grimes
Copy link
Author

@rappoccio, sure although I assume the gains scale with pileup, so the difference won't be as impressive as here. Just 75X or do you want any other branches?

@rappoccio
Copy link
Contributor

@mark-grimes We can only do 75x at this point, I think. Thanks a lot for the nice catch!

@cmsbuild
Copy link
Contributor

@lgray
Copy link
Contributor

lgray commented May 21, 2015

@rappoccio @mark-grimes 75X and 74X are open for fixes like this, I am pretty sure.

@slava77 comment?

@lgray
Copy link
Contributor

lgray commented May 21, 2015

@mark-grimes Also, I have looked at the EGAlgo, looks pretty straightforward too. I'll send you a PR soon.

@lgray
Copy link
Contributor

lgray commented May 21, 2015

@mark-grimes Just sent you a PR to this PR.

@lgray
Copy link
Contributor

lgray commented May 21, 2015

@mark-grimes looking at PFClusterProducer now. Can you post a break down per module instance of the non-product retained memory?

@mark-grimes
Copy link
Author

@rappoccio, 75X PR is #9206. Let me know if you want a 74X port as well.

@lgray, that's the lower plot on #9194 (comment), i.e. https://cloud.githubusercontent.com/assets/6480160/7744379/9f720c02-ff9a-11e4-8be5-c9b43ccebc87.png. Oddly everything other than the HGCal instances has next to zero, which is a much bigger difference than I'd expect from the increased collection size (the plot doesn't include product size but work vectors usually scale with collection size). Maybe it is the topology, although I'd expect that not to fluctuate event to event.

@lgray
Copy link
Contributor

lgray commented May 21, 2015

HGCClusterizer doesn't use the topology, so the answer is somewhere a bit
deeper.
Anyway, I am filling up the PR to this PR with cache wipes.
Hold a moment before merging. I'll post when ready.

-L

On Thu, May 21, 2015 at 5:07 PM, Mark Grimes notifications@github.com
wrote:

@rappoccio https://github.com/rappoccio, 75X PR is #9206
#9206. Let me know if you want a
74X port as well.

@lgray https://github.com/lgray, that's the lower plot on #9194
(comment)
#9194 (comment), i.e.
https://cloud.githubusercontent.com/assets/6480160/7744379/9f720c02-ff9a-11e4-8be5-c9b43ccebc87.png.
Oddly everything other than the HGCal instances has next to zero, which is
a much bigger difference than I'd expect from the increased collection size
(the plot doesn't include product size but work vectors usually scale with
collection size). Maybe it is the topology, although I'd expect that not to
fluctuate event to event.


Reply to this email directly or view it on GitHub
#9203 (comment).

@slava77
Copy link
Contributor

slava77 commented May 21, 2015

74X life time is expected to be short.
If it's not much effort, please make a PR there as well.

On 5/21/15 10:07 AM, Mark Grimes wrote:

@rappoccio https://github.com/rappoccio, 75X PR is #9206
#9206. Let me know if you want a
74X port as well.

@lgray https://github.com/lgray, that's the lower plot on #9194
(comment)
#9194 (comment), i.e.
https://cloud.githubusercontent.com/assets/6480160/7744379/9f720c02-ff9a-11e4-8be5-c9b43ccebc87.png.
Oddly everything other than the HGCal instances has next to zero, which
is a much bigger difference than I'd expect from the increased
collection size (the plot doesn't include product size but work vectors
usually scale with collection size). Maybe it is the topology, although
I'd expect that not to fluctuate event to event.


Reply to this email directly or view it on GitHub
#9203 (comment).

@lgray
Copy link
Contributor

lgray commented May 21, 2015

@mark-grimes Whenever you are ready please go ahead and merge mark-grimes#1 !

@mark-grimes
Copy link
Author

merge

cmsbuild added a commit that referenced this pull request May 22, 2015
@cmsbuild cmsbuild merged commit d369e90 into cms-sw:CMSSW_6_2_X_SLHC May 22, 2015
@mark-grimes mark-grimes deleted the trimFastjetProducerMemory branch May 22, 2015 11:27
cmsbuild added a commit that referenced this pull request May 24, 2015
Trim FastjetJetProducer memory (forward port #9203)
cmsbuild added a commit that referenced this pull request Jun 10, 2015
Trim FastjetJetProducer memory (forward port #9203 to 74X)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants