BentoML icon indicating copy to clipboard operation
BentoML copied to clipboard

feat: explicit GPU runner mappings

Open jjmachan opened this issue 1 year ago • 3 comments

What does this PR address?

Fixes #2770 With this change, the NvidiaGpuResource will accept and return a list that specifies the exact GPUs to use. This enables the user to configure exactly which GPU to map to each runner worker.

runners:
  resources: 
    nvidia.com/gpu: 4 => still valid but will be automatically converted to use GPUs [0, 1, 2, 3] internally.
  resources: 
    nvidia.com/gpu: [2, 4] => only use GPU [2, 4] for runner worker 1 and 2

Before submitting:

Who can help review?

Feel free to tag members/contributors who can help review your PR.

jjmachan avatar Aug 04 '22 19:08 jjmachan

Codecov Report

Merging #2862 (9439bc3) into main (9305132) will increase coverage by 0.16%. The diff coverage is 95.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2862      +/-   ##
==========================================
+ Coverage   70.10%   70.27%   +0.16%     
==========================================
  Files         114      120       +6     
  Lines        9811     9782      -29     
==========================================
- Hits         6878     6874       -4     
+ Misses       2933     2908      -25     
Impacted Files Coverage Δ
bentoml/_internal/resource.py 76.96% <95.45%> (+0.86%) :arrow_up:
bentoml/_internal/runner/strategy.py 93.10% <100.00%> (+18.96%) :arrow_up:
bentoml/_internal/utils/formparser.py 20.00% <0.00%> (-57.94%) :arrow_down:
bentoml/_internal/runner/utils.py 90.16% <0.00%> (-1.70%) :arrow_down:
bentoml/_internal/bento/build_config.py 67.62% <0.00%> (-0.60%) :arrow_down:
bentoml/_internal/runner/runner_handle/remote.py 88.17% <0.00%> (-0.13%) :arrow_down:
bentoml/_internal/server/service_app.py 87.94% <0.00%> (-0.09%) :arrow_down:
bentoml/_internal/cli/bento_management.py
bentoml/_internal/server/cli/dev_api_server.py
bentoml/_internal/service/openapi.py
... and 50 more

codecov[bot] avatar Aug 04 '22 19:08 codecov[bot]

Let me know if the change to the resource config is okay and if it is, I'll update the configuration guide too, talking about how we can configure each runner specifically

jjmachan avatar Aug 05 '22 07:08 jjmachan

Hello @jjmachan, Thanks for updating this PR.

There are currently no PEP 8 issues detected in this PR. Cheers! :beers:

Comment last updated at 2022-08-10 19:00:29 UTC

pep8speaks avatar Aug 08 '22 10:08 pep8speaks