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

Solve vectorization issue by forcing inlining and Silence CLANG Warning by making pragma optional #33355

Merged
merged 4 commits into from
Apr 8, 2021

Conversation

VinInn
Copy link
Contributor

@VinInn VinInn commented Apr 7, 2021

Resolves #32746

only one test affected.
I verified that no timing regression occur anyhow (so pragma not really needed)

@VinInn
Copy link
Contributor Author

VinInn commented Apr 7, 2021

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 7, 2021

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-33355/21942

  • This PR adds an extra 16KB to repository

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

@VinInn
Copy link
Contributor Author

VinInn commented Apr 7, 2021

compiling with -DUSE_VECTORIZATION_PRAGMA -Rpass=loop-vectorize will produce

src/DataFormats/Math/test/CholeskyInvert_t.cpp:81:5: remark: vectorized loop (vectorization width: 2, interleaved count: 1) [-Rpass=loop-vectorize]
    for (auto& m : mm) {
    ^
src/DataFormats/Math/test/CholeskyInvert_t.cpp:75:5: remark: vectorized loop (vectorization width: 2, interleaved count: 1) [-Rpass=loop-vectorize]
    for (unsigned int i = 0; i < SIZE; ++i) {
    ^
src/DataFormats/Math/test/CholeskyInvert_t.cpp:114:7: remark: vectorized loop (vectorization width: 2, interleaved count: 1) [-Rpass=loop-vectorize]
      for (auto& m : mm) {
      ^
src/DataFormats/Math/test/CholeskyInvert_t.cpp:103:7: remark: vectorized loop (vectorization width: 2, interleaved count: 1) [-Rpass=loop-vectorize]
      for (unsigned int i = 0; i < SIZE; ++i) {
      ^
>> Building binary DataFormatsFastMath_t
src/DataFormats/Math/test/CholeskyInvert_t.cpp:81:5: remark: vectorized loop (vectorization width: 2, interleaved count: 1) [-Rpass=loop-vectorize]
    for (auto& m : mm) {
    ^
src/DataFormats/Math/test/CholeskyInvert_t.cpp:75:5: remark: vectorized loop (vectorization width: 2, interleaved count: 1) [-Rpass=loop-vectorize]
    for (unsigned int i = 0; i < SIZE; ++i) {
    ^
src/DataFormats/Math/test/CholeskyInvert_t.cpp:103:7: remark: vectorized loop (vectorization width: 2, interleaved count: 1) [-Rpass=loop-vectorize]
      for (unsigned int i = 0; i < SIZE; ++i) {
      ^
src/DataFormats/Math/test/CholeskyInvert_t.cpp:114:7: remark: vectorized loop (vectorization width: 2, interleaved count: 1) [-Rpass=loop-vectorize]
      for (auto& m : mm) {
      ^
src/DataFormats/Math/test/CholeskyInvert_t.cpp:81:5: remark: vectorized loop (vectorization width: 2, interleaved count: 1) [-Rpass=loop-vectorize]
    for (auto& m : mm) {
    ^
src/DataFormats/Math/test/CholeskyInvert_t.cpp:75:5: remark: vectorized loop (vectorization width: 2, interleaved count: 1) [-Rpass=loop-vectorize]
    for (unsigned int i = 0; i < SIZE; ++i) {
    ^
src/DataFormats/Math/test/CholeskyInvert_t.cpp:103:7: remark: vectorized loop (vectorization width: 2, interleaved count: 1) [-Rpass=loop-vectorize]
      for (unsigned int i = 0; i < SIZE; ++i) {
      ^
src/DataFormats/Math/test/CholeskyInvert_t.cpp:114:7: remark: vectorized loop (vectorization width: 2, interleaved count: 1) [-Rpass=loop-vectorize]
      for (auto& m : mm) {
      ^
src/DataFormats/Math/test/CholeskyInvert_t.cpp:114:7: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]
src/DataFormats/Math/test/CholeskyInvert_t.cpp:103:7: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]
      for (unsigned int i = 0; i < SIZE; ++i) {
      ^
src/DataFormats/Math/test/CholeskyInvert_t.cpp:114:7: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]
      for (auto& m : mm) {
      ^
src/DataFormats/Math/test/CholeskyInvert_t.cpp:103:7: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]
      for (unsigned int i = 0; i < SIZE; ++i) {
      ^

that shows that llvm vectorizes for ranks 2,3,4 and not for 5,6
My recollection is that GCC was vectorizing rank 5 as well

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 7, 2021

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-33355/21943

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 7, 2021

A new Pull Request was created by @VinInn (Vincenzo Innocente) for master.

It involves the following packages:

DataFormats/Math

@perrotta, @jpata, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@makortel, @felicepantaleo, @fabiocos, @rovere this is something you requested to watch as well.
@silviodonato, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@VinInn
Copy link
Contributor Author

VinInn commented Apr 7, 2021

@cmsbuild please test

@VinInn
Copy link
Contributor Author

VinInn commented Apr 7, 2021

@cmsbuild please test

@VinInn VinInn changed the title Solve vectorization issue by force inlining and Silence CLANG Warning by making pragma optional Solve vectorization issue by forcing inlining and Silence CLANG Warning by making pragma optional Apr 7, 2021
@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 7, 2021

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-33355/21945

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 7, 2021

Pull request #33355 was updated. @perrotta, @jpata, @slava77 can you please check and sign again.

@VinInn
Copy link
Contributor Author

VinInn commented Apr 7, 2021

how to ask a clang test?

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 7, 2021

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0a1fdc/14068/summary.html
COMMIT: 57d7dfd
CMSSW: CMSSW_11_3_X_2021-04-06-2300/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/33355/14068/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: 37
  • DQMHistoTests: Total histograms compared: 2640868
  • DQMHistoTests: Total failures: 7
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2640839
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 36 files compared)
  • Checked 155 log files, 37 edm output root files, 37 DQM output files
  • TriggerResults: no differences found

@mrodozov
Copy link
Contributor

mrodozov commented Apr 7, 2021

please test for CMSSW_11_3_CLANG_X
you test it against a clang release which will bring the clang compiler
Could you edit your initial comment first line:
Adresses issue #32746 -> Resolves #32746
which will close the issue when this is merged

@smuzaffar
Copy link
Contributor

Adresses issue #32746 -> Resolves #32746

done @mrodozov

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 7, 2021

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0a1fdc/14078/summary.html
COMMIT: 57d7dfd
CMSSW: CMSSW_11_3_CLANG_X_2021-04-06-2300/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/33355/14078/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 4798 lines to the logs
  • Reco comparison results: 17418 differences found in the comparisons
  • DQMHistoTests: Total files compared: 37
  • DQMHistoTests: Total histograms compared: 2640868
  • DQMHistoTests: Total failures: 84613
  • DQMHistoTests: Total nulls: 6
  • DQMHistoTests: Total successes: 2556227
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.02 KiB( 36 files compared)
  • DQMHistoSizes: changed ( 136.793 ): 0.004 KiB JetMET/SUSYDQM
  • DQMHistoSizes: changed ( 136.874 ): 0.016 KiB JetMET/SUSYDQM
  • Checked 155 log files, 37 edm output root files, 37 DQM output files
  • TriggerResults: found differences in 1 / 36 workflows

@slava77
Copy link
Contributor

slava77 commented Apr 8, 2021

+reconstruction

for #33355 57d7dfd

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 8, 2021

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

@qliphy
Copy link
Contributor

qliphy commented Apr 8, 2021

+1

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.

Two build warnings in CLANG DataFormats/Math/test/CholeskyInvert_t.cpp
6 participants