BentoML
BentoML copied to clipboard
feat: explicit GPU runner mappings
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:
- [ ] Does the Pull Request follow Conventional Commits specification naming? Here are GitHub's guide on how to create a pull request.
- [ ] Does the code follow BentoML's code style, both
make format
andmake lint
script have passed (instructions)? - [ ] Did you read through contribution guidelines and follow development guidelines?
- [ ] Did your changes require updates to the documentation? Have you updated those accordingly? Here are documentation guidelines and tips on writting docs.
- [ ] Did you write tests to cover your changes?
Who can help review?
Feel free to tag members/contributors who can help review your PR.
Codecov Report
Merging #2862 (9439bc3) into main (9305132) will increase coverage by
0.16%
. The diff coverage is95.83%
.
@@ 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 |
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
Hello @jjmachan, Thanks for updating this PR.
There are currently no PEP 8 issues detected in this PR. Cheers! :beers: