Skip to content

Intergration of TOoLLiP_v3. - #51057

Open
Brainz22 wants to merge 4 commits into
cms-sw:masterfrom
Brainz22:toolip_v3_pr
Open

Intergration of TOoLLiP_v3.#51057
Brainz22 wants to merge 4 commits into
cms-sw:masterfrom
Brainz22:toolip_v3_pr

Conversation

@Brainz22

@Brainz22 Brainz22 commented May 27, 2026

Copy link
Copy Markdown

PR description:

  • This PR integrates TOoLLiP_v3 into CMSSW, which involves the newest development of the Level-1 long-lived-particle jet trigger. The official TOoLLiP development repository is found here.

    • The submodule with all relevant files is found under TOoLLiP/TOoLLiP_v3 and linked here, e.g. ROC curves, HLS firmware TOoLLiP_v3 folder, Python to HLS conversion scripts, and layer tracing, and model plots.
  • The PR to pass in the correct TOoLLiP version on cms-sw/cmsdist can be found here

PR validation:

  • This PR has been validated through the emulation of the trigger using the fastPuppi ntuple producer. The validation method is as follows:
cmsrel CMSSW_17_0_0_pre1
cd CMSSW_17_0_0_pre1/src
cmsenv
git cms-init 
git branch 
git cms-checkout-topic -u Brainz22:prtestingbranch

git cms-addpkg L1Trigger/Phase2L1ParticleFlow
git cms-addpkg L1Trigger/Configuration
git cms-addpkg DataFormats
git cms-addpkg L1Trigger/TrackTrigger
git cms-addpkg SimTracker/TrackTriggerAssociation
scram b -j8 

#steps for model binary
git clone https://github.com/cms-hls4ml/hls4mlEmulatorExtras.git 
cd hls4mlEmulatorExtras 
git checkout -b v1.1.3 tags/v1.1.3
make install
cd ..

git clone --quiet https://github.com/Xilinx/HLS_arbitrary_Precision_Types.git hls

git clone git@github.com:cms-hls4ml/TOoLLiP.git
cd TOoLLiP
git checkout -b v3.1.0 tags/v3.1.0
make install
export TOOLLIP_PATH=$PWD/TOoLLiP_v3 #need because binary is not in cmsdist yet
cd ..

#add testing
git clone git@github.com:Brainz22/FastPUPPI.git -b 15_1_X_LLPtagging #clones LLPtagging branch
cd FastPUPPI
git checkout 04aa685101d9454eab134d079599178b3099ee89 # checks out and specific commit
cd ..
scram b -j8

#produce nanoAOD file
cmsRun FastPUPPI/NtupleProducer/python/runPerformanceNTuple.py

perfNano.root will appeat at $PWD. This ntuple contains the branch scPuppiL1TTOOLLIPJet_llpTagScore as defined by the lines here.

  • TOoLLiP_v3 emulation checks have been performed on signal and minbias samples, where inputs are taken from cmssw directly and used to test qkeras and HLS models. Their predictions are compared against the emulation predictions. Plot are shown below (original_score axis has distribution of qkeras model predictions):

MinBias

Signal

The qkeras model outputs differ from hls (and thus, cmssw) outputs due to arithmetic precision and quantization mismatches in the shift from qkeras to hls. This conclusion can be inferred from the spread in the hls and qkeras model final layer outputs:

q_dense_1

No backports needed. The workflow works fine for CMSSW_17_0_0_pre1.

@cmsbuild

cmsbuild commented May 27, 2026

Copy link
Copy Markdown
Contributor

cms-bot internal usage

@cmsbuild

Copy link
Copy Markdown
Contributor

@cmsbuild

Copy link
Copy Markdown
Contributor

@cmsbuild

Copy link
Copy Markdown
Contributor

Pull request #51057 was updated.

@Brainz22
Brainz22 marked this pull request as ready for review June 1, 2026 16:30
@quinnanm

quinnanm commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

please test

@cmsbuild

cmsbuild commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

A new Pull Request was created by @Brainz22 for master.

It involves the following packages:

  • L1Trigger/Phase2L1ParticleFlow (l1)

@BenjaminRS, @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

@cmsbuild

cmsbuild commented Jun 2, 2026

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-c94f12/53638/summary.html
COMMIT: b3ac961
CMSSW: CMSSW_17_0_X_2026-06-01-2300/el8_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/51057/53638/install.sh to create a dev area with all the needed externals and cmssw changes.

Failed RelVals

----- Begin Fatal Exception 02-Jun-2026 03:51:29 CEST-----------------------
An exception of category 'StdException' occurred while
   [0] Constructing the EventProcessor
   [1] Constructing module: class=TOoLLiPProducer label='l1tTOoLLiPProducer'
