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

L1Nano addition #40663

Merged
merged 12 commits into from
Apr 1, 2023
Merged

L1Nano addition #40663

merged 12 commits into from
Apr 1, 2023

Conversation

Sam-Harper
Copy link
Contributor

PR description:

So I was helping some folks with some Eg HLT studies and they mentioned yesterday having the L1 objects in Nano would be useful and I agreed and noticed it didnt seem to exist already

So I quickly made an implementation to see if folks like it and want to put it in to the release. We can discuss here if we think this is useful. The L1 DPG obviously should be on board here (@lathomas FYI)

For the Nano the trick is the BXVectors, I made a new class for this which you can restrict the bx. Also it will write the bx into the table as well. I didnt add singleton and external variable support but that could be easily added if we want to.

I wasnt thinking of having this as part of the standard nano, simply as an option for those wanted to use it for studies.

I'm happy to take suggestions. Also of note, I simply put all the L1 variables in, of course these are not always filled (I think to fill them you need to re-run the emulator not simply unpack), however they are zero as a result. Also probably could adjust the sizes used to store the values.

We could have two modes for this, one which has all L1 objects and info and one which just has a subset if folks are interested.

The only L1 object I'm aware missing is the MuonShowers and that is simply as I didnt have the format to test.

PR validation:

I successfully ran this on 12_4_10 making some nice L1 nano which looked as expected (ie basically the L1 objects in nano). Without activating the nanoL1TrigObjCustomize, no changes are expected.

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 1, 2023

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-40663/34001

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 1, 2023

A new Pull Request was created by @Sam-Harper (Sam Harper) for master.

It involves the following packages:

  • PhysicsTools/NanoAOD (xpog)

@cmsbuild, @swertz, @vlimant can you please review it and eventually sign? Thanks.
@gpetruc 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

@vlimant
Copy link
Contributor

vlimant commented Feb 3, 2023

assign l1

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 3, 2023

New categories assigned: l1

@epalencia,@rekovic,@cecilecaillol you have been requested to review this Pull request/Issue and eventually sign? Thanks

@lathomas
Copy link
Contributor

lathomas commented Feb 3, 2023

Hello,
Thanks a lot @Sam-Harper for this.
Do you know by change the added size to NANO when saving all L1 objects? If it's small, could we consider adding them to central NANO? That would be really convenient.

Thanks !

@@ -325,6 +326,57 @@ class SimpleFlatTableProducer : public SimpleFlatTableProducerBase<T, edm::View<
std::vector<std::unique_ptr<ExtVariable<T>>> extvars_;
};

template <typename T>
class BXVectorSimpleFlatTableProducer : public SimpleFlatTableProducerBase<T, BXVector<T>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

please add a fillDescription to this new module,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

of course, I didnt do it as it hadnt been done for the others but thats because I was basing of 12_4_X, I see its all done now in the main branch so I can easily make that change.

@vlimant
Copy link
Contributor

vlimant commented Feb 3, 2023

enable nano

@artlbv
Copy link
Contributor

artlbv commented Feb 3, 2023

Do you know by change the added size to NANO when saving all L1 objects? If it's small, could we consider adding them to central NANO? That would be really convenient.

@lathomas I made a size estimate from a /Muon Data file* for this L1 nano and the report is here.

* /store/data/Run2022G/Muon/MINIAOD/PromptReco-v1/000/362/433/00000/301949d0-c7ec-4094-9212-dd463bda0538.root

The nano file is here: /eos/cms/store/group/dpg_trigger/comm_trigger/L1Trigger/alobanov/run3/L1nano/Muon_ReReco-Run2022G-PromptNanoAODv10_v1-00001_full_50k.root

@Sam-Harper
Copy link
Contributor Author

thanks @artlbv

So on size, it should also be considered that right now it adds a lot of stuff which may not be necessary for many users. And Laurent was suggesting some Pt cuts. So there could be two formats, a minimal one for users and an extended one for experts.

Also re the dicussion about having a the bx embedded in the table. I will do some size studies on this but a possible solution would also that the minimal format only has bx=0 and the table adapted so that if minBX=maxBX then the bx variable is auto dropped as its implicit.

