Repository navigation
Conversation
Contributor
Author
|
Completed the xtrack tests on an MI50 (gfx906) and an MI100 (gfx908) without any noteworthy backend failures using CuPy 14.1.1 (AMD's fork) on ROCm 10. Apptainer definitions used:
In the tests the xobjects and xtrack versions were swapped out with the branches in this PR as well as the corresponding xtrack PR: xsuite/xtrack#954 |
Contributor
Author
|
The aggressive inlining ( Output from MI100Output from MI50Output from Radeon VII |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
On AMD GPUs (CuPy with ROCm), tracking was ~2x slower than with the OpenCL context. This PR fixes that, makes HIPRTC compile cleanly, and adds an optional setting for faster kernels.
Changes
1. Tell HIPRTC the real block size (main fix)
HIPRTC assumes a kernel may run with up to 1024 threads per block. On CDNA GPUs that limits each thread to 128 registers, so large kernels spill heavily to scratch memory. AMD's OpenCL compiler assumes 256, which is why OpenCL was faster.
xobjects always launches kernels with
default_block_size, on HIP we now pass--gpu-max-threads-per-block={default_block_size}.2. Fixed-width integer typedefs
HIPRTC already provides
int64_tetc., so redefining them caused compilation errors. The typedefs incudaheaderandatomicadd.hare now limited to NVRTC.3. New opt-in setting
rocm_fast_kernels/XSUITE_ROCM_FAST_KERNELS(default off)When enabled on HIP, it adds
-mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false. This inlines every device function, removing real calls. The trade-offs are much slower compilation and more memory, so the setting is off by default and prints a warning when enabled. It is ignored on CUDA, with a warning.Results
MI100 (gfx908) using sample script with 1e6 particles x 1000 turns:
XSUITE_ROCM_FAST_KERNELS=1Checklist
Mandatory:
Optional: