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

Improve the SoA accessors and optimisations #39919

Merged
merged 5 commits into from Nov 16, 2022

Conversation

fwyzard
Copy link
Contributor

@fwyzard fwyzard commented Oct 28, 2022

PR description:

These changes fix various issues with the SoA accessors:

  • return const scalars by const reference instead of by value, which would break non-trivially copiable types;
  • remove the __builtin_assume_aligned compiler hints from the SoA fields, as it breaks the __restrict__ optimizations in nvcc;
  • add support for SoA view-level indexed access of Eigen columns;
  • add range checking to SoA view-level indexed accessors.

Extend the tests to check the access by (const) reference, the access to Eigen SoA columns, and the improved range checking.

PR validation:

Fixes a simple test provided by @borzari .

The updated unit test passes all checks.

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 to ease the migration to Alpaka.

Return const scalars by const reference instead of by value, which would
break non-trivially copiable types.
Update the SoA tests to check the various ways of taking the address of
a column, scalar, or Eigen column fields.
@fwyzard
Copy link
Contributor Author

fwyzard commented Oct 28, 2022

@ericcano could you double check these changes, and in particular

  • does the const view still generate accesses through the constant cache ?
  • does the syntax for the return types look correct to you ?
  • why does view[0].m() works and view.m(0) does not ?

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39919/32834

  • This PR adds an extra 28KB to repository

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

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

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

Remove the __builtin_assume_aligned compiler hints from the SoA fields, as it breaks the __restrict__ optimizations in nvcc.
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39919/33010

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

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

@fwyzard
Copy link
Contributor Author

fwyzard commented Nov 15, 2022

please test

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39919/33045

  • This PR adds an extra 36KB to repository

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

Add support for SoA view-level indexed access of Eigen columns and enable the corresponding test.
@fwyzard
Copy link
Contributor Author

fwyzard commented Nov 16, 2022

please test

@fwyzard fwyzard changed the title Fix the return type for const view of scalars Improve the SoA accessors and optimisations Nov 16, 2022
@fwyzard
Copy link
Contributor Author

fwyzard commented Nov 16, 2022

+heterogeneous

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs after it passes the integration tests. This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@fwyzard
Copy link
Contributor Author

fwyzard commented Nov 16, 2022

@perrotta @rappoccio sorry the delay; can we have this in CMSSW_12_6_0_pre5 ?

The SoA code is not used in production anywhere, but having this in the (pre)release would ease the work of the various developers.

@fwyzard
Copy link
Contributor Author

fwyzard commented Nov 16, 2022

type bugfix

@cmsbuild
Copy link
Contributor

-1

Failed Tests: UnitTests RelVals-INPUT
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d75cf1/29048/summary.html
COMMIT: 067becf
CMSSW: CMSSW_12_6_X_2022-11-16-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/39919/29048/install.sh to create a dev area with all the needed externals and cmssw changes.

Unit Tests

I found errors in the following unit tests:

---> test test-das-selected-lumis had ERRORS

RelVals-INPUT

The relvals timed out after 4 hours.

Comparison Summary

Summary:

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

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: 12
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 19864
  • 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

@perrotta
Copy link
Contributor

+1

  • test-das-selected-lumis unit test error does not seem to be correlated: let check it further in tomorrow morning IB

@perrotta
Copy link
Contributor

merge

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.

None yet

4 participants