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

Speed up Puppi #35799

Merged
merged 1 commit into from Oct 27, 2021
Merged

Speed up Puppi #35799

merged 1 commit into from Oct 27, 2021

Conversation

kpedro88
Copy link
Contributor

PR description:

Switches tend to be faster than else if when more than a couple of (simple) cases exist (better optimization by the compiler). This change in particular made Puppi 23% faster (tested on a ttbar UL sample in 10_6_X).

PR validation:

Code compiles and runs successfully, no changes expected or observed.

This PR will be backported to 10_6_X to speed up ultra-legacy analysis processing. Backports to other releases can be made upon request.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35799/26164

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @kpedro88 (Kevin Pedro) for master.

It involves the following packages:

  • CommonTools/PileupAlgos (reconstruction)

@jpata, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@rappoccio, @missirol, @ahinzmann, @jdolen, @gkasieczka, @hatakeyamak, @clelange this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@kpedro88
Copy link
Contributor Author

please test

@VinInn
Copy link
Contributor

VinInn commented Oct 23, 2021

not anymore in recent gcc
https://godbolt.org/z/eqYYcqhM1

@VinInn
Copy link
Contributor

VinInn commented Oct 23, 2021

and in clang since ever.

@kpedro88
Copy link
Contributor Author

Good to know that newer gcc versions have picked up the better optimization. Nevertheless, it's still worthwhile to have the optimization in 10_6_X with its older gcc version. I leave it up to release managers whether they still want the change to enter master, even if it no longer has an effect.

@VinInn
Copy link
Contributor

VinInn commented Oct 23, 2021

The switch code is cleaner anyhow: strange that gcc was not able to optimize.

@slava77
Copy link
Contributor

slava77 commented Oct 23, 2021

enable profiling

@slava77
Copy link
Contributor

slava77 commented Oct 23, 2021

@cmsbuild please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-ccffe7/19865/summary.html
COMMIT: 45ac7ee
CMSSW: CMSSW_12_1_X_2021-10-23-1100/slc7_amd64_gcc900
Additional Tests: PROFILING
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/35799/19865/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: 40
  • DQMHistoTests: Total histograms compared: 2751113
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2751091
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 39 files compared)
  • Checked 170 log files, 37 edm output root files, 40 DQM output files
  • TriggerResults: no differences found

@kpedro88
Copy link
Contributor Author

@gartung the "Igprof Comparison cpu usage RECO produce methods." page in the profiling results is blank. is there a bug in the script that needs to be fixed?

@slava77
Copy link
Contributor

slava77 commented Oct 24, 2021

strangely enough this still shows up as tests started

ah, I guess that in response to the last comment somebody restarted the profiling tests some 20 minutes ago.

@gartung
Copy link
Member

gartung commented Oct 25, 2021

Reverting to the older script revealed the real issue

+ /data/cmsbld/jenkins/workspace/ib-run-pr-profiling/profiling/Analyze_tool/compare_cpu_txt.py --old CMSSW_12_1_X_2021-10-23-1100_RES_CPU_step3.txt --new RES_CPU_step3.txt
Traceback (most recent call last):
  File "/data/cmsbld/jenkins/workspace/ib-run-pr-profiling/profiling/Analyze_tool/compare_cpu_txt.py", line 2, in <module>
    import pandas as pd
ImportError: No module named pandas

@kpedro88
Copy link
Contributor Author

@gartung if this script relies on the CMSSW environment, maybe it needs to be changed to #!/bin/env python3 rather than just python?

@gartung
Copy link
Member

gartung commented Oct 25, 2021

Yes. I just pushed that fix.

@gartung
Copy link
Member

gartung commented Oct 25, 2021

I resubmitted the pr-profiling Jenkins job which will pick up this fix.

@jpata
Copy link
Contributor

jpata commented Oct 26, 2021

@gartung
Copy link
Member

gartung commented Oct 26, 2021

@gartung
Copy link
Member

gartung commented Oct 26, 2021

The jenkins job log shows that a new RES_CPU_compare_11834.21.txt was created but it was not copied. Triggering the build again should create a new results directory and allow the file to be uploaded.l

@gartung
Copy link
Member

gartung commented Oct 26, 2021

please test

@kpedro88
Copy link
Contributor Author

PuppiProducer isn't listed in that CPU comparison. I guess it isn't high enough on the list.

If I drill down into the full igprof reports:
Baseline: https://cmssdt.cern.ch/SDT/cgi-bin/igprof-navigator/CMSSW_12_1_X_2021-10-23-1100/slc7_amd64_gcc900/profiling/23434.21/igprofCPU_step3/1131
PR: https://cmssdt.cern.ch/SDT/cgi-bin/igprof-navigator/CMSSW_12_1_X_2021-10-23-1100/slc7_amd64_gcc900/profiling/23434.21/PR-ccffe7/19865/igprofCPU_step3/1158

The % total does decrease, though the overall time usage seems to be higher for the PR (for everything, not just this model).

My use case was rerunning Puppi on top of miniAOD, where it's a larger % of the total.

@gartung
Copy link
Member

gartung commented Oct 26, 2021

The increase in time is probably caused by enabling the IgprofService in the job which takes some time to write out the profile after the first, middle and next to last event.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-ccffe7/19957/summary.html
COMMIT: 45ac7ee
CMSSW: CMSSW_12_1_X_2021-10-26-1100/slc7_amd64_gcc900
Additional Tests: PROFILING
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/35799/19957/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: 41
  • DQMHistoTests: Total histograms compared: 2797338
  • DQMHistoTests: Total failures: 5
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 2797310
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: -0.004 KiB( 40 files compared)
  • DQMHistoSizes: changed ( 312.0 ): -0.004 KiB MessageLogger/Warnings
  • Checked 173 log files, 37 edm output root files, 41 DQM output files
  • TriggerResults: no differences found

@jpata
Copy link
Contributor

jpata commented Oct 27, 2021

+reconstruction

  • technical
  • no runtime change detected in the PR profiling (none expected as far as I understand)

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

@perrotta
Copy link
Contributor

+1

  • Technical

@cmsbuild cmsbuild merged commit c2d7d66 into cms-sw:master Oct 27, 2021
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

7 participants