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 central phi functions instead LST ones #146

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

VourMa
Copy link
Collaborator

@VourMa VourMa commented Jan 20, 2025

This is the follow up for #142. I have created it as a draft PR, as, to be submitted to cms-sw, we would need to first merge #145 (for proper naming of the reducePhiRange functions) and #141 (so that we can have meaningful tests). Having said that, I think we can start discussing and testing this internally.

@VourMa
Copy link
Collaborator Author

VourMa commented Jan 20, 2025

/run all

Copy link

There was a problem while building and running in standalone mode. The logs can be found here.

Copy link

There was a problem while building and running with CMSSW. The logs can be found here.

@VourMa
Copy link
Collaborator Author

VourMa commented Jan 21, 2025

@ariostas Sorry, I forgot, did we move to 15_0? Could you tell me the exact version, so that I can write it on our repo, and then update this PR appropriately?

@ariostas
Copy link
Member

@VourMa I set it up so that now it always uses the latest release, so it's using 15_0_0_pre2. For some reason AlpakaMath didn't make it into that release, so I'll just make the CI check out that package so that this PR works

@VourMa
Copy link
Collaborator Author

VourMa commented Jan 21, 2025

@VourMa I set it up so that now it always uses the latest release, so it's using 15_0_0_pre2. For some reason AlpakaMath didn't make it into that release, so I'll just make the CI check out that package so that this PR works

Oops, I didn't think of that. Feel free to just run the tests when you sort it out. Thank you for taking care of it!

@ariostas
Copy link
Member

It should work now.

/run all

Copy link

The PR was built and ran successfully in standalone mode. Here are some of the comparison plots.

Efficiency vs pT comparison Efficiency vs eta comparison
Fake rate vs pT comparison Fake rate vs eta comparison
Duplicate rate vs pT comparison Duplicate rate vs eta comparison

The full set of validation and comparison plots can be found here.

Here is a timing comparison:

   Evt    Hits       MD       LS      T3       T5       pLS       pT5      pT3      TC       Reset    Event     Short             Rate
   avg     45.9    399.0    187.8    151.7    146.5    548.9    122.8    233.5    153.8      3.1    1992.9    1398.2+/- 387.5     529.6   explicit[s=4] (target branch)
   avg     48.5    377.1    188.7    151.7    166.9    702.5    122.4    226.7    177.8      3.5    2166.0    1414.9+/- 395.6     574.0   explicit[s=4] (this PR)

Copy link

The PR was built and ran successfully with CMSSW. Here are some plots.

OOTB All Tracks
Efficiency and fake rate vs pT, eta, and phi

The full set of validation and comparison plots can be found here.

@GNiendorf
Copy link
Member

ALPAKA_FN_ACC ALPAKA_FN_INLINE float delta_phi(const float phi1, const float phi2) {
float delta = phi1 - phi2;
// Adjust delta to be within the range [-M_PI, M_PI]
if (delta > kPi) {
delta -= 2 * kPi;
} else if (delta < -kPi) {
delta += 2 * kPi;
}

Can you remove this one in the inference code I added as well? Should probably check that it doesn't affect the performance plots. I tried using another implementation of the delta phi function and it gave some weird results, not sure if it was just a bug in my old code.

@VourMa VourMa force-pushed the CMSSW_14_2_0_pre4_workflowsAndGeneralFunctions_squashed branch from eec20cb to 42dd567 Compare January 21, 2025 23:09
@VourMa
Copy link
Collaborator Author

VourMa commented Jan 21, 2025

ALPAKA_FN_ACC ALPAKA_FN_INLINE float delta_phi(const float phi1, const float phi2) {
float delta = phi1 - phi2;
// Adjust delta to be within the range [-M_PI, M_PI]
if (delta > kPi) {
delta -= 2 * kPi;
} else if (delta < -kPi) {
delta += 2 * kPi;
}

Can you remove this one in the inference code I added as well? Should probably check that it doesn't affect the performance plots. I tried using another implementation of the delta phi function and it gave some weird results, not sure if it was just a bug in my old code.

Sure, I replaced it in the new version I pushed. Let's see if it works out.

@VourMa
Copy link
Collaborator Author

VourMa commented Jan 21, 2025

/run all

Copy link

The PR was built and ran successfully in standalone mode. Here are some of the comparison plots.

Efficiency vs pT comparison Efficiency vs eta comparison
Fake rate vs pT comparison Fake rate vs eta comparison
Duplicate rate vs pT comparison Duplicate rate vs eta comparison

The full set of validation and comparison plots can be found here.

Here is a timing comparison:

   Evt    Hits       MD       LS      T3       T5       pLS       pT5      pT3      TC       Reset    Event     Short             Rate
   avg     46.3    396.2    189.6    153.9    149.5    551.2    124.8    235.2    151.9      3.5    2001.9    1404.4+/- 387.5     529.4   explicit[s=4] (target branch)
   avg     46.8    379.0    190.3    153.3    160.4    708.8    124.4    226.5    180.3      3.1    2173.1    1417.5+/- 394.8     573.2   explicit[s=4] (this PR)

Copy link

The PR was built and ran successfully with CMSSW. Here are some plots.

OOTB All Tracks
Efficiency and fake rate vs pT, eta, and phi

The full set of validation and comparison plots can be found here.

@GNiendorf
Copy link
Member

Looks good, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants