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

Introduce edm::Async service, and use it in CUDA and Alpaka modules #44901

Merged
merged 8 commits into from
Jun 6, 2024

Conversation

makortel
Copy link
Contributor

@makortel makortel commented May 3, 2024

PR description:

This PR adds edm::async() facility described in #29188, but implemented as a edm::Async service base class and AsyncService implementation (rationale for service-based approach instead of a free function can be found from #44901 (comment)). This PR also replaces the use of cudaStreamAddCallback() with edm::async() accompanied with cudaEventSynchronize(), and makes the CUDA/Alpaka events to be created with cudaEventBlockingSync flag.

Measurements that I showed in CHEP 2023 https://indico.jlab.org/event/459/contributions/11810/ suggested possible 1 % throughput improvement at the HLT (of that time, many things have changed since) over cudaStreamAddCallback(). Earlier studies done with a prototype in cms-patatrack/pixeltrack-standalone#321 that somehow the thread pool with cudaEventSynchronize() used less CPU than cudaStreamAddCallback().

During the CHEP study I also tested polling with cudaEventQuery(), but the "waiting thread pool" approach was more performant.

Another benefit over cudaStreamAddCallback() is that that function "is slated for eventual deprecation and removal", and the "replacement" cudaLaunchHostFunc() does not call the callback function in case of an error in the associated CUDA stream.

Resolves #29188
Resolves cms-sw/framework-team#916

PR validation:

Unit tests in FWCore/Concurrency, HeterogeneousCore/Alpaka{Core,Test}, HeterogeneousCore/CUDA{Utilities,Core,Test} succeed.

The deployment on CUDA and Alpaka modules still needs performance testing

If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:

Possibly to be backported to 14_0_X.

@cmsbuild
Copy link
Contributor

cmsbuild commented May 3, 2024

cms-bot internal usage

@makortel makortel mentioned this pull request May 3, 2024
@cmsbuild
Copy link
Contributor

cmsbuild commented May 3, 2024

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-44901/40168

  • This PR adds an extra 28KB to repository

  • There are other open Pull requests which might conflict with changes you have proposed:

@cmsbuild
Copy link
Contributor

cmsbuild commented May 3, 2024

A new Pull Request was created by @makortel for master.

It involves the following packages:

  • FWCore/Concurrency (core)
  • HeterogeneousCore/AlpakaCore (heterogeneous)
  • HeterogeneousCore/CUDACore (heterogeneous)
  • HeterogeneousCore/CUDAUtilities (heterogeneous)

@cmsbuild, @makortel, @Dr15Jones, @smuzaffar, @fwyzard can you please review it and eventually sign? Thanks.
@missirol, @wddgit, @rovere this is something you requested to watch as well.
@antoniovilela, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@makortel
Copy link
Contributor Author

makortel commented May 3, 2024

enable gpu

@makortel
Copy link
Contributor Author

makortel commented May 3, 2024

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented May 3, 2024

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d3cb6f/39230/summary.html
COMMIT: b758c10
CMSSW: CMSSW_14_1_X_2024-05-03-1100/el8_amd64_gcc12
Additional Tests: GPU
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/44901/39230/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 4 lines from the logs
  • Reco comparison results: 6 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3331548
  • DQMHistoTests: Total failures: 6
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3331522
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 202 log files, 165 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

GPU Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 3
  • DQMHistoTests: Total histograms compared: 39740
  • DQMHistoTests: Total failures: 18
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 39722
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 2 files compared)
  • Checked 8 log files, 10 edm output root files, 3 DQM output files
  • TriggerResults: no differences found

@cmsbuild
Copy link
Contributor

cmsbuild commented May 6, 2024

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-44901/40191

  • This PR adds an extra 20KB to repository

  • There are other open Pull requests which might conflict with changes you have proposed:

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 4, 2024

Pull request #44901 was updated. @fwyzard, @Dr15Jones, @makortel, @smuzaffar can you please check and sign again.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 5, 2024

-1

Failed Tests: UnitTests
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d3cb6f/39706/summary.html
COMMIT: ace8492
CMSSW: CMSSW_14_1_X_2024-06-04-2300/el8_amd64_gcc12
Additional Tests: GPU
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/44901/39706/install.sh to create a dev area with all the needed externals and cmssw changes.

Unit Tests

I found 1 errors in the following unit tests:

---> test RecoPPSLocalNewT2 had ERRORS

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 11 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3338862
  • DQMHistoTests: Total failures: 9
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3338833
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 202 log files, 165 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

GPU Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 3
  • DQMHistoTests: Total histograms compared: 39740
  • DQMHistoTests: Total failures: 22
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 39718
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 2 files compared)
  • Checked 8 log files, 10 edm output root files, 3 DQM output files
  • TriggerResults: no differences found

@makortel
Copy link
Contributor Author

makortel commented Jun 5, 2024

Unit test fails in IBs #45101

@makortel
Copy link
Contributor Author

makortel commented Jun 5, 2024

+core

@makortel
Copy link
Contributor Author

makortel commented Jun 5, 2024

+heterogeneous

Based on earlier #44901 (comment), and that on heterogeneous side there were no substantial changes.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 5, 2024

This pull request is fully signed and it will be integrated in one of the next master IBs (but tests are reportedly failing). This pull request will now be reviewed by the release team before it's merged. @antoniovilela, @sextonkennedy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@makortel
Copy link
Contributor Author

makortel commented Jun 5, 2024

ignore tests-rejected with ib-failure

@rappoccio
Copy link
Contributor

+1

@rappoccio
Copy link
Contributor

merge

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.

Open a PR and address review comments Consider edm::async()
5 participants