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

Try converting RecoParticleFlow/PFTracking to GBRForest + GlobalCache #10143

Merged
merged 7 commits into from Jul 25, 2015

Conversation

lgray
Copy link
Contributor

@lgray lgray commented Jul 11, 2015

Since things look OK on the surface from the DQM plots in #10142, I went ahead and moved all the GBRForest objects into edm::GlobalCaches since the BDTs are always read from the same files and don't depend on run. This should bring some memory usage improvements in multicore jobs.

Trial of converting a package that used TMVA::Reader to GBRForest + use edm::GlobalCache.
Underlying regression weights were gradient boosted, despite method name (read from xml).

At most, some jitter may be expected, otherwise expect no physics impact.
Also expect some reduction in RSS.

@bendavid

@Dr15Jones You might be interested in this too if you want to look for thread safety issues. FYI GBRForest is threadsafe.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @lgray (Lindsey Gray) for CMSSW_7_6_X.

Try converting RecoParticleFlow/PFTracking to GBRForest + GlobalCache

It involves the following packages:

RecoParticleFlow/PFTracking

@cmsbuild, @cvuosalo, @slava77 can you please review it and eventually sign? Thanks.
@mmarionncern, @bachtis 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.
@Degano you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

std::unique_ptr<GBRForest> gbrEndcapsLowPt_;
std::unique_ptr<GBRForest> gbrEndcapsHighPt_;
std::unique_ptr<PFEnergyCalibration> pfcalib_;
private:
Copy link
Contributor

Choose a reason for hiding this comment

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

I would feel a lot more confident about the thread safety if these were all std::unique_ptr<const ...>.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've decided this should be a stronger statement and these need to be std::unique_ptr<const ...>.

@lgray
Copy link
Contributor Author

lgray commented Jul 11, 2015

@Dr15Jones I have addressed your issues! Please have another look.


static std::unique_ptr<convbremhelpers::HeavyObjectCache>
initializeGlobalCache( const edm::ParameterSet& conf ) {
return std::unique_ptr<convbremhelpers::HeavyObjectCache>(new convbremhelpers::HeavyObjectCache(conf));
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a nice way to actually make this shorter (for your future reference)
return std::make_unique<convbremhelpers::HeavyObjectCache>(conf);

it is a C++14 thing.

@cmsbuild
Copy link
Contributor

Pull request #10143 was updated. @cmsbuild, @cvuosalo, @slava77 can you please check and sign again.

@@ -147,6 +171,7 @@ class GoodSeedProducer final : public edm::stream::EDProducer<> {

///READER FOR TMVA
std::array<std::unique_ptr<TMVA::Reader>,9> reader{};
std::array<std::unique_ptr<GBRForest>,9> gbr;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want these 9s to be goodseedhelpers::HeavyObjectCache::kMaxWeights or is it just a coincidence?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deprecated code needs to be removed.
Since this is a test PR, I'll clean it up later.

-L

(Sent from my Nexus 6)
On Jul 11, 2015 3:02 PM, "Chris Jones" notifications@github.com wrote:

In RecoParticleFlow/PFTracking/plugins/GoodSeedProducer.h
#10143 (comment):

@@ -147,6 +171,7 @@ class GoodSeedProducer final : public edm::stream::EDProducer<> {

   ///READER FOR TMVA
   std::array<std::unique_ptr<TMVA::Reader>,9> reader{};
  •  std::arraystd::unique_ptr<GBRForest,9> gbr;
    

Do you want these 9s to be goodseedhelpers::HeavyObjectCache::kMaxWeights
or is it just a coincidence?


Reply to this email directly or view it on GitHub
https://github.com/cms-sw/cmssw/pull/10143/files#r34412459.

@Dr15Jones
Copy link
Contributor

As long as GBRForest really is const thread-safe, this looks fine to me.

@lgray
Copy link
Contributor Author

lgray commented Jul 11, 2015

Could you issue a test in Jenkins?
(I cannot)

(Sent from my Nexus 6)
On Jul 11, 2015 3:05 PM, "Chris Jones" notifications@github.com wrote:

As long as GBRForest really is const thread-safe, this looks fine to me.


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

@Dr15Jones
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

The tests are being triggered in jenkins.

@cvuosalo
Copy link
Contributor

+1

For #10143 29c1782

Putting GBRForest objects into edm::GlobalCaches to reduce memory usage for multi-threaded jobs. There should be no significant changes in monitored quantities.

The code changes are satisfactory, and Jenkins tests against baseline CMSSW_7_6_X_2015-07-22-2300 show no significant differences, as expected. Extended tests with 70 or 100 events of workflow 25202.0_TTbar_13 against baseline CMSSW_7_6_X_2015-07-21-1100 also show no significant differences other than minor jitter that is expected. Comparisons were done for single-threaded RECO, multi-threaded RECO (4 threads), and comparing the single- vs. multi-threaded PR.
Memory usage was also measured as discussed above and the PR achieves its intended memory reduction.

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_6_X IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @Degano, @smuzaffar

@lgray
Copy link
Contributor Author

lgray commented Jul 24, 2015

@cvuosalo @slava77 I'll now prepare backports. Thanks a lot!

@davidlange6
Copy link
Contributor

+1

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

7 participants