@lathomas
Copy link
Contributor

lathomas commented Feb 3, 2023

Thanks ! So it is huge. Clearly not affordable for central NANO.
We should come up with some filtering if we want it in central NANO (most natural thing would be on pt, bx).
We should have a discussion on this at a L1 DPG meeting.

@swertz
Copy link
Contributor

swertz commented Feb 3, 2023

Also probably could adjust the sizes used to store the values.

Indeed, this should help. You probably don't need full-precision floats (and ints) everywhere?

Note that also the pt is stored with full precision by default, from https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/NanoAOD/python/common_cff.py#L40

@artlbv
Copy link
Contributor

artlbv commented Feb 3, 2023

Hi, so I made some quick checks on the size/BX cuts:

  1. Changing everything to precision=10: test_size_report_l1only_prec10.html
  2. Changing the ints to int16 -> Char_t in the ROOT file. test_size_report_l1only_prec10_int16.html
  3. Above + keeping onlyBX=0: test_size_report_l1only_prec10_int16_bx0.html

Reference:

To summarise: after requiring BX0 and int16 for HW values the total L1 object size goes down from 0.6 to 0.2 kb/evt

Surely this dataset is not the most representative one, but this is merely to show there is potential for compression.

Summary tables copy-pasted below:

Original (as in PR)

collection kind vars items/evt kb/evt b/item plot % ascending cumulative % descending cumulative %
L1Tau collection 17 48.74 0.251 5.3 36.7% 36.7% 100.0%
L1EtSum collection 7 85.00 0.128 1.5 18.6% 55.3% 63.3%
L1EG collection 18 18.85 0.111 6.0 16.2% 71.5% 44.7%
L1Jet collection 19 11.28 0.080 7.2 11.7% 83.2% 28.5%
L1Mu collection 25 3.08 0.064 21.4 9.4% 92.6% 16.8%

Compressed (int16, precision=10, BX=0)

collection kind vars items/evt kb/evt b/item plot % ascending cumulative % descending cumulative %
L1Tau collection 17 10.20 0.061 6.2 23.1% 23.1% 100.0%
L1Mu collection 25 2.41 0.050 21.1 18.6% 41.8% 76.9%
L1EtSum collection 7 17.00 0.033 2.0 12.5% 54.3% 58.2%
L1EG collection 18 4.25 0.033 7.9 12.3% 66.6% 45.7%
L1Jet collection 19 3.08 0.029 9.6 10.9% 77.5% 33.4%

variables = cms.PSet(l1ObjVars,
towerIEta = Var("towerIEta()",int,doc="tower ieta"),
towerIPhi = Var("towerIPhi()",int,doc="tower iphi"),
rawEt = Var("rawEt()",int,doc="raw et"),
Copy link
Contributor

@aloeliger aloeliger Feb 10, 2023

Choose a reason for hiding this comment

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

towerIEta, towerIPhi, and rawEt are repeated for l1EG's, l1Tau's and l1Jet's. Could you maybe save a few lines by just making those a PSet too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the comment, we've now reworked this file a little and will consider if it still makes sense to do this which it probably does as it means we only have to write the doc string oncey

@smuzaffar smuzaffar modified the milestones: CMSSW_13_0_X, CMSSW_13_1_X Feb 11, 2023
@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-dec96d/31640/summary.html
COMMIT: e1c084e
CMSSW: CMSSW_13_1_X_2023-03-27-2300/el8_amd64_gcc11
Additional Tests: NANO
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/40663/31640/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 2 lines to the logs
  • Reco comparison results: 23 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3554236
  • DQMHistoTests: Total failures: 893
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3553321
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 213 log files, 164 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

NANO Comparison Summary

Summary:

  • You potentially removed 5 lines from the logs
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 11
  • DQMHistoTests: Total histograms compared: 10777
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 10777
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 10 files compared)
  • Checked 23 log files, 10 edm output root files, 11 DQM output files

