Skip to content

Support fractional GPU usage. #402

@robertnishihara

Description

@robertnishihara

It is common for multiple users of the same machine to share a single GPU. For example, several users may each train their own neural net on the same GPU, and as long as the aggregate memory usage does not exceed the GPU memory, then this should work out.

Some thoughts and questions.

  1. What's the best way to support this in the API? For example, something like

    @ray.remote(num_gpus=0.5)
    def f():
      ...
  2. It's more or less clear what to do if the user requests less than one GPU, but what if they request 1.5 GPUs. For that to be meaningful the specification would probably have to be more specific (for example, 3/4 of 2 GPUs, or 1 full GPU and 1/2 of another GPU). Does this come up in practice? Or should we just not support this case?

  3. Presumably it'd be the responsibility of the user to not actually user more than 1/2 GPU if that's what the task requested. It probably wouldn't be super easy for Ray to enforce this. If the task does use more, then at worst this should cause that task to fail (and possibly any other task that was using the same GPU). Ideally the failure would take the form of a Python exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions