-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Particle Transformer sonic producer #45579
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
fcb4d88
add SONIC-ize particleTransformer
y19y19 7fabe9f
add particle transformer modofier
y19y19 0301af1
move common input for particle transformer with/without sonic to inte…
y19y19 a5b07c8
respond to code comments
y19y19 35d7a18
remove InputIndexes and loop through enum
y19y19 2b6404d
code patch
y19y19 28d81de
remove unnecessary comments
y19y19 7a4032e
resolve comments to make variables inline and use array instead of map
y19y19 df4fe14
update format
y19y19 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
Configuration/ProcessModifiers/python/particleTransformerAK4SonicTriton_cff.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import FWCore.ParameterSet.Config as cms | ||
|
|
||
| particleTransformerAK4SonicTriton = cms.Modifier() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| <use name="PhysicsTools/ONNXRuntime"/> | ||
| <use name="DataFormats/BTauReco"/> | ||
| <export> | ||
| <lib name="1"/> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If defined this way, these global constants should be defined as
inline.Given that the keys are adjacent integers starting from 0, the map could be replaced with
constexpr std::array<unsigned int, kEnd>that would avoid dynamic memory allocations, be faster to access, and beinlineimplicitly. (nowadays with C++20 alsoconstexpr std::vectorshould work, butstd::arrayseems easy enough here).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @makortel somehow I received warning being treated as error when compiling std::array, and it can be fixed by using double braces...
/depot/cms/private/users/yao317/SONIC/tmp/CMSSW_14_1_0_pre0/src/RecoBTag/ONNXRuntime/interface/tensor_configs.h:49:67: error: missing braces around initializer for 'std::__array_traits<unsigned int, 6>::_Type' {aka 'unsigned int [6]'} [-Werror=missing-braces] 49 | inline constexpr std::array<unsigned int, 6> dummy { 1,1,1,1,1,1};if you are fine with it, I will update my branch with inline and constexpr of all the variables in namespace ParT.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kpedro88 let me know if you have any opinion on this strange warning-error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@y19y19 you need to put an extra set of curly braces. This is just a C++ syntax requirement. i.e.:
constexpr std::array<unsigned int, 6> dummy {{ 1,1,1,1,1,1}};