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

Avoid host allocations for by-offload arguments to GPU kernels #24970

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

e-kayrakli
Copy link
Contributor

@e-kayrakli e-kayrakli commented May 2, 2024

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.

Test:

  • nvidia
  • amd
  • some EX testing as I noted it to be problematic in the past

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.

None yet

1 participant