-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Phase-2 L1] Incorporate object threshold scalings, ID and isolation via dictionaries into the P2GT menu #46489
base: master
Are you sure you want to change the base?
Conversation
cms-bot internal usage |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46489/42345 |
A new Pull Request was created by @artlbv for master. It involves the following packages:
@Moanwar, @aloeliger, @cmsbuild, @epalencia, @srimanob, @subirsarkar can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46489/42349 |
The performance aligns with the measurements I did privately using only the fix for the DiTau52 path: +10% speed-up and a visible reduction of events triggering HLT Tau paths. |
Indeed, putting here some details for the record as the PR test results, alas, are not forever. Timing
baseline: 5304.3 ms/ev | this PR: 4799.6 ms/ev | speedup gain -9.51% Trigger Results
e.g. for workflow 29634.0
|
type bug-fix |
scalings_fname = environ["CMSSW_BASE"] + "/src/L1Trigger/Phase2L1GT/python/scalings_v44.json" | ||
with open(scalings_fname, 'r') as file: | ||
scalings = json.load(file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you are necessarily guaranteed this is always going to exist (with a partial checkout of CMSSW for example where you are not working with these directories directly).
The JSON itself should be committed as a data file as it is not directly code.
I'm not sure if there is a FileInPath solution for inside a python configuration, but maybe one of the core people know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be the RELEASE_BASE
then instead?
On the separation to cms-data
: I think that given these constants are tied to the L1 menu, it would make sense to keep them together imo. Otherwise it might be hard to disentangle if changes are due to the menu config or constant changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if there is a FileInPath solution for inside a python configuration, but maybe one of the core people know.
there is pfnInPath
.
Otherwise it might be hard to disentangle if changes are due to the menu config or constant changes.
I am not sure to see the issue. Can you elaborate?
Having said that, the main draw-back of storing the configuration in cms-data
is that a configuration change will require a full release as opposed to a patch-release. Having said that it's not clear to me what's the long term strategy for storing the phase-2 L1T menu, so it's hard to say if that is going to be an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmusich do you mean using this for example?
_file = pfnInPath(path_to_check) |
objectIDs = { | ||
"L1nnPuppiTau": { | ||
"default": { | ||
"qual" : 225 | ||
} | ||
}, | ||
"L1tkPhoton":{ | ||
"Iso": { | ||
"qual": { | ||
"barrel": 0b0010, | ||
"endcap": 0b0100, | ||
}, | ||
"iso": { | ||
"barrel": 0.25, | ||
"endcap": 0.205, | ||
} | ||
} | ||
}, | ||
"L1tkElectron":{ | ||
"Iso": { | ||
# "qual": { | ||
# "barrel": 0b0010, | ||
# "endcap": 0b0010, | ||
# }, | ||
"iso": { | ||
"barrel": 0.13, | ||
"endcap": 0.28, | ||
} | ||
}, | ||
"NoIso": { | ||
"qual": { | ||
"barrel": 0b0010, | ||
"endcap": 0b0010, | ||
}, | ||
}, | ||
"NoIsoLowPt": { | ||
"qual": { | ||
"barrel": 0b0010, | ||
"endcap": 0b0000, | ||
}, | ||
} | ||
}, | ||
"L1gmtTkMuon":{ | ||
"VLoose": { | ||
"qual": 0b0001, | ||
}, | ||
"Loose": { | ||
"qual": 0b0010, | ||
}, | ||
"Medium": { | ||
"qual": 0b0100, | ||
}, | ||
"Tight": { | ||
"qual": 0b1000, | ||
}, | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are already storing menu constants in JSON, could this also be added to the JSON?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree. though it would be a separate JSON, as the one with scalings is generated from the MenuTools.
Hi,
For the long term strategy of storing the L1T Data menu, it's to be defined
but it's not going to be files in the release.
However, for MCs where just a fixed menu is included, a file in the release
is probably good enough (it has been so with HLT).
To be better defined later, e.g. if the Phase-2 L1T has an HLT-like
structure then we might as well use the same tech to store and version data
menus for both.
Giovanni
Il Lun 28 Ott 2024, 15:33 Marco Musich ***@***.***> ha
scritto:
… ***@***.**** commented on this pull request.
------------------------------
In L1Trigger/Phase2L1GT/python/menuConstants.py
<#46489 (comment)>:
> +scalings_fname = environ["CMSSW_BASE"] + "/src/L1Trigger/Phase2L1GT/python/scalings_v44.json"
+with open(scalings_fname, 'r') as file:
+ scalings = json.load(file)
I'm not sure if there is a FileInPath solution for inside a python
configuration, but maybe one of the core people know.
there is pfnInPath.
Otherwise it might be hard to disentangle if changes are due to the menu
config or constant changes.
I am not sure to see the issue. Can you elaborate?
Having said that, the main draw-back of storing the configuration in
cms-data is that a configuration change will require a full release as
opposed to a patch-release. Having said that it's not clear to me what's
the long term strategy for storing the phase-2 L1T menu, so it's hard to
say if that is going to be an issue.
—
Reply to this email directly, view it on GitHub
<#46489 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABDNWR7LCBTVNLSFZLZPDEDZ5Y4MDAVCNFSM6AAAAABQOTRMAOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGOJZGI4DGMZTGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@artlbv what is that status of this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I'm not a big fan of adding a new file type. Also considering that the contents of that json is a perfectly valid python dict
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@artlbv Additional remark after discussion with Hannes, could we maybe sync up the object naming convention? It's super confusing for anyone reading the menu if in one place the object is called L1TrackJet
and in another the collection is referred to as CL2JetsSC4
for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- do you mean we should just save the JSON with
.py
as extension? - I agree and was planning to remap the object names in the JSON – will push this for this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Well you need a variable to assign the constant but other than that yes. Now, I understand that you had some automation with the
json
export in mind, but do you see the scales changing that often? - Great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While at it we have some documentation in: https://github.com/cms-sw/cmssw/blob/master/L1Trigger/Phase2L1GT/README.md
Could you also add some documentation about the usage of scales when writing a menu?
else: | ||
return max(0, new_thr) | ||
|
||
def getObjectThrs(thr, obj, id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@artlbv We think it would be better to explicitly write out the all thresholds instead of using this function that either returns a cms.double
or cms.vdouble
and hides what the regions actually mean. Hence we'd prefer
regionsMinPt = cms.vdouble(off2onl(52, "L1nnPuppiTau", "default", "barrel"), off2onl(52, "L1nnPuppiTau", "default", "endcap"))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is too long and redundant imo (what if the off. threshold is mistyped in one of the regions?).
a compromise could be to list the regions as another argument, i.e.:
regionsMinPt = getObjectThrs(17, "L1nnPuppiTau", "default", ["barrel","endcap"])
how about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me as well, since one can at least guess that this might return a cms.vdouble
.
there were some more pending checks before finishing this PR (+feedback from the P2GT that just came): see this JIRA ticket I'm not sure how urgent these checks are wrt to merging this PR into master tbh. |
The muon quality was already updated as part of #45606. I ran over 10000 ttbar pre and post change to ensure that both cuts are equivalent. They might have diverged since though I did not check this. |
This is another thing. The dynamic ID I refer to is something implemented in the MenuTools, but not possible in the GT. |
From my side, I think it's better to finalize this PR, as it takes care of the most important issues we have been seeing. Then, we can follow up with the remaining fixes in a separate PR, especially because I understand that, for these extra fixes, there may not be an immediate solution. |
Milestone for this pull request has been moved to CMSSW_15_0_X. Please open a backport if it should also go in to CMSSW_14_2_X. |
we just got reminded that currently we can't get sound estimates on the timing increase due to new path additions (e.g. in #46924). Can someone update on the foreseen trajectory for this PR from the L1 side @artlbv @cms-sw/l1-l2 ? |
@cmsbuild, please test |
+1 Size: This PR adds an extra 12KB to repository
Comparison SummarySummary:
|
PR description:
The idea of this PR is to allow for a more convenient organisation and book-keeping of the P2GT emulator menu configurations. Previously threshold changes due to object changes (so-called offline-online scalings) or ID/Iso WP changes had to be changed manually in every seed. With this PR dictionaries are introduced for common ID and Isolation Working Points as well as reading of the scalings (a MenuTools output) is implemented.
This addresses #46470 and was agreed to with the P2GT developer team @HaarigerHarald and @qvyz as presented here in slide 42.
FYI @VourMa @rovere @slaurila @RobertJWard @gpetruc
PR validation:
Tested to work with the standard recipe we (and HLT) are using in
1420pre1
:A simple check was comparing the
edmConfigDump
outputs pre and post PR as there the actual thresholds, ID and Isolation values are expanded into plaintext. The results seem reasonable.Note that also the IDs used for TkMuons have changed since since the AR24 there are now 4 WPs (compared to 1 before).
We will check the agreement with the MenuTools once we get more stats processed (on small stats the agreement is rather good), but I would like to start the PR and the reviewing process, eventually soliciting feedback from our SW experts on these changes.
Note that the code function names in the
menuConstants.py
could be cleaned up etc, but the mechanism should the final one.