Add GPU passthrough for Docker sandboxes#658
Open
shamanez wants to merge 1 commit intoalibaba:masterfrom
Open
Conversation
Author
|
issue - #657 |
385bbaa to
78b2ef8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add server-side sandbox GPU passthrough controls for Docker-backed sandboxes.
This change introduces runtime-config-driven GPU exposure for sandbox containers without changing the current SDK start request shape. It supports:
allordevice=1Motivation
Today ROCK can launch CPU/memory-scoped sandbox containers, but there is no built-in way to expose host GPUs to those containers. In local and agentic training workflows this makes it difficult to run GPU-bound evaluation or tool execution inside the sandbox itself.
This PR ports a previously working local workaround into current upstream so Docker-backed sandboxes can opt into GPU passthrough from ROCK Admin runtime configuration.
What Changed
RuntimeConfigenable_gpu_passthroughgpu_device_requestgpu_allocation_modegpu_count_per_sandboxrock-conf/rock-local.ymlDockerDeploymentto:nvidia-smidocker run --gpus ...NVIDIA_VISIBLE_DEVICES/CUDA_VISIBLE_DEVICESfor deterministic assignmentdocker_argsalready contains--gpusdocker_argsScope / Non-Goals
This PR intentionally stays server-side and config-driven.
It does not yet add:
SandboxConfigSandboxStartRequestThose would be good follow-up work for first-class end-to-end GPU support.
Validation
Passed:
uv run ruff check rock/config.py rock/deployments/docker.py tests/unit/test_config.py tests/unit/rocklet/test_docker_deployment.pyuv run pytest tests/unit/test_config.pyuv run pytest tests/unit/admin/proto/test_sandbox_request.pyuv run pytest tests/unit/rocklet/test_docker_deployment.py::test_build_gpu_args_disabled_by_defaultuv run pytest tests/unit/rocklet/test_docker_deployment.py::test_build_gpu_args_fixed_mode_from_runtimeuv run pytest tests/unit/rocklet/test_docker_deployment.py::test_build_gpu_args_skips_when_docker_args_already_setuv run pytest tests/unit/rocklet/test_docker_deployment.py::test_build_gpu_args_round_robinNot reliable in this environment:
tests/unit/rocklet/test_docker_deployment.py::test_docker_deployment