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

Refactor the spacepoint formation #719

Merged

Conversation

beomki-yeo
Copy link
Contributor

@beomki-yeo beomki-yeo commented Sep 30, 2024

This are the changes that I have been suggesting for long time.

  1. spacepoint_formation takes detray detector instead of detector description. Direct use of point_to_global with transform_matrix should be avoided. Most importantly, the local-to-global transformation of annulus shape (Polar coordinate) does not work with point_to_global which only works for Cartesian coordinate.

  2. As detector description is not required (and should not be used), I moved its directory to seeding where the experimental::speacepoing_formation is located. This makes sense because spacepoints are technically only used for seeding.

+ Spacepoint formation is only applied to the 2D measurements as we do not support 1D measurements sp formation. Supporting 1D measurement will need to be followed up by further studies

Let me have 2D condition in the next PR (to test the performance without changing the actual results...)

@beomki-yeo beomki-yeo requested a review from krasznaa September 30, 2024 19:00
@beomki-yeo beomki-yeo force-pushed the refactor-spacepoint-formation branch from 8e8b114 to 086287b Compare September 30, 2024 19:03
@beomki-yeo beomki-yeo force-pushed the refactor-spacepoint-formation branch from 086287b to 7d787af Compare September 30, 2024 20:22
std::make_tuple("tml_detector/trackml-detector.csv",
"tml_detector/default-geometric-config-generic.json",
"tml_full/single_muon/", 9)));
std::make_tuple("geometries/odd/odd-detray_geometry_detray.json",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the spacepoint formation always require the detray geometry, the test files are changed to ODD from TML. The test compares the position of the found spacepoints (spacepoint_formation_algorithm) and truth spacepoints (hits.csv). Even though it is expected that there must be some deviations caused by the measurement_creation, the test requires about 20% uncertainties which is pretty bad. This probably explains the bad efficiency we have observed in the past - This needs to be followed up in the later PRs

Copy link
Member

@krasznaa krasznaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not the greatest that we still have a lot of "if Detray detector then ..." checks in the code, but I think you're right. Let's be pragmatic, and just make the code work for now. It will indeed be better to get rid of the TML setup in follow-up steps.

Generally I'm happy with how you went about this, just had a couple of comments on a quick look. 🤔

@beomki-yeo beomki-yeo force-pushed the refactor-spacepoint-formation branch 2 times, most recently from eba9cd3 to d3f35a2 Compare September 30, 2024 21:06
@beomki-yeo
Copy link
Contributor Author

beomki-yeo commented Sep 30, 2024

The performance remains the same

Command

./bin/traccc_throughput_mt_cuda --detector-file=geometries/odd/odd-detray_geometry_detray.json --digitization-file=geometries/odd/odd-digi-geometric-config.json --grid-file=geometries/odd/odd-detray_surface_grids_detray.json --use-detray-detector --input-directory=../../../../../../../bld6/data/traccc/geant4_ttbar_mu200/ --cpu-threads 2

Main

Reconstructed track parameters: 3299715
Time totals:
                  File reading  617 ms
            Warm-up processing  147130 ms
              Event processing  4809 ms
Throughput:
            Warm-up processing  14713 ms/event, 0.067967 events/s
              Event processing  48.0923 ms/event, 20.7934 events/s

PR

Reconstructed track parameters: 3299774
Time totals:
                  File reading  618 ms
            Warm-up processing  938 ms
              Event processing  4811 ms
Throughput:
            Warm-up processing  93.8457 ms/event, 10.6558 events/s
              Event processing  48.1174 ms/event, 20.7825 events/s

@beomki-yeo beomki-yeo force-pushed the refactor-spacepoint-formation branch from d3f35a2 to f7908ea Compare October 1, 2024 08:56
@beomki-yeo beomki-yeo requested a review from krasznaa October 1, 2024 13:14
Copy link
Member

@krasznaa krasznaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, let's go like this for now. As I'm on board with the overall direction.

@krasznaa krasznaa enabled auto-merge (squash) October 1, 2024 13:54
@krasznaa krasznaa merged commit 0a16362 into acts-project:main Oct 1, 2024
24 checks passed
stephenswat added a commit to stephenswat/traccc that referenced this pull request Oct 7, 2024
PR acts-project#719 refactored the spacepoint formation to use the detray detector.
While this was and remains a good idea, the introduction of the detray
detector massively increases the register use of the kernel, to the
point that I was seeing "too many resources requested for launch"
errors. This commit modifies the kernel to specify appropriate launch
bounds, allowing the compiler to better tune the register usage and
resolve the bug.
stephenswat added a commit to stephenswat/traccc that referenced this pull request Oct 7, 2024
PR acts-project#719 refactored the spacepoint formation to use the detray detector.
While this was and remains a good idea, the introduction of the detray
detector massively increases the register use of the kernel, to the
point that I was seeing "too many resources requested for launch"
errors. This commit modifies the kernel to specify appropriate launch
bounds, allowing the compiler to better tune the register usage and
resolve the bug.
stephenswat added a commit to stephenswat/traccc that referenced this pull request Oct 8, 2024
PR acts-project#719 refactored the spacepoint formation to use the detray detector.
While this was and remains a good idea, the introduction of the detray
detector massively increases the register use of the kernel, to the
point that I was seeing "too many resources requested for launch"
errors. This commit modifies the kernel to specify appropriate launch
bounds, allowing the compiler to better tune the register usage and
resolve the bug.
stephenswat added a commit to stephenswat/traccc that referenced this pull request Oct 21, 2024
PR acts-project#719 refactored the spacepoint formation to use the detray detector.
While this was and remains a good idea, the introduction of the detray
detector massively increases the register use of the kernel, to the
point that I was seeing "too many resources requested for launch"
errors. This commit modifies the kernel to specify appropriate launch
bounds, allowing the compiler to better tune the register usage and
resolve the bug.
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.

2 participants