Exception Message:
A std::exception was thrown.
hls4ml emulator model library dlopen failure!
----- End Fatal Exception -------------------------------------------------
----- Begin Fatal Exception 02-Jun-2026 03:46:34 CEST-----------------------
An exception of category 'StdException' occurred while
   [0] Constructing the EventProcessor
   [1] Constructing module: class=TOoLLiPProducer label='l1tTOoLLiPProducer'
Exception Message:
A std::exception was thrown.
hls4ml emulator model library dlopen failure!
----- End Fatal Exception -------------------------------------------------
----- Begin Fatal Exception 02-Jun-2026 03:47:04 CEST-----------------------
An exception of category 'StdException' occurred while
   [0] Constructing the EventProcessor
   [1] Constructing module: class=TOoLLiPProducer label='l1tTOoLLiPProducer'
Exception Message:
A std::exception was thrown.
hls4ml emulator model library dlopen failure!
----- End Fatal Exception -------------------------------------------------
Expand to see more relval errors ...

@Brainz22

Brainz22 commented Jun 2, 2026

Copy link
Copy Markdown
Author

I've seen the error happen when the model binary cannot be found. Probably because PR#10591 has not been yet merged in this case?

@quinnanm

quinnanm commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

please test with cms-sw/cmsdist#10591

@makortel

makortel commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Just checking, is this PR intended for Phase 2 (20_1_X) or Run 3 legacy (17_0_X) or both?

@Brainz22

Brainz22 commented Jun 8, 2026

Copy link
Copy Markdown
Author

This is a Phase 2 upgrade @makortel, but does it hurt to have a working version on both 20_1_x and 17_0_X?

@makortel

makortel commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This is a Phase 2 upgrade @makortel, but does it hurt to have a working version on both 20_1_x and 17_0_X?

That would be up to @cms-sw/l1-l2. The 17_0_X will need a separate backport PR as usual (and you can use the same topic branch as in this PR, as long as it is not rebased to anything newer than 17_0_0_pre2).

@BenjaminRS

Copy link
Copy Markdown
Contributor

Hi Matti and Russell - we will just have this Phase 2 PR going to 20_1_X.

@quinnanm

quinnanm commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

please test with cms-sw/cmsdist#10591

@cmsbuild

cmsbuild commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 16KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c94f12/53745/summary.html
COMMIT: 07cd729
CMSSW: CMSSW_20_0_X_2026-06-08-1100/el8_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/51057/53745/install.sh to create a dev area with all the needed externals and cmssw changes.

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:

You can see more details here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c94f12/53745/git-recent-commits.json
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c94f12/53745/git-merge-result

Comparison Summary

Summary:

  • You potentially added 8 lines to the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 44
  • DQMHistoTests: Total histograms compared: 3248390
  • DQMHistoTests: Total failures: 42
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3248330
  • DQMHistoTests: Total skipped: 18
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 43 files compared)
  • Checked 191 log files, 159 edm output root files, 44 DQM output files
  • TriggerResults: no differences found

@cmsbuild

cmsbuild commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Milestone for this pull request has been moved to CMSSW_20_1_X. Please open a backport if it should also go in to CMSSW_20_0_X.

@cmsbuild cmsbuild modified the milestones: CMSSW_20_0_X, CMSSW_20_1_X Jun 9, 2026
@cmsbuild

Copy link
Copy Markdown
Contributor

REMINDER @sextonkennedy, @ftenchini, @mandrenguyen: This PR was tested with cms-sw/cmsdist#10591, please check if they should be merged together

@cmsbuild cmsbuild modified the milestones: CMSSW_20_0_X, CMSSW_20_1_X Jun 10, 2026
@@ -31,7 +31,7 @@ class JetId {

void setNNVectorVar();
float EvaluateNN();
ap_fixed<16, 6> EvaluateNNFixed();
ap_fixed<14, 8, AP_TRN, AP_SAT, 0> EvaluateNNFixed();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should

ap_fixed<16, 6> computeFixed(const l1t::PFJet &iJet, float vz, bool useRawPt);

also be changed to <14, 8, AP_TRN, AP_SAT, 0> or it is ok to keep that as <16, 6>?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the catch. I checked things and I found no difference in going from <16, 6> to <14, 8, AP_TRN, AP_SAT, 0>. However, I updated the precision accordingly to keep things consistent.

@cmsbuild

cmsbuild commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@cmsbuild

cmsbuild commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Pull request #51057 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.

5 participants