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

exceeds register size error when building with SYCL backend #593

Open
XzzX opened this issue Nov 17, 2022 · 4 comments
Open

exceeds register size error when building with SYCL backend #593

XzzX opened this issue Nov 17, 2022 · 4 comments

Comments

@XzzX
Copy link
Contributor

XzzX commented Nov 17, 2022

When using AoSoA datastructure and slices Intel compilers will exceeds register size when building with SYCL backend for Intel GPUs.

With the help of @igorvorobtsov, the problem was identified being the labels. Labels in Cabana are stored as char arrays. The Intel compiler will expand each char to 4 bytes for alignment reasons. By passing slices by value to kernels this can exceed the register size.

@XzzX
Copy link
Contributor Author

XzzX commented Dec 7, 2022

Any progress here?

@streeve
Copy link
Member

streeve commented Dec 15, 2022

Sorry about the delay on this.

First, for background (briefly discussed on slack) each Cabana::slice is an unmanaged Kokkos::View for one field in the AoSoA. Since it's only pointing to existing data and nothing else unmanaged Views do not hold a label. We took the opposite approach and store char array labels in slices assuming they're useful, but we could revisit that

I haven't been able to reproduce in my most recent builds, but this sounds like it's at the application level. Do you see this in any in-repo tests or examples (and if not can you give more detail on what your kernel looks like)?

For fixing this, my first attempts were to use the same strategy as Kokkos managed View labels, but I haven't gotten that working yet. If it's useful we could also add a new slice variant without labels which are identified by their AoSoA index only.

As a different approach, we also have a new option Cabana::ParticleList (that needs more documentation/examples) for managing particle fields with type tags and getting data at the particle (thread) level instead of separate slice fields for all particles

Last, adding @masterleinad here who has led the Kokkos SYCL backend development to see if he has suggestions

@masterleinad
Copy link
Contributor

I don't have much to add. You could try explicitly copying the kernel by swapping all defined(KOKKOS_ARCH_INTEL_GPU) with 0 in https://github.com/kokkos/kokkos/blob/5ad609661e570ba6aa7716a26a91cb67d559f8a2/core/src/SYCL/Kokkos_SYCL_Instance.hpp#L246-L354.

@XzzX
Copy link
Contributor Author

XzzX commented Dec 19, 2022

Dockerfile.txt
The error can be reproduced with this Dockerfile.
It also has some warnings that can be ignored, i.e. MPI mismatch with HDF5 and floating point warnings.

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

No branches or pull requests

3 participants