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

De-Template (Host) Track Fitting, main branch (2024.10.28.) #756

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

krasznaa
Copy link
Member

This is the next step in my crusade to make the reconstruction algorithms use non-templated interfaces. 😄

In this I renamed traccc::fitting_algorithm to traccc::host::kf_algorithm, along exactly the same lines as what I did for traccc::host::ckf_algorithm in #722.

As before, one important aspect of this is to get the memory needs of the build under control. In the current main branch we use the following amounts of memory for compiling a few representative source files:

  • seq_example.cpp: 1.4 GB
  • cpu/throughput_st.cpp: 700 MB

This PR introduces 3 new source files, and reduces the memory needs of the previous examples like:

  • kf_algorithm.cpp: 320 MB
  • kf_algorithm_teldet_cfield.cpp: 475 MB
  • kf_algorithm_defdet_cfield.cpp: 650 MB
  • seq_example.cpp: 1.0 GB
  • cpu/throughput_st.cpp: 575 MB

Clearly this is not the end of the road yet, but I'm fairly happy with what the PR does for the build's memory usage.

@krasznaa krasznaa added build This relates to the build system cpu Changes related to CPU code labels Oct 28, 2024
@krasznaa krasznaa force-pushed the DeTemplateTrackFitting-main-20241024 branch 2 times, most recently from 502fec6 to 145d6e1 Compare October 28, 2024 20:00
Copy link
Contributor

@beomki-yeo beomki-yeo left a comment

Choose a reason for hiding this comment

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

There are some naming issues that concern me..

namespace traccc::host {

/// Kalman filter based track fitting algorithm
class kf_algorithm : public algorithm<track_state_container_types::host(
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be just called kalman_fitter instead of kf_algorithm

Copy link
Member Author

Choose a reason for hiding this comment

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

The kalman_fitter fitter class still exists.

🤔 We could call it traccc::host::kalman_fitter_algorithm instead, but since traccc::host::ckf_algorithm already went through, I thought I'd go with this short name here as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is what is exposed to the user directly and naming it into kf_algorithm feels less obvious to me. kalman_fitting_algorithm might work better
ckf_algorithm probably need to be changed to ckf_finding_algorithm or sth else

@@ -0,0 +1,38 @@
/** TRACCC library, part of the ACTS project (R&D line)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think defdet or teldet is very understandable to general users... how about
kalman_fitter_constant_field
kalman_fitter_constant_field_telescope ?

Copy link
Member Author

@krasznaa krasznaa Oct 29, 2024

Choose a reason for hiding this comment

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

I don't have strong feelings about these file names. But keep in mind that users will not be exposed to any of these names. These are just implementation details behind the scenes. That's why I went with relatively cryptic and short names. Because people who are not developers of this code, would not be exposed to these files anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe having more verbosity is going to be helpful for devs as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

We will keep expanding the list of this specialization for different detector and inhomogeneous field
Being cryptic makes the maintenance more difficult I guess

Copy link
Member Author

Choose a reason for hiding this comment

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

As I said, I'm very open to naming these files differently. I'll make this change shortly.

@krasznaa krasznaa force-pushed the DeTemplateTrackFitting-main-20241024 branch 3 times, most recently from 47a7e27 to 6571488 Compare October 31, 2024 13:20
It is a replacement for traccc::fitting_algorithm, without a templated API.
Updating all users to use traccc::host::kf_algorithm instread.
@krasznaa krasznaa force-pushed the DeTemplateTrackFitting-main-20241024 branch from 6571488 to 9b4ecee Compare November 1, 2024 14:28
This way clients can have access to the full details of the
code if they want to, while also getting algorithms that would
perform fitting in one very specific way.
Copy link

sonarcloud bot commented Nov 4, 2024

@krasznaa
Copy link
Member Author

krasznaa commented Nov 4, 2024

Please have a look @paulgessinger. I now still have a specific algorithm interface for performing the fitting "in specific ways", but also expose the template code that would allow clients to do different things as well if they so wished.

I think this design could be extended to the device code as well. 🤔

///
/// @return A container of the fitted track states
///
template <typename fitter_t>
Copy link
Member Author

Choose a reason for hiding this comment

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

We should technically do this with a "fitter concept", but didn't want to pfaff with that in this PR. I'll be happy to let @stephenswat introduce the "fitter concept" anyway. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build This relates to the build system cpu Changes related to CPU code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants