-
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
Extend onnxruntime gpu interface to producers using onnxruntime #39402
base: master
Are you sure you want to change the base?
Conversation
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39402/32108
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39402/32110
|
A new Pull Request was created by @davidlange6 (David Lange) for master. It involves the following packages:
@cmsbuild, @mandrenguyen, @clacaputo can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
enable gpu |
please test |
assign heterogenous |
assign heterogeneous |
We also encountered this ONNX issue in SONIC tests. I think it's microsoft/onnxruntime#12321. There's a fix merged, but not in a release yet. |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-edc989/27572/summary.html GPU Comparison SummarySummary:
Comparison SummarySummary:
|
Milestone for this pull request has been moved to CMSSW_14_1_X. Please open a backport if it should also go in to CMSSW_14_0_X. |
Pull request #39402 was updated. @wpmccormack, @fwyzard, @valsdav, @makortel can you please check and sign again. |
-1 Failed Tests: Build HeaderConsistency ClangBuild BuildI found compilation error when building: >> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_14_0_X_2024-02-05-2300/src/RecoParticleFlow/PFProducer/plugins/PFCandidateChecker.cc >> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_14_0_X_2024-02-05-2300/src/RecoParticleFlow/PFProducer/plugins/PFConcretePFCandidateProducer.cc >> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_14_0_X_2024-02-05-2300/src/RecoParticleFlow/PFProducer/plugins/PFEGammaProducer.cc >> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_14_0_X_2024-02-05-2300/src/RecoParticleFlow/PFProducer/plugins/PFElectronTranslator.cc In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_14_0_X_2024-02-05-2300/src/RecoParticleFlow/PFProducer/plugins/MLPFProducer.cc:8: /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_14_0_X_2024-02-05-2300/src/PhysicsTools/ONNXRuntime/interface/ONNXSessionOptions.h:4:10: fatal error: HeterogeneousCore/CUDAServices/interface/CUDAService.h: No such file or directory 4 | #include "HeterogeneousCore/CUDAServices/interface/CUDAService.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. >> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_14_0_X_2024-02-05-2300/src/RecoParticleFlow/PFProducer/plugins/PFLinker.cc >> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_14_0_X_2024-02-05-2300/src/RecoParticleFlow/PFProducer/plugins/PFProducer.cc Clang BuildI found compilation error while trying to compile with clang. Command used:
>> Creating project symlinks >> Entering Package PhysicsTools/ONNXRuntime >> Entering Package RecoBTag/ONNXRuntime >> Entering Package RecoParticleFlow/PFProducer >> Compile sequence completed for CMSSW CMSSW_14_0_X_2024-02-05-2300 gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 1 + eval scram build outputlog '&&' '(python3' /data/cmsbld/jenkins/workspace/ib-run-pr-tests/cms-bot/buildLogAnalyzer.py --logDir /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_14_0_X_2024-02-05-2300/tmp/el8_amd64_gcc12/cache/log/src '||' 'true)' ++ scram build outputlog >> Entering Package PhysicsTools/ONNXRuntime Entering library rule at PhysicsTools/ONNXRuntime >> Compiling /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_14_0_X_2024-02-05-2300/src/PhysicsTools/ONNXRuntime/src/ONNXRuntime.cc |
@davidlange6 if you don't mind I can take a look and try to have an uniform interface with the TensorFlow options one. Maybe we can close this PR and restart? |
-reconstruction |
Milestone for this pull request has been moved to CMSSW_14_2_X. Please open a backport if it should also go in to CMSSW_14_1_X. |
@davidlange6 @valsdav should this PR be resurrected, or closed ? |
If @davidlange6 agrees, I would prefer to close this PR and open one with similar changes to make the ONNX backend selection the same as the one we have now in the TensorFlow code. I can take care of that 👍 |
Extends #36963 by adding a backend parameter to models, used by
cms::Ort::getSessionOptions(iConfig.getParameterstd::string("onnx_backend"));
Current options are
cpu -> Use CPU backend
cuda -> Use cuda backend
default -> Use best available
The model used in BoostedJetONNXJetTagsProducer crashes on GPU if the full optimization is included. I reduced this optimization in case a GPU is used (following recipes found on the web). The sort of error one gets is
So far I do not see any significant performance improvement (at least on lxplus-gpu) nor loss. At least BoostedJetONNXJetTagsProducer.cc can be improved to send more than one jet to onnxruntime at a time.