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

Reimplement the PortableCollection and related tests in CUDA #39319

Merged
merged 5 commits into from
Sep 10, 2022

Conversation

fwyzard
Copy link
Contributor

@fwyzard fwyzard commented Sep 6, 2022

PR description:

To ease the migration from CUDA to Alpaka, reimplement in CUDA the PortableHostCollection and PortableDeviceCollection originally developed for the Alpaka data formats, along with the PortableTestObjects tests.

The CUDA version is in the cms::cuda namespace.

The data format functionality requires extending the cms::cuda::host::make_unique<T> to support pageable (i.e. non-pinned) host memory.

PR validation:

The new unit tests run successfully, both with and without GPUs:

$ cmsRun HeterogeneousCore/CUDATest/python/writer.py 
%MSG-i CUDAService:  (NoModuleName) 06-Sep-2022 17:39:19 CEST pre-events
CUDA runtime version 11.5, driver version 11.6, NVIDIA driver version 510.47.03
CUDA device 0: Tesla T4 (sm_75)
CUDA device 1: Tesla T4 (sm_75)
%MSG
...

$ edmDumpEventContent test.root 
Type                                  Module                 Label     Process    
----------------------------------------------------------------------------------
cms::cuda::PortableHostCollection<portabletest::TestSoALayout<128,false> >    "testProducer"         ""        "Writer"   
cms::cuda::PortableHostCollection<portabletest::TestSoALayout<128,false> >    "testProducerSerial"   ""        "Writer"   

$ CUDA_VISIBLE_DEVICES= cmsRun HeterogeneousCore/CUDATest/python/writer.py 
%MSG-i CUDAService:  (NoModuleName) 06-Sep-2022 17:39:58 CEST pre-events
CUDAService disabled by configuration
%MSG
...

$ edmDumpEventContent test.root 
Type                                  Module                 Label     Process    
----------------------------------------------------------------------------------
cms::cuda::PortableHostCollection<portabletest::TestSoALayout<128,false> >    "testProducer"         ""        "Writer"   
cms::cuda::PortableHostCollection<portabletest::TestSoALayout<128,false> >    "testProducerSerial"   ""        "Writer"   

$ cmsRun HeterogeneousCore/CUDATest/python/reader.py 
06-Sep-2022 17:40:26 CEST  Initiating request to open file file:test.root
06-Sep-2022 17:40:26 CEST  Successfully opened file file:test.root
...

Regarding the changes to the cms::cuda::host::unique_ptr<T>, they were tested also in CMSSW 12.4.8 on a GPU-enabled HLT workflow, to make sure they do not have any negative impact on the performance.

Vanilla CMSSW_12_4_8

Running 4 times over 10300 events with 8 jobs, each with 32 threads, 32 streams and 1 GPUs
   798.2 ±   0.2 ev/s (10000 events, 98.6% overlap)
   797.5 ±   0.2 ev/s (10000 events, 98.8% overlap)
   799.4 ±   0.2 ev/s (10000 events, 99.3% overlap)
   800.3 ±   0.2 ev/s (10000 events, 99.1% overlap)
 --------------------
   798.8 ±   1.3 ev/s

With the equivalent changes as in this PR:

Running 4 times over 10300 events with 8 jobs, each with 32 threads, 32 streams and 1 GPUs
   798.2 ±   0.2 ev/s (10000 events, 99.1% overlap)
   798.4 ±   0.2 ev/s (10000 events, 99.0% overlap)
   798.0 ±   0.2 ev/s (10000 events, 98.7% overlap)
   798.1 ±   0.2 ev/s (10000 events, 99.4% overlap)
 --------------------
   798.2 ±   0.2 ev/s

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:

To be backported to CMSSW 12.5.x for the Alpaka migration.

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 6, 2022

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39319/32015

  • This PR adds an extra 32KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 6, 2022

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

It involves the following packages:

  • CUDADataFormats/Common (heterogeneous)
  • CUDADataFormats/PortableTestObjects (****)
  • DataFormats/Portable (heterogeneous)
  • DataFormats/SoATemplate (heterogeneous)
  • HeterogeneousCore/AlpakaInterface (heterogeneous)
  • HeterogeneousCore/CUDATest (heterogeneous)
  • HeterogeneousCore/CUDAUtilities (heterogeneous)

The following packages do not have a category, yet:

CUDADataFormats/PortableTestObjects
Please create a PR for https://github.com/cms-sw/cms-bot/blob/master/categories_map.py to assign category

@cmsbuild, @makortel, @fwyzard can you please review it and eventually sign? Thanks.
@makortel, @rovere this is something you requested to watch as well.
@perrotta, @dpiparo, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@fwyzard fwyzard force-pushed the cuda_backport_alpaka_tests branch from 30a5539 to c1f6600 Compare September 6, 2022 16:00
@fwyzard fwyzard changed the title Reimplement the Alpaka PortableCollection and related tests in CUDA Reimplement the PortableCollection and related tests in CUDA Sep 6, 2022
@fwyzard
Copy link
Contributor Author

fwyzard commented Sep 6, 2022

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 6, 2022

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39319/32016

  • This PR adds an extra 32KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 6, 2022

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

@fwyzard fwyzard force-pushed the cuda_backport_alpaka_tests branch from c9a50cb to d2e962a Compare September 7, 2022 22:36
@fwyzard
Copy link
Contributor Author

fwyzard commented Sep 7, 2022

please test

@fwyzard
Copy link
Contributor Author

fwyzard commented Sep 7, 2022

+heterogeneous

I think this addresses all the comments.

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 7, 2022

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39319/32046

  • This PR adds an extra 36KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 7, 2022

Pull request #39319 was updated. can you please check and sign again.

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 8, 2022

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-58fd38/27419/summary.html
COMMIT: d2e962a
CMSSW: CMSSW_12_6_X_2022-09-07-1100/el8_amd64_gcc10
Additional Tests: GPU
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/39319/27419/install.sh to create a dev area with all the needed externals and cmssw changes.

GPU Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • Reco comparison had 3 failed jobs
  • DQMHistoTests: Total files compared: 4
  • DQMHistoTests: Total histograms compared: 19876
  • DQMHistoTests: Total failures: 74
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 19802
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 3 files compared)
  • Checked 12 log files, 9 edm output root files, 4 DQM output files
  • TriggerResults: no differences found

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 51
  • DQMHistoTests: Total histograms compared: 3618326
  • DQMHistoTests: Total failures: 5
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3618299
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 50 files compared)
  • Checked 212 log files, 49 edm output root files, 51 DQM output files
  • TriggerResults: no differences found

@rappoccio
Copy link
Contributor

Going to hold off on this until Monday/Tuesday, the IBs have settled down but I think it's wise to only merge simple things for a few days.

@fwyzard
Copy link
Contributor Author

fwyzard commented Sep 9, 2022 via email

@perrotta
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit fecc86f into cms-sw:master Sep 10, 2022
@fwyzard
Copy link
Contributor Author

fwyzard commented Sep 10, 2022

Thanks 👍🏼

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.

6 participants