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

NVProfilerService: improve the handling of modules and events #25749

Merged

Conversation

fwyzard
Copy link
Contributor

@fwyzard fwyzard commented Jan 23, 2019

Take into account the proper number of modules: increment by one pathsAndConsumes.allModules().size(), because it does not include the source module.

Add asserts to check that all ranges are properly closed.

Optionally, delay starting the profiler until after the first event on each stream has completed.
This requires running nvprof with the --profile-from-start off option.

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@fwyzard
Copy link
Contributor Author

fwyzard commented Jan 23, 2019

@cmsbuild, please test

@fwyzard
Copy link
Contributor Author

fwyzard commented Jan 23, 2019

@makortel FYI

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-25749/8147

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 23, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/32796/console Started: 2019/01/23 16:27
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/32797/console Started: 2019/01/23 16:35

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @fwyzard (Andrea Bocci) for master.

It involves the following packages:

HeterogeneousCore/CUDAServices

@cmsbuild, @smuzaffar, @Dr15Jones can you please review it and eventually sign? Thanks.
@makortel this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@Dr15Jones
Copy link
Contributor

@makortel please review

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-25749/32797/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 14 differences found in the comparisons
  • DQMHistoTests: Total files compared: 32
  • DQMHistoTests: Total histograms compared: 3097440
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3097242
  • DQMHistoTests: Total skipped: 197
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 31 files compared)
  • Checked 133 log files, 14 edm output root files, 32 DQM output files

// there is a possible race condition among different threads processing different events;
// however, cudaProfilerStart() is supposed to be thread-safe and ignore multiple calls, so this should not be an issue.
if (std::all_of(streamFirstEventDone_.begin(), streamFirstEventDone_.end(), [](bool x){ return x; })) {
globalFirstEventDone_ = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

We discussed a bit with @Dr15Jones, and we think that streamFirstEventDone_ and globalFirstEventDone_ should be changed to use std::atomic<bool>. Especially the vector<bool> is dangerous because it is internally a bit pattern, so setting one bit in current thread may invalidate an operation on a different bit on a same word in another thread.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@makortel @Dr15Jones thanks for the suggestion.
Do the changes to the member variables (lines 296-297 ) and to the initialisation (lines 541-543) look correct ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good to me, thanks. You could also use globalFirstEventDone_.compare_exchange_strong() here to call cudaProfilerStart() exactly once (that would also allow to remove the comments above).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion.
I have also changed a bit the way in which I initialise the vector, as this "feels" better - though I expect the end result to be the same.

@makortel
Copy link
Contributor

@fwyzard Could you add "in NVProfilerService" to the end of the PR title?

@fwyzard fwyzard changed the title Improve the handling of modules and events NVProfilerService: improve the handling of modules and events Jan 23, 2019
@fwyzard fwyzard force-pushed the patatrack_backpport_NVProfilerService branch from ef2f6cc to 341da25 Compare January 23, 2019 22:45
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-25749/8160

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

Pull request #25749 was updated. @cmsbuild, @smuzaffar, @Dr15Jones can you please check and sign again.

@fwyzard
Copy link
Contributor Author

fwyzard commented Jan 24, 2019

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 24, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/32810/console Started: 2019/01/24 08:11

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-25749/32810/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 32
  • DQMHistoTests: Total histograms compared: 3097440
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3097242
  • DQMHistoTests: Total skipped: 197
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 31 files compared)
  • Checked 133 log files, 14 edm output root files, 32 DQM output files

@makortel
Copy link
Contributor

+1
@Dr15Jones

@Dr15Jones
Copy link
Contributor

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2)

@fwyzard
Copy link
Contributor Author

fwyzard commented Jan 24, 2019

@fabiocos if 10.5.0-pre1 is not tagged yet, could you include this ?
I would like to use it to exercise the re-synchronisation of the Patatrack branch after a partial backport.

@fabiocos
Copy link
Contributor

+1

@fwyzard so you may use pre1 as a new base for further integration

@cmsbuild cmsbuild merged commit d08ae78 into cms-sw:master Jan 25, 2019
@fwyzard
Copy link
Contributor Author

fwyzard commented Jan 25, 2019

thank you

@fwyzard fwyzard deleted the patatrack_backpport_NVProfilerService branch January 26, 2019 07:44
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