Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid host allocations for by-offload arguments to GPU kernels (chape…
…l-lang#24970) This PR addresses a performance issue first noted by @stonea in the context of Coral. Today, I had a chat with @Guillaume-Helbecque who was also suffering partly from it. This issue arises when: 1. multiple GPUs in a node are used, and 2. LICM is not able to peel off the array metadata before we generate the GPU kernel When (2), we pass arrays by offload -- we copy the record onto GPU memory and pass that record as an argument to the kernel. This involves allocating memory for the record on device-accessible memory. Now, most likely because oversight (on my part), that allocation is done on page-locked host memory instead. (Probably because I was thinking that object instances should be host-accessible so that they can be initialized, but we're talking about an already initialized record that we'll bit-copy anyways). Page-locked allocations are globally synchronous. In other words, they will block all other GPUs, or be blocked until all other GPUs are free. That is why this is especially problematic with (1). This PR adjusts the memory allocation to be on device memory proper. Resolves chapel-lang#24936 [Reviewed by @stonea] Test: - [x] nvidia - [x] amd - [x] some EX testing as I noted it to be problematic in the past
- Loading branch information