cmssw icon indicating copy to clipboard operation
cmssw copied to clipboard

std math functions replaced with alpaka versions

Open alexstrel opened this issue 6 months ago • 4 comments

PR description:

This pull request replaces the standard library functions in the Alpaka interface with their Alpaka-equivalent implementations. The changes primarily affect the workdivision.h header file, aligning the interface more closely with Alpaka cross-platform design.

alexstrel avatar Jun 20 '25 19:06 alexstrel

cms-bot internal usage

cmsbuild avatar Jun 20 '25 19:06 cmsbuild

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45268

  • There are other open Pull requests which might conflict with changes you have proposed:
    • File HeterogeneousCore/AlpakaInterface/interface/prefixScan.h modified in PR(s): #47611

Code check has found code style and quality issues which could be resolved by applying following patch(s)

  • code-format: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45268/code-format.patch e.g. curl -k https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45268/code-format.patch | patch -p1 You can also run scram build code-format to apply code format directly

cmsbuild avatar Jun 20 '25 19:06 cmsbuild

alpaka::math::min and the other alpaka math functions take an acc as first argument.

fwyzard avatar Jun 21 '25 21:06 fwyzard

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45283

  • There are other open Pull requests which might conflict with changes you have proposed:
    • File HeterogeneousCore/AlpakaInterface/interface/prefixScan.h modified in PR(s): #47611
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h modified in PR(s): #48377
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h modified in PR(s): #48377

Code check has found code style and quality issues which could be resolved by applying following patch(s)

  • code-format: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45283/code-format.patch e.g. curl -k https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45283/code-format.patch | patch -p1 You can also run scram build code-format to apply code format directly

cmsbuild avatar Jun 23 '25 16:06 cmsbuild

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45500

  • There are other open Pull requests which might conflict with changes you have proposed:
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h modified in PR(s): #48377
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h modified in PR(s): #48377

Code check has found code style and quality issues which could be resolved by applying following patch(s)

  • code-format: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45500/code-format.patch e.g. curl -k https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45500/code-format.patch | patch -p1 You can also run scram build code-format to apply code format directly

cmsbuild avatar Jul 14 '25 17:07 cmsbuild

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45555

  • There are other open Pull requests which might conflict with changes you have proposed:
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h modified in PR(s): #48377
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h modified in PR(s): #48377

cmsbuild avatar Jul 21 '25 15:07 cmsbuild

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

It involves the following packages:

  • HeterogeneousCore/AlpakaInterface (heterogeneous)
  • RecoVertex/PixelVertexFinding (reconstruction)

@cmsbuild, @fwyzard, @jfernan2, @makortel, @mandrenguyen can you please review it and eventually sign? Thanks. @GiacomoSguazzoni, @VinInn, @VourMa, @dgulhan, @fabiocos, @makortel, @martinamalberti, @missirol, @mmusich, @mtosi, @rovere this is something you requested to watch as well. @antoniovilela, @mandrenguyen, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

cmsbuild avatar Jul 21 '25 15:07 cmsbuild

enable gpu

makortel avatar Jul 21 '25 15:07 makortel

@cmsbuild, please test

makortel avatar Jul 21 '25 15:07 makortel

-1

Failed Tests: Build ClangBuild Size: This PR adds an extra 32KB to repository Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-9b92d6/47304/summary.html COMMIT: af82d48a281d588ff1354d661ca56e942dfc8375 CMSSW: CMSSW_15_1_X_2025-07-21-1100/el8_amd64_gcc12 Additional Tests: CUDA,ROCM User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/48378/47304/install.sh to create a dev area with all the needed externals and cmssw changes.

Build

I found compilation error when building:

Copying tmp/el8_amd64_gcc12/src/HeterogeneousCore/AlpakaInterface/test/alpakaTestIndependentKernelROCmAsync/libalpakaTestIndependentKernelROCmAsync_rocm.a to productstore area:
Copying tmp/el8_amd64_gcc12/src/HeterogeneousCore/AlpakaInterface/test/alpakaTestKernelROCmAsync/libalpakaTestKernelROCmAsync_rocm.a to productstore area:
Copying tmp/el8_amd64_gcc12/src/HeterogeneousCore/AlpakaInterface/test/alpakaTestOneHistoContainerROCmAsync/libalpakaTestOneHistoContainerROCmAsync_rocm.a to productstore area:
cp: cannot stat 'tmp/el8_amd64_gcc12/src/HeterogeneousCore/AlpakaInterface/test/alpakaTestOneHistoContainerROCmAsync/libalpakaTestOneHistoContainerROCmAsync_rocm.a': No such file or directory
>> Deleted: tmp/el8_amd64_gcc12/src/HeterogeneousCore/AlpakaInterface/test/alpakaTestOneHistoContainerROCmAsync/libalpakaTestOneHistoContainerROCmAsync_rocm.a
gmake: *** [config/SCRAM/GMake/Makefile.rules:1920: tmp/el8_amd64_gcc12/src/HeterogeneousCore/AlpakaInterface/test/alpakaTestOneHistoContainerROCmAsync/libalpakaTestOneHistoContainerROCmAsync_rocm.a] Error 1
Copying tmp/el8_amd64_gcc12/src/HeterogeneousCore/AlpakaInterface/test/alpakaTestOneRadixSortROCmAsync/libalpakaTestOneRadixSortROCmAsync_rocm.a to productstore area:
Copying tmp/el8_amd64_gcc12/src/HeterogeneousCore/AlpakaInterface/test/alpakaTestOneToManyAssocROCmAsync/libalpakaTestOneToManyAssocROCmAsync_rocm.a to productstore area:
Copying tmp/el8_amd64_gcc12/src/HeterogeneousCore/AlpakaInterface/test/alpakaTestPrefixScanROCmAsync/libalpakaTestPrefixScanROCmAsync_rocm.a to productstore area:
Copying tmp/el8_amd64_gcc12/src/HeterogeneousCore/AlpakaInterface/test/alpakaTestRadixSortROCmAsync/libalpakaTestRadixSortROCmAsync_rocm.a to productstore area:
Copying tmp/el8_amd64_gcc12/src/HeterogeneousCore/AlpakaInterface/test/alpakaTestSimpleVectorROCmAsync/libalpakaTestSimpleVectorROCmAsync_rocm.a to productstore area:

Clang Build

I found compilation error while trying to compile with clang. Command used:

USER_CUDA_FLAGS='--expt-relaxed-constexpr' USER_CXXFLAGS='-Wno-register -fsyntax-only' /usr/bin/time -v scram build -k -j 32 COMPILER='llvm compile'

>> Local Products Rules ..... done
>> Creating project symlinks
>> Entering Package HeterogeneousCore/AlpakaInterface
>> Entering Package RecoVertex/PixelVertexFinding
>> Compile sequence completed for CMSSW CMSSW_15_1_X_2025-07-21-1100
gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 1
Command exited with non-zero status 1
	Command being timed: "scram build -k -j 32 COMPILER=llvm compile BUILD_LOG=yes"
	User time (seconds): 1151.03
	System time (seconds): 131.30
	Percent of CPU this job got: 1316%

cmsbuild avatar Jul 21 '25 15:07 cmsbuild

-heterogeneous

Most of the changes are fine, but there are a couple of fixes needed and one suggestion for improvements.

fwyzard avatar Jul 25 '25 06:07 fwyzard

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45616

  • There are other open Pull requests which might conflict with changes you have proposed:
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h modified in PR(s): #48377, #48633
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h modified in PR(s): #48377

Code check has found code style and quality issues which could be resolved by applying following patch(s)

  • code-format: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45616/code-format.patch e.g. curl -k https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45616/code-format.patch | patch -p1 You can also run scram build code-format to apply code format directly

cmsbuild avatar Jul 28 '25 14:07 cmsbuild

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45622

  • There are other open Pull requests which might conflict with changes you have proposed:
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h modified in PR(s): #48377, #48633
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h modified in PR(s): #48377

cmsbuild avatar Jul 28 '25 15:07 cmsbuild

Pull request #48378 was updated. @cmsbuild, @fwyzard, @jfernan2, @makortel, @mandrenguyen can you please check and sign again.

cmsbuild avatar Jul 28 '25 15:07 cmsbuild

@cmsbuild, please test

makortel avatar Jul 28 '25 15:07 makortel

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45625

  • There are other open Pull requests which might conflict with changes you have proposed:
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h modified in PR(s): #48377, #48633
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h modified in PR(s): #48377
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksIterative.h modified in PR(s): #48377

cmsbuild avatar Jul 28 '25 16:07 cmsbuild

Pull request #48378 was updated. @cmsbuild, @fwyzard, @jfernan2, @makortel, @mandrenguyen can you please check and sign again.

cmsbuild avatar Jul 28 '25 16:07 cmsbuild

@cmsbuild, please test

makortel avatar Jul 28 '25 17:07 makortel

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45629

  • There are other open Pull requests which might conflict with changes you have proposed:
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h modified in PR(s): #48377, #48633
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h modified in PR(s): #48377
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksIterative.h modified in PR(s): #48377

cmsbuild avatar Jul 28 '25 21:07 cmsbuild

Pull request #48378 was updated. @cmsbuild, @fwyzard, @jfernan2, @makortel, @mandrenguyen can you please check and sign again.

cmsbuild avatar Jul 28 '25 21:07 cmsbuild

@cmsbuild, please test

makortel avatar Jul 28 '25 21:07 makortel

+1

Size: This PR adds an extra 36KB to repository Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-9b92d6/47427/summary.html COMMIT: e70c1249c04a6d78d3f6f21b65c3e52b3b5c3406 CMSSW: CMSSW_15_1_X_2025-07-28-1100/el8_amd64_gcc12 Additional Tests: CUDA,ROCM User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/48378/47427/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: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 3
  • DQMHistoTests: Total histograms compared: 229213
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 229212
  • 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

CUDA Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 71 differences found in the comparisons
  • DQMHistoTests: Total files compared: 7
  • DQMHistoTests: Total histograms compared: 53445
  • DQMHistoTests: Total failures: 8821
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 44624
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 6 files compared)
  • Checked 24 log files, 30 edm output root files, 7 DQM output files
  • TriggerResults: no differences found

ROCM Comparison Summary

Summary:

cmsbuild avatar Jul 28 '25 23:07 cmsbuild

+1

jfernan2 avatar Jul 29 '25 10:07 jfernan2

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45653

  • There are other open Pull requests which might conflict with changes you have proposed:
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h modified in PR(s): #48377, #48633
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h modified in PR(s): #48377
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksIterative.h modified in PR(s): #48377

cmsbuild avatar Jul 30 '25 15:07 cmsbuild

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

cmsbuild avatar Jul 30 '25 15:07 cmsbuild

@cmsbuild, please test

makortel avatar Jul 30 '25 15:07 makortel

+1

Size: This PR adds an extra 28KB to repository Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-9b92d6/47465/summary.html COMMIT: d9673f958cdf113ef8c3f8c0508ed853090b1edd CMSSW: CMSSW_15_1_X_2025-07-30-1100/el8_amd64_gcc12 Additional Tests: CUDA,ROCM User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/48378/47465/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 1 lines from the logs
  • Reco comparison results: 6 differences found in the comparisons
  • DQMHistoTests: Total files compared: 52
  • DQMHistoTests: Total histograms compared: 4305375
  • DQMHistoTests: Total failures: 36
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 4305319
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 51 files compared)
  • Checked 223 log files, 194 edm output root files, 52 DQM output files
  • TriggerResults: no differences found

CUDA Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 72 differences found in the comparisons
  • DQMHistoTests: Total files compared: 7
  • DQMHistoTests: Total histograms compared: 53445
  • DQMHistoTests: Total failures: 8892
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 44553
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 6 files compared)
  • Checked 24 log files, 30 edm output root files, 7 DQM output files
  • TriggerResults: no differences found

ROCM Comparison Summary

Summary:

cmsbuild avatar Jul 30 '25 17:07 cmsbuild

Thanks @alexstrel, just one last request: could you squash all changes into a single commit ? Thanks !

fwyzard avatar Jul 31 '25 01:07 fwyzard

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48378/45673

  • There are other open Pull requests which might conflict with changes you have proposed:
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h modified in PR(s): #48377
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h modified in PR(s): #48377
    • File RecoVertex/PixelVertexFinding/plugins/alpaka/clusterTracksIterative.h modified in PR(s): #48377

cmsbuild avatar Aug 01 '25 14:08 cmsbuild

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

cmsbuild avatar Aug 01 '25 14:08 cmsbuild