BentoML icon indicating copy to clipboard operation
BentoML copied to clipboard

feature: How to use multi GPU

Open Euraxluo opened this issue 10 months ago • 3 comments

Feature request

An example of a model that uses multiple gpus at the same time, or we should have a way to make this easy to use

Motivation

No response

Other

No response

Euraxluo avatar Feb 20 '25 03:02 Euraxluo

@bentoml.service(resources={"gpu": 4})
class MyService:
    ...

And it will inject CUDA_VISIBLE_DEVICES=0,1,2,3 into the environment

frostming avatar Feb 20 '25 03:02 frostming

Will it automatically schedule and use all gpus at the same time?

Euraxluo avatar Feb 25 '25 01:02 Euraxluo

What automation do you mean, that is all it does and it depends on how the framework respects the env var.

frostming avatar Feb 25 '25 01:02 frostming