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

Add support for unified memory #296

Open
BenjaminW3 opened this issue Dec 14, 2016 · 3 comments
Open

Add support for unified memory #296

BenjaminW3 opened this issue Dec 14, 2016 · 3 comments

Comments

@BenjaminW3
Copy link
Member

cudaMalloc -> cudaMallocManaged
cudaMemcpy -> cudaMemPrefetchAsync
cudaMemAdvice for pinning?
The alloc function currently takes a device. If this is DevGpuCuda, the Cuda versions are called. We would need something like a MemSpace to allow to select the memory space on a per allocation base (Gpu only vs unified).

@bussmann
Copy link

Surely, memory access and allocation need better care in Alpaka.

@bernhardmgruber
Copy link
Member

I was at a CUDA introductory lesson for summer students at CERN last week, and unified memory was taught as a recommended practice now. I asked the lecturer about it and they said, they base their judgement on some collaborating HPC institutes. According to their measurements, using unified memory and async prefetching is at least as fast as ordinary host/device memory + memcpy, for complex kernels and access patterns potentially faster. And it's easier to program. This kept me thinking about the lack of support for this in alpaka :)

@fwyzard
Copy link
Contributor

fwyzard commented Aug 7, 2023

Eh... we have direct observation of the opposite: unified memory with explicit prefetching was still slower than explicit memory copies last time we tried it.

Still, it's something we've been considering, and we have had some internal discussion of what it could look like in alpaka to be easy to adopt for CMS.

I will try to find back my notes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants