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

Clamp the number of pixel tracks to the capacity of the SoA #38883

Conversation

fwyzard
Copy link
Contributor

@fwyzard fwyzard commented Jul 28, 2022

PR description:

The data structure used to store the pixel tracks currently has a fixed size of 32768, which was found to be adequate based on MC studies.
While running over collisions data a small fraction of events has been found to have a larger number of tracks, leading to assertion failures or memory access errors.

This PR clamps the number of pixel tracks to the capacity of the SoA, and adds a warning like

%MSG-w PixelTracks:  PixelTrackSoAFromCUDA:hltPixelTracksFromGPU  30-Jul-2022 09:16:12 CEST Run: 356071 Event: 46424286
Unsorted reconstructed pixel tracks truncated to 32767 candidates
%MSG

PR validation:

Running over an event with > 33k pixel tracks no longer causes assertion failures.

If this PR will be backported please specify to which release cycle the backport is meant for:

To be backported to CMSSW 12.4.x for data taking.

@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 28, 2022

type bugfix

@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 28, 2022

enable gpu

@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 28, 2022

please test

Comment on lines 564 to 566
uint32_t first = blockIdx.x * blockDim.x + threadIdx.x;
// clamp the number of tracks to the capacity of the SoA
auto ntracks = std::min<uint32_t>(apc->get().m, tracks.stride() - 1);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@VinInn does this look like a good fix to you ?
An alternative could be to adapt all client code to check the size vs the stride (or look for the nhits == 0 marker), but this seemed easier to implement and safer to use.

On the other this will completely silence the error.
Maybe we could check if nTracks() == stride() - 1 and assume it to mean that an "overflow" occurred ?

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38883/31314

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • RecoPixelVertexing/PixelTrackFitting (reconstruction)
  • RecoPixelVertexing/PixelTriplets (reconstruction)

@jpata, @clacaputo can you please review it and eventually sign? Thanks.
@VourMa, @felicepantaleo, @GiacomoSguazzoni, @JanFSchulte, @rovere, @VinInn, @mmusich, @mtosi, @dgulhan this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy, @rappoccio you are the release manager for this.

cms-bot commands are listed here

if (0 == first)
tracks.setNTracks(ntracks);
for (int idx = first, nt = ntracks; idx < nt; idx += gridDim.x * blockDim.x) {
for (uint32_t idx = first; idx < ntracks; idx += gridDim.x * blockDim.x) {
auto nHits = tracks.nHits(idx);
Copy link
Contributor

Choose a reason for hiding this comment

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

why?
int was intentional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

which change ?

  • nt = ntracks: I don't see how it can make a difference (ntracks is also a local variable) but I can revert it
  • int vs uint32_t: becuase ntracks is now uint32_t and the compiler warns about signed-vs-unsigned comparison

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-197dc3/26510/summary.html
COMMIT: 9c1a5dc
CMSSW: CMSSW_12_5_X_2022-07-28-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/38883/26510/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
  • DQMHistoTests: Total files compared: 4
  • DQMHistoTests: Total histograms compared: 19876
  • DQMHistoTests: Total failures: 36
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 19840
  • 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: 6 differences found in the comparisons
  • DQMHistoTests: Total files compared: 51
  • DQMHistoTests: Total histograms compared: 3668050
  • DQMHistoTests: Total failures: 8
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3668020
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 50 files compared)
  • Checked 210 log files, 47 edm output root files, 51 DQM output files
  • TriggerResults: no differences found

@clacaputo
Copy link
Contributor

+reconstruction

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

@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 29, 2022

hold

I'm waiting for further feedback from @VinInn and mulling on the possibility of adding a LogWarning.

@cmsbuild
Copy link
Contributor

Pull request has been put on hold by @fwyzard
They need to issue an unhold command to remove the hold state or L1 can unhold it for all

@fwyzard fwyzard force-pushed the Clamp_the_number_of_pixel_tracks_to_the_capacity_of_the_SoA branch from f3c7494 to d04920f Compare July 30, 2022 07:59
@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 30, 2022

please test

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38883/31340

@cmsbuild
Copy link
Contributor

Pull request #38883 was updated. @jpata, @clacaputo can you please check and sign again.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-197dc3/26543/summary.html
COMMIT: d04920f
CMSSW: CMSSW_12_5_X_2022-07-29-2300/el8_amd64_gcc10
Additional Tests: GPU
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/38883/26543/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
  • DQMHistoTests: Total files compared: 4
  • DQMHistoTests: Total histograms compared: 19876
  • DQMHistoTests: Total failures: 36
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 19840
  • 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: found differences in 1 / 3 workflows

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 8 differences found in the comparisons
  • DQMHistoTests: Total files compared: 51
  • DQMHistoTests: Total histograms compared: 3668050
  • DQMHistoTests: Total failures: 13
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3668014
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.004 KiB( 50 files compared)
  • DQMHistoSizes: changed ( 312.0 ): 0.004 KiB MessageLogger/Warnings
  • Checked 210 log files, 47 edm output root files, 51 DQM output files
  • TriggerResults: no differences found

@clacaputo
Copy link
Contributor

+reconstruction

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

@fwyzard
Copy link
Contributor Author

fwyzard commented Aug 1, 2022

urgent

@cmsbuild cmsbuild added the urgent label Aug 1, 2022
@qliphy
Copy link
Contributor

qliphy commented Aug 1, 2022

+1

@cmsbuild cmsbuild merged commit ce3448c into cms-sw:master Aug 1, 2022
@fwyzard fwyzard deleted the Clamp_the_number_of_pixel_tracks_to_the_capacity_of_the_SoA branch October 29, 2022 08:37
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.

5 participants