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

Add scalar to macro-based SoA example #38877

Merged
merged 7 commits into from
Aug 23, 2022

Conversation

fwyzard
Copy link
Contributor

@fwyzard fwyzard commented Jul 28, 2022

PR description:

This PR is a follow up to #38855.
It fixes the return types used in some of the View and ConstView accessors, and adds an example of using scalars in a SoA.

PR validation:

All unit tests pass.

@@ -6,7 +6,7 @@
<field name="y_" comment="[nElements_]"/>
<field name="z_" comment="[nElements_]"/>
<field name="id_" comment="[nElements_]"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ericcano @makortel
I am thinking about renaming nElements_ to elements_, as a parallel to scalar_.
What do you think ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have strong feelings either way.

Copy link
Contributor

@ericcano ericcano Aug 16, 2022

Choose a reason for hiding this comment

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

As long as the name is clear (and both are), I don't have a strong opinion either.

@@ -6,7 +6,7 @@
<field name="y_" comment="[nElements_]"/>
<field name="z_" comment="[nElements_]"/>
<field name="id_" comment="[nElements_]"/>
<field name="metadata()" comment="!"/>
<field name="r_" comment="[scalar_]"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only way I found to make ROOT store a single element owned via a pointer.
The scant documentation seems to suggest that -> should be used for that, but I couldn't get it to work.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the only way I found to make ROOT store a single element owned via a pointer.
The scant documentation seems to suggest that -> should be used for that, but I couldn't get it to work.

@pcanal, any thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

The object pointeed to by a pointer to a class are stored without any annotation. For pointer to a class, the annotation '->' means that the pointer is guaranteed to never be a nullptr (i.e. the default constructor allocates the object).

For numerical type, it is assumed (because a pointer to a single value is longer than just the value) that it points to an array of numerical elements and indeed, you need to give a size.

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 see.

So if I wrap the "scalar" type in a struct (or union ?) I could use the -> syntax ?

Copy link
Contributor

Choose a reason for hiding this comment

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

With a struct and if you initialize the pointer to non-zero in the default constructor, yes you can use -> (it wont work for a union).

@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 28, 2022

enable gpu

@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 28, 2022

please test

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38877/31301

  • This PR adds an extra 32KB to repository

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

@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 28, 2022

enable gpu

@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 28, 2022

please test

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38877/31302

  • This PR adds an extra 32KB to repository

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • DataFormats/PortableTestObjects (heterogeneous)
  • DataFormats/SoATemplate (heterogeneous)
  • HeterogeneousCore/AlpakaTest (heterogeneous)

@makortel, @fwyzard can you please review it and eventually sign? Thanks.
@makortel, @rovere 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

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-82d89f/26500/summary.html
COMMIT: 22a63e1
CMSSW: CMSSW_12_5_X_2022-07-27-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/38877/26500/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: 8
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 19868
  • 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: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 51
  • DQMHistoTests: Total histograms compared: 3667670
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3667646
  • 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

@@ -525,6 +525,7 @@
/* data members */ \
std::byte* mem_; \
size_type nElements_; \
size_type const scalar_ = 1; \
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the scalar_ needed only for the iorule? Could it be constexpr or static?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is the scalar_ needed only for the iorule?

Yes.

Could it be constexpr or static?

No, that doesn't work :-/

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38877/31584

  • This PR adds an extra 40KB to repository

@cmsbuild
Copy link
Contributor

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

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-82d89f/26850/summary.html
COMMIT: 3cbc0ec
CMSSW: CMSSW_12_5_X_2022-08-16-1100/el8_amd64_gcc10
Additional Tests: GPU
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/38877/26850/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: 8
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 19868
  • 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 2 / 3 workflows

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: 3692500
  • DQMHistoTests: Total failures: 8
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3692470
  • 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

@fwyzard
Copy link
Contributor Author

fwyzard commented Aug 23, 2022

+heterogeneous

@fwyzard
Copy link
Contributor Author

fwyzard commented Aug 23, 2022

let's move forward like this, and postpone any further improvements to future PRs

@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)

@perrotta
Copy link
Contributor

@fwyzard are the changes observed in wf 11634.506 expected as a consequence of the fixes integrated here? e.g. for SiPixelHeterogeneous_PixelTrackSoA:
image

There are apparently reco differences also for the wfs 11634.512 and 11634.522, but the plot of the differences do not show up in https://cmssdt.cern.ch/SDT/jenkins-artifacts/baseLineComparisonsGPU/CMSSW_12_5_X_2022-08-16-1100+82d89f/52160/validateJR.html,

@fwyzard
Copy link
Contributor Author

fwyzard commented Aug 23, 2022

hi @perrotta,
I don't think so: this PR touches only code that is not yet used anywhere, so it shouldn't affect any workflow.

@fwyzard
Copy link
Contributor Author

fwyzard commented Aug 23, 2022

please test

@mmusich
Copy link
Contributor

mmusich commented Aug 23, 2022

@perrotta

to clarify on top of the question asked at the ORP meeting of Aug 23rd.
edup stands for "early duplicates" and denotes a set of tracks which is not even fitted and therefore is not used for any downstream reconstruction, and which is known to be very sensitive to the order of operations executed.
I think the fluctuation you see is the somewhat "normal" irreproducibility in the tracking GPU workflows. As long as it doesn't affect anything "loose and above" we don't need to worry.
Moreover as Andrea said this PR is just adding new code that is not used anywhere yet.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-82d89f/27020/summary.html
COMMIT: 3cbc0ec
CMSSW: CMSSW_12_5_X_2022-08-23-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/38877/27020/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 2 failed jobs
  • DQMHistoTests: Total files compared: 4
  • DQMHistoTests: Total histograms compared: 19876
  • DQMHistoTests: Total failures: 8
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 19868
  • 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 3 / 3 workflows

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: 3693084
  • DQMHistoTests: Total failures: 8
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3693054
  • 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

@perrotta
Copy link
Contributor

Definitely not reprodicible:
image

@perrotta
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit e336eae into cms-sw:master Aug 23, 2022
@fwyzard fwyzard deleted the alpaka_and_SoA_data_formats branch August 23, 2022 20:20
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.

7 participants