Nano size comparison Summary:

  • Nano ERROR: Missing ref/2500.5111-size.json
  • Nano ERROR: Missing ref/2500.5111-size.json
    | Sample | kb/ev | ref kb/ev | diff kb/ev | ev/s/thd | ref ev/s/thd | diff rate | mem/thd | ref mem/thd |
    | --- | --- | --- | --- | --- | --- | --- | --- | --- |
    | 2500.31 | 2.223 | 2.223 | 0.000 ( +0.0% ) | 9.45 | 9.59 | -1.5% | 1.481 | 1.548 |
    | 2500.311 | 2.322 | 2.322 | 0.000 ( +0.0% ) | 9.11 | 9.40 | -3.0% | 1.766 | 1.934 |
    | 2500.312 | 2.275 | 2.275 | 0.000 ( +0.0% ) | 9.33 | 9.48 | -1.6% | 1.762 | 1.918 |
    | 2500.33 | 1.098 | 1.098 | 0.000 ( +0.0% ) | 20.81 | 21.64 | -3.8% | 1.476 | 1.663 |
    | 2500.331 | 1.392 | 1.392 | 0.000 ( +0.0% ) | 15.52 | 16.30 | -4.8% | 1.641 | 1.817 |
    | 2500.332 | 1.324 | 1.324 | 0.000 ( +0.0% ) | 17.75 | 18.26 | -2.8% | 1.565 | 1.864 |
    | 2500.401 | 2.137 | 2.137 | 0.000 ( +0.0% ) | 10.43 | 10.56 | -1.2% | 1.174 | 1.248 |
    | 2500.501 | 1.710 | 1.710 | 0.000 ( +0.0% ) | 16.76 | 16.80 | -0.2% | 1.124 | 1.163 |
    | 2500.511 | 1.122 | 1.122 | 0.000 ( +0.0% ) | 30.51 | 31.52 | -3.2% | 1.361 | 1.408 |
    | 2500.601 | 2.049 | 2.049 | 0.000 ( +0.0% ) | 12.59 | 12.70 | -0.9% | 1.103 | 1.229 |

@aloeliger
Copy link
Contributor

I think the buildbot maintainers might need to tweak the nano testing step report for the inclusion of workflow 2500.511?

Other than the fact that the report for it doesn't seem to exist here this seems fine?

@swertz
Copy link
Contributor

swertz commented Mar 28, 2023

The workflow ran fine, which is all we wanted to see: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-dec96d/31640/runTheMatrixNANO-results/2500.5111_NANOdata124Xrun3/

Indeed since there is no reference, the comparison fails. Once this is merged, we will have a reference for the next time we make any changes to this.
(at some point we might also want to add this content to the nanoAODDQM)

@swertz
Copy link
Contributor

swertz commented Mar 28, 2023

+xpog

L1 content additions for "special prompt Nano" and for L1-specific private Nano.

Will you prepare a backport to 13_0 (and perhaps edit the title of this PR, which has become misleading)?

@aloeliger
Copy link
Contributor

+l1

Thanks for these development @Sam-Harper! We're excited to see L1 contents at NanoAOD, and I've been excited and ready to sign on this for a while.

@lathomas
Copy link
Contributor

Hello, I'd like to echo @aloeliger thanks to @Sam-Harper . Thanks also to all people involved. This will be really useful for us.

@jordan-martins
Copy link
Contributor

Hi guys,
just to confirm that PdmV can do customizes in rereco machine, and, then, the --customise PhysicsTools/NanoAOD/nano_cff.nanoL1TrigObjCustomize solution is fine by us.
Thanks for this,
Jordan
FYI @cms-sw/pdmv-l2

@kskovpen
Copy link
Contributor

+pdmv

L1, welcome to Nano

@srimanob
Copy link
Contributor

srimanob commented Apr 1, 2023

+Upgrade

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 1, 2023

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

@perrotta perrotta changed the title L1Nano addition : 13_0_X L1Nano addition Apr 1, 2023
@perrotta
Copy link
Contributor

perrotta commented Apr 1, 2023

+1

@cmsbuild cmsbuild merged commit 0ca803d into cms-sw:master Apr 1, 2023
@vlimant vlimant mentioned this pull request Feb 14, 2024
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.