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

ECAL - Make EcalConstants constexpr arrays compatible with CUDA code #37161

Merged
merged 1 commit into from
Mar 13, 2022

Conversation

thomreis
Copy link
Contributor

@thomreis thomreis commented Mar 7, 2022

PR description:

The constexpr arrays defined in EcalConstants.h can not be used in CUDA kernels because they are no scalar types. With the HOST_DEVICE_CONSTANT defined in #37159 it is possible to define the arrays in device memory and use the values.

However, using HOST_DEVICE_CONSTANT is not possible if the arrays are members of a class and so they are moved to namespaces and constant pointers to the arrays are used in the classes (#36311 (comment)).

This PR builds on PR #37159

PR validation:

Compiles and passes 11634.512 on a CPU-only machine and on an GPU equipped machine.

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 7, 2022

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37161/28721

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 7, 2022

A new Pull Request was created by @thomreis (Thomas Reis) for master.

It involves the following packages:

  • DataFormats/EcalDigi (simulation)
  • HeterogeneousCore/CUDAUtilities (heterogeneous)

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

cms-bot commands are listed here

@@ -3,6 +3,7 @@
<use name="DataFormats/DetId"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/Utilities"/>
<use name="HeterogeneousCore/CUDAUtilities"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately DataFormats package depending on HeterogeneousCore is not allowed (in order to avoid dependence on CUDA in persistent data formats).

The header HostDeviceConstant.h itself depends on CUDA only "weakly" though (it only uses macros that are defined by CUDA-capable compiler and as such it does not require CUDA by itself). Maybe that header should be placed somewhere in DataFormats instead? (assuming EcalConstants.h can not be moved to non-dataformat package)

Copy link
Contributor

Choose a reason for hiding this comment

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

What about moving it to FWCore/Utilities, like FWCore/Utilities/interface/CMSUnrollLoop.h ?

Copy link
Contributor

Choose a reason for hiding this comment

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

That would work too.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, I've updated #37159 accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have updated this one as well.

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 8, 2022

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37161/28734

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 8, 2022

Pull request #37161 was updated. @smuzaffar, @civanch, @Dr15Jones, @makortel, @mdhildreth, @cmsbuild can you please check and sign again.

@fwyzard
Copy link
Contributor

fwyzard commented Mar 8, 2022

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 8, 2022

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b0ee52/22930/summary.html
COMMIT: c3d3e02
CMSSW: CMSSW_12_3_X_2022-03-07-2300/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/37161/22930/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 7 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3985378
  • DQMHistoTests: Total failures: 12
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3985344
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 204 log files, 45 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

@civanch
Copy link
Contributor

civanch commented Mar 8, 2022

+1

@perrotta
Copy link
Contributor

perrotta commented Mar 9, 2022

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 9, 2022

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b0ee52/22986/summary.html
COMMIT: a154f9e
CMSSW: CMSSW_12_3_X_2022-03-09-1100/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/37161/22986/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 2 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3703700
  • DQMHistoTests: Total failures: 11
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3703666
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.004 KiB( 48 files compared)
  • DQMHistoSizes: changed ( 312.0 ): 0.004 KiB MessageLogger/Warnings
  • Checked 204 log files, 45 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

@thomreis
Copy link
Contributor Author

Hi @cms-sw/simulation-l2 can you please sign this again?

@civanch
Copy link
Contributor

civanch commented Mar 10, 2022

+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. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@smuzaffar
Copy link
Contributor

@civanch , do you understand why we now see random differences relval comparisons for Generator e.g in #37161 (comment) ( the the details at https://cmssdt.cern.ch/SDT/jenkins-artifacts/baseLineComparisons/CMSSW_12_3_X_2022-03-09-1100+b0ee52/48838/validateJR.html ) .

@perrotta
Copy link
Contributor

@civanch , do you understand why we now see random differences relval comparisons for Generator e.g in #37161 (comment) ( the the details at https://cmssdt.cern.ch/SDT/jenkins-artifacts/baseLineComparisons/CMSSW_12_3_X_2022-03-09-1100+b0ee52/48838/validateJR.html ) .

@smuzaffar the idea is that those random differences should disappear after the merging of #37185, since CMSSW_12_3_X_2022-03-10-1100

Since that IB should be already available for the tests, we can relaunch them to verify if it is actually the case

@perrotta
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b0ee52/23020/summary.html
COMMIT: a154f9e
CMSSW: CMSSW_12_3_X_2022-03-10-1100/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/37161/23020/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3695161
  • DQMHistoTests: Total failures: 14
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3695125
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 204 log files, 45 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

@perrotta
Copy link
Contributor

Random differences in the generator weights have disappeared now, after the merging in the IB of #37185

@smuzaffar smuzaffar modified the milestones: CMSSW_12_3_X, CMSSW_12_4_X Mar 11, 2022
@qliphy
Copy link
Contributor

qliphy commented Mar 13, 2022

+1

@cmsbuild cmsbuild merged commit baa7e7b into cms-sw:master Mar 13, 2022
@thomreis thomreis deleted the ecal-constants-for-gpu-code branch March 13, 2022 13:41
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.

8 participants