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

CPU Offload for experts in Runtime #201

Open
mryab opened this issue Mar 29, 2021 · 2 comments
Open

CPU Offload for experts in Runtime #201

mryab opened this issue Mar 29, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@mryab
Copy link
Member

mryab commented Mar 29, 2021

Given that we're only requesting one expert in the server at a time, it might be possible to keep many experts in CPU memory and to process larger batches in a single step as a result. Since we know the upcoming request queue, we can also prefetch the experts that are going to be required to minimize the latency.

@mryab mryab added the enhancement New feature or request label Mar 29, 2021
@mryab mryab self-assigned this Mar 29, 2021
@mryab mryab changed the title CPU Offload for experts CPU Offload for experts in Runtime Mar 29, 2021
@justheuristic
Copy link
Member

As a side-note: we could also probably load experts into multiple GPUs and process them concurrently.

@justheuristic
Copy link
Member

TIL: torch has a great mechanism for asynchronous offloading called torch.cuda.stream

Here's an example of how it works:
https://github.com/facebookresearch/fairscale/blob/8d82db43eca3c6d88f02c60bce5ba80177d2cf12/fairscale/experimental/nn/offload.py#L128-L129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants