Skip to content

Conversation

@StewMH
Copy link
Contributor

@StewMH StewMH commented Nov 18, 2025

Implementation of alpaka on-device magnetic field. This either calls the CUDA or SYCL versions, or a HIP implementation written here. In principle this could be factorised out as well.

Seems to give reasonable results, although not identical track parameters.
1)AMD HIP:

Using Alpaka device: AMD Instinct MI210 [id: 0]
Warm-up processing [==================================================] 100% [00m:00s]
Event processing   [==================================================] 100% [00m:00s]
Reconstructed track parameters: 7107
Time totals:
                  File reading  5 ms
            Warm-up processing  827 ms
              Event processing  7832 ms
Throughput:
            Warm-up processing  82.7008 ms/event, 12.0918 events/s
              Event processing  78.3286 ms/event, 12.7667 events/s

2)NVidia CUDA:

Using Alpaka device: NVIDIA A100 80GB PCIe [id: 0]
Warm-up processing [==================================================] 100% [00m:00s]
Event processing   [==================================================] 100% [00m:00s]
Reconstructed track parameters: 7373
Time totals:
                  File reading  4 ms
            Warm-up processing  429 ms
              Event processing  1843 ms
Throughput:
            Warm-up processing  42.9128 ms/event, 23.3031 events/s
              Event processing  18.4336 ms/event, 54.2489 events/s

3)After some delay, Intel (with FP64 emulation):

Using Alpaka device: Intel(R) Data Center GPU Flex 170 [id: 0]
Reconstructed track parameters: 7212
Time totals:
                  File reading  4 ms
            Warm-up processing  1090842 ms
              Event processing  11936 ms
Throughput:
            Warm-up processing  109084 ms/event, 0.00916723 events/s
              Event processing  119.369 ms/event, 8.37741 events/s

Stewart Martin-Haugh and others added 11 commits November 18, 2025 16:48
Expand on the number of Kalman fit status codes and track fit outcomes to make a more fine-grained distinction between different error types in the Kalman fitter possible. Takes up the improvements in acts-project#1177.

Edit: The wire chamber Kalman fitter test had to be adapted, because more error states are recognized

Edit2: Also fixed the condition of is_complete for the backward fit to point one position below the first state
If the navigation in the forward KF missed a surface, advance the track state iterator correctly (for example if the propagation config between CKF and KF is different or we are running truth fitting). This is only needed for navigators that are not "guided" or "direct".
It also adds an option to the KF to do the full hole count, which is only possible if the propagation starts at the IP and continues through the whole detector, otherwise the first and last holes are missed and the hole count remains an underestimation. Since this will not help in increasing the fit accuracy, but eat more compute resources it will remain optional.
This commit switched the measurement IO code to optionally get the
dimensionality from the detector description rather than from the
measurement input data.
This commit reworks the covariance estimation logic to match that used
in ACTS. It greatly increases the covariances of tracks, hopefully
increasing the tracking efficiency.
The CUDA CI jobs are currently running out of disk space. This commit
builds ACTS separately, as a release build, in order to save space.
This PR is a revival of acts-project#652, removing the obsolete Kokkos and Futhark
code bases.
Did not bother with the host algorithm, because:
  - It's not actively used in any current workflow;
  - It works correctly without this optimization as well.
@StewMH StewMH marked this pull request as ready for review November 27, 2025 11:08
@StewMH
Copy link
Contributor Author

StewMH commented Nov 28, 2025

Think this is ready to merge.

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.

The feature addition in general is great of course. Let's just arrange the code in a better way. 😉

magnetic_field make_magnetic_field(const magnetic_field& bfield,
[[maybe_unused]] const queue& queue) {
#if defined(ALPAKA_ACC_GPU_CUDA_ENABLED)
return traccc::cuda::make_magnetic_field(
Copy link
Member

Choose a reason for hiding this comment

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

I don't like this. 😦 I don't want to make traccc::alpaka depend on traccc::cuda and traccc::sycl.

I would very much prefer duplicating the code from those instead. If you prefer, we could set up some CUDA, SYCL and HIP "utility code" outside of the main libraries. Let's say traccc::cuda_utils or similar. Which could hold utility code like this.

But I definitely don't want to also slow down the CI even further, by the Alpaka build getting even heavier. 🤔

Copy link
Contributor Author

@StewMH StewMH Dec 8, 2025

Choose a reason for hiding this comment

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

OK, I like putting these in sycl_utils and cuda_utils. I will fix that when I come back to this PR.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 8, 2025

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.

4 participants