Skip to content

Update NNVtx emulator to match latest HW - #51008

Open
rtschmitz wants to merge 9 commits into
cms-sw:masterfrom
rtschmitz:NNVtx-HLS
Open

Update NNVtx emulator to match latest HW#51008
rtschmitz wants to merge 9 commits into
cms-sw:masterfrom
rtschmitz:NNVtx-HLS

Conversation

@rtschmitz

Copy link
Copy Markdown

PR description:

This PR adds the following changes to NNvtx models:

  • Weight, pattern, and association tensorflow models have been replaced by hls4ml, including updates to emulator to match model quantization of QKeras training
  • NN weight replaces pT in the output VertexWord when running NN vertexing (before: only vertex field filled)
  • In case the output of the NNvtx location results in a tie between two bins, a new tiebreaking procedure has been developed. Before, an average was taken between each of the tied bins. Now, the most central bin is chosen in the case of a tie.

PR validation:

HW tests have shown 100% agreement with this new emulation. The new vertex bin tiebreak procedure has shown equal or better performance in emulation, with better timing performance on HW. Results have been presented in a recent GTT meeting.

@cmsbuild

cmsbuild commented May 21, 2026

Copy link
Copy Markdown
Contributor

cms-bot internal usage

@cmsbuild

Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51008/49430

ERROR: Build errors found during clang-tidy run.

src/L1Trigger/VertexFinder/src/VertexFinder.cc:1468:35: error: use of overloaded operator '>=' is ambiguous (with operand types 'ap_fixed<10, 1>' and 'const float') [clang-diagnostic-error]
 1468 |       nnOutput[i] = (vx_output[i] >= histogrammingThreshold_) ? vx_output[i].to_float() : 0.0f;
      |                      ~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~
/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02942/el8_amd64_gcc13/external/hls/2025.05-1e9bc123eaf0d9d12de4203b234629e6/include/ap_fixed_base.h:1478:3: note: candidate function
--
gmake: *** [config/SCRAM/GMake/Makefile.coderules:129: code-checks] Error 2
gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 2

@cmsbuild

Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51008/49453

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild

Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51008/49454

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild

Copy link
Copy Markdown
Contributor

@cmsbuild

Copy link
Copy Markdown
Contributor

Pull request #51008 was updated.

@rtschmitz
rtschmitz marked this pull request as ready for review May 26, 2026 12:26
@quinnanm

Copy link
Copy Markdown
Contributor

please test

@cmsbuild

Copy link
Copy Markdown
Contributor

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

It involves the following packages:

  • L1Trigger/L1TTrackMatch (l1)
  • L1Trigger/VertexFinder (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

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-821d1e/53510/summary.html
COMMIT: 495734a
CMSSW: CMSSW_17_0_X_2026-05-27-1100/el8_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/51008/53510/install.sh to create a dev area with all the needed externals and cmssw changes.

Failed RelVals

----- Begin Fatal Exception 27-May-2026 19:54:52 CEST-----------------------
An exception of category 'StdException' occurred while
   [0] Constructing the EventProcessor
   [1] Constructing module: class=VertexProducer label='l1tVertexFinder'
Exception Message:
A std::exception was thrown.
hls4ml emulator model library dlopen failure!
----- End Fatal Exception -------------------------------------------------
----- Begin Fatal Exception 27-May-2026 19:50:14 CEST-----------------------
An exception of category 'StdException' occurred while
   [0] Constructing the EventProcessor
   [1] Constructing module: class=VertexProducer label='l1tVertexFinder'
Exception Message:
A std::exception was thrown.
hls4ml emulator model library dlopen failure!
----- End Fatal Exception -------------------------------------------------
----- Begin Fatal Exception 27-May-2026 19:50:31 CEST-----------------------
An exception of category 'StdException' occurred while
   [0] Constructing the EventProcessor
   [1] Constructing module: class=VertexProducer label='l1tVertexFinder'
Exception Message:
A std::exception was thrown.
hls4ml emulator model library dlopen failure!
----- End Fatal Exception -------------------------------------------------
Expand to see more relval errors ...

@cmsbuild

cmsbuild commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

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

@cmsbuild cmsbuild modified the milestones: CMSSW_17_0_X, CMSSW_20_0_X Jun 5, 2026
@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?

@rtschmitz

Copy link
Copy Markdown
Author

This is for Phase 2; it's an update to a vertexing algorithm related to the L1 Tracker upgrade. So I think it should be for 20_1_X, but I'll let @BenjaminRS confirm.

@makortel

makortel commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Thanks. For the case of 20_1_X-only nothing needs to be done.

@BenjaminRS

Copy link
Copy Markdown
Contributor

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

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