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

Use ONNXRuntime for ParticleNet inference #30599

Merged
merged 3 commits into from Jul 20, 2020

Conversation

hqucms
Copy link
Contributor

@hqucms hqucms commented Jul 8, 2020

PR description:

This PR moves the ParticleNet inference from MXNet to ONNXRuntime to address #30432. The ParticleNet models are converted from the current (V00) MXNet models. Outputs are consistent with the MXNet implementation at numerical precision level. The inference speed is ~20% faster.

I also implemented the function to load the preprocessing parameters from a JSON file, which can then be shipped together with the DNN models in cms-data. This addresses #29129. The old way (reading from a python cfg file) is kept for backward compatibility.

This PR also contains some preparatory changes (in PhysicsTools/ONNXRuntime and RecoBTag/ONNXRuntime/plugins/BoostedJetONNXJetTagsProducer.cc) for the new version of ParticleNet planned for UL Re-MiniAOD. The UL re-training will switch to Puppi V14 and also exploits the dynamic axis feature of ONNX, which avoids the need of zero-padding the jet constituent particles to 100. This on average reduces the inference time by ~2x.

Requires cms-data/RecoBTag-Combined#33.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 8, 2020

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 8, 2020

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-30599/16855

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 8, 2020

A new Pull Request was created by @hqucms (Huilin Qu) for master.

It involves the following packages:

PhysicsTools/ONNXRuntime
PhysicsTools/PatAlgos
RecoBTag/Configuration
RecoBTag/FeatureTools
RecoBTag/MXNet
RecoBTag/ONNXRuntime

@perrotta, @jpata, @cmsbuild, @santocch, @slava77 can you please review it and eventually sign? Thanks.
@rappoccio, @gouskos, @hatakeyamak, @emilbols, @peruzzim, @seemasharmafnal, @mmarionncern, @ahinzmann, @smoortga, @jdolen, @ferencek, @jdamgov, @nhanvtran, @gkasieczka, @schoef, @andrzejnovak, @clelange, @riga, @JyothsnaKomaragiri, @mverzett, @gpetruc, @mariadalfonso this is something you requested to watch as well.
@silviodonato, @dpiparo you are the release manager for this.

cms-bot commands are listed here

@slava77
Copy link
Contributor

slava77 commented Jul 8, 2020

test parameters:

@slava77
Copy link
Contributor

slava77 commented Jul 8, 2020

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 8, 2020

The tests are being triggered in jenkins.
Tested with other pull request(s) cms-data/RecoBTag-Combined#33

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 9, 2020

-1

Tested at: b09c98f

CMSSW: CMSSW_11_2_X_2020-07-07-1100
SCRAM_ARCH: slc7_amd64_gcc820

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-1f12d9/7786/git-log-recent-commits
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1f12d9/7786/git-merge-result

You can see the results of the tests here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1f12d9/7786/summary.html

I found follow errors while testing this PR

Failed tests: UnitTests

  • Unit Tests:

I found errors in the following unit tests:

---> test materialBudgetTrackerPlots had ERRORS

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-1f12d9/7786/git-log-recent-commits
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1f12d9/7786/git-merge-result

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 9, 2020

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 9, 2020

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1f12d9/7786/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 3258 differences found in the comparisons
  • DQMHistoTests: Total files compared: 37
  • DQMHistoTests: Total histograms compared: 2787356
  • DQMHistoTests: Total failures: 35
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2787271
  • DQMHistoTests: Total skipped: 50
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 36 files compared)
  • Checked 154 log files, 17 edm output root files, 37 DQM output files

@slava77
Copy link
Contributor

slava77 commented Jul 16, 2020

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 16, 2020

The tests are being triggered in jenkins.
Tested with other pull request(s) cms-data/RecoBTag-Combined#33

@slava77
Copy link
Contributor

slava77 commented Jul 16, 2020

ONNXRuntime is 6M+15M while MXNet is 5M+23M*nthread. Here are the igprof reports:

IIUC, the new code scales better with nthreads.
Nice.

@cmsbuild
Copy link
Contributor

+1
Tested at: 0a28aff
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1f12d9/8013/summary.html
CMSSW: CMSSW_11_2_X_2020-07-16-1100
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1f12d9/8013/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 35
  • DQMHistoTests: Total histograms compared: 2612943
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2612894
  • DQMHistoTests: Total skipped: 48
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 34 files compared)
  • Checked 146 log files, 17 edm output root files, 35 DQM output files

@slava77
Copy link
Contributor

slava77 commented Jul 17, 2020

+1

for #30599 0a28aff

  • code changes are in line with the PR description and the follow up review
  • jenkins tests pass and comparisons with the baseline show no differences (although some numerical precision level changes could be expected from the change of the reference engine)

cms-data/RecoBTag-Combined#33 should be merged together or before this PR

@santocch
Copy link

+1

@cmsbuild
Copy link
Contributor

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

@silviodonato
Copy link
Contributor

+1

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.

None yet

5 participants