Skip to content

Add generic emulator wrapper for NGJet#51267

Open
Chriisbrown wants to merge 3 commits into
cms-sw:CMSSW_17_0_Xfrom
CMS-L1T-Jet-Tagging:CMSSW_17_0_0_pre2_NGJet
Open

Add generic emulator wrapper for NGJet#51267
Chriisbrown wants to merge 3 commits into
cms-sw:CMSSW_17_0_Xfrom
CMS-L1T-Jet-Tagging:CMSSW_17_0_0_pre2_NGJet

Conversation

@Chriisbrown

Copy link
Copy Markdown
Contributor

PR description:

This PR updates the Phase 2 L1TNGJet model wrapper to be more generic. Major changes include:

  • Removal of specific datatype input and output arrays and replacement with input and output structs that take any number of input and output arrays with a generic input type. The selection of these features is done inside the model emulator itself
  • Additional constants for number of inputs and outputs
  • Splitting of NNVectorVar into Candidate vectors and Jet vectors
  • Additional processing of the input and output structs, filling them with 0s and passing to the model

This PR needs to be merged alongside this cms-dist PR as it will cause bad any cast errors without this update

This PR does not change model performance, the cms-dist PR updates the emulator model wrapper only and not the model itself, outputs of the model are expected to remain constant

PR validation:

This PR is verified in this pipeline with specific plots measuring emulator / hls4ml matching here

Code check and formats are applied

@cmsbuild

cmsbuild commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

cms-bot internal usage

@cmsbuild

Copy link
Copy Markdown
Contributor

@cmsbuild

Copy link
Copy Markdown
Contributor

A new Pull Request was created by @Chriisbrown for CMSSW_17_0_X.

It involves the following packages:

  • L1Trigger/Phase2L1ParticleFlow (l1)

@BenjaminRS, @cmsbuild, @quinnanm can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @missirol, @mmusich this is something you requested to watch as well.
@ftenchini, @mandrenguyen, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@quinnanm

Copy link
Copy Markdown
Contributor

please test

@cmsbuild

Copy link
Copy Markdown
Contributor

-1

Failed Tests: RelVals
Size: This PR adds an extra 16KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e0a2a8/54163/summary.html
COMMIT: cf73c9b
CMSSW: CMSSW_17_0_X_2026-06-21-2300/el8_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/51267/54163/install.sh to create a dev area with all the needed externals and cmssw changes.

Failed RelVals

----- Begin Fatal Exception 22-Jun-2026 03:44:19 CEST-----------------------
An exception of category 'StdException' occurred while
   [0] Processing  Event run: 1 lumi: 1 event: 1 stream: 0
   [1] Running path 'HLTriggerFinalPath'
   [2] Prefetching for module TriggerSummaryProducerAOD/'hltTriggerSummaryAOD'
   [3] Calling method for module L1TSC4NGJetProducer/'l1tSC4NGJetProducer'
Exception Message:
A std::exception was thrown.
bad any_cast
----- End Fatal Exception -------------------------------------------------
----- Begin Fatal Exception 22-Jun-2026 03:35:12 CEST-----------------------
An exception of category 'StdException' occurred while
   [0] Processing  Event run: 1 lumi: 1 event: 1 stream: 0
   [1] Running path 'HLTriggerFinalPath'
   [2] Prefetching for module TriggerSummaryProducerAOD/'hltTriggerSummaryAOD'
   [3] Calling method for module L1TSC4NGJetProducer/'l1tSC4NGJetProducer'
Exception Message:
A std::exception was thrown.
bad any_cast
----- End Fatal Exception -------------------------------------------------
----- Begin Fatal Exception 22-Jun-2026 03:35:23 CEST-----------------------
An exception of category 'StdException' occurred while
   [0] Processing  Event run: 1 lumi: 1 event: 1 stream: 0
   [1] Running path 'HLTriggerFinalPath'
   [2] Prefetching for module TriggerSummaryProducerAOD/'hltTriggerSummaryAOD'
   [3] Calling method for module L1TSC4NGJetProducer/'l1tSC4NGJetProducer'
Exception Message:
A std::exception was thrown.
bad any_cast
----- End Fatal Exception -------------------------------------------------
Expand to see more relval errors ...

@Chriisbrown

Copy link
Copy Markdown
Contributor Author

This PR needs to be tested with this cms-dist PR: cms-sw/cmsdist#10667

@quinnanm

Copy link
Copy Markdown
Contributor

please test with cms-sw/cmsdist#10667

@cmsbuild

Copy link
Copy Markdown
Contributor

-1

Failed Tests: RelVals
Size: This PR adds an extra 16KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e0a2a8/54184/summary.html
COMMIT: cf73c9b
CMSSW: CMSSW_17_0_X_2026-06-22-1100/el8_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/51267/54184/install.sh to create a dev area with all the needed externals and cmssw changes.

Failed RelVals

----- Begin Fatal Exception 22-Jun-2026 23:44:08 CEST-----------------------
An exception of category 'StdException' occurred while
   [0] Processing  Event run: 1 lumi: 1 event: 1 stream: 0
   [1] Running path 'HLTriggerFinalPath'
   [2] Prefetching for module TriggerSummaryProducerAOD/'hltTriggerSummaryAOD'
   [3] Calling method for module L1TSC4NGJetProducer/'l1tSC4NGJetProducer'
Exception Message:
A std::exception was thrown.
bad any_cast
----- End Fatal Exception -------------------------------------------------
----- Begin Fatal Exception 22-Jun-2026 23:33:53 CEST-----------------------
An exception of category 'StdException' occurred while
   [0] Processing  Event run: 1 lumi: 1 event: 1 stream: 0
   [1] Running path 'HLTriggerFinalPath'
   [2] Prefetching for module TriggerSummaryProducerAOD/'hltTriggerSummaryAOD'
   [3] Calling method for module L1TSC4NGJetProducer/'l1tSC4NGJetProducer'
Exception Message:
A std::exception was thrown.
bad any_cast
----- End Fatal Exception -------------------------------------------------
----- Begin Fatal Exception 22-Jun-2026 23:34:48 CEST-----------------------
An exception of category 'StdException' occurred while
   [0] Processing  Event run: 1 lumi: 1 event: 1 stream: 0
   [1] Running path 'HLTriggerFinalPath'
   [2] Prefetching for module TriggerSummaryProducerAOD/'hltTriggerSummaryAOD'
   [3] Calling method for module L1TSC4NGJetProducer/'l1tSC4NGJetProducer'
Exception Message:
A std::exception was thrown.
bad any_cast
----- End Fatal Exception -------------------------------------------------
Expand to see more relval errors ...

@quinnanm

Copy link
Copy Markdown
Contributor

hi @Chriisbrown thanks for this PR- looks like a bad any_cast error, which I have seen before when the input/output types declared in cms-sw dont match the model. I'm not sure if something like that could be happening here?

@Chriisbrown

Copy link
Copy Markdown
Contributor Author

Hi, I had forgotten to update the default model to v2_0_0 which is the one in the cms-dist update so it should work now

@cmsbuild

Copy link
Copy Markdown
Contributor

@cmsbuild

Copy link
Copy Markdown
Contributor

Pull request #51267 was updated. @BenjaminRS, @cmsbuild, @quinnanm can you please check and sign again.

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.

3 participants