Skip to content

Commit db26497

Browse files
gverkesjiapinw
authored andcommitted
fix: make sure gpus are found in local_gpu run (aws#4384)
* fix: make sure gpus are found in local_gpu run * fix: black formatting * fix: adjust unit test
1 parent ca0fb0b commit db26497

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/sagemaker/local/image.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,9 @@ def _create_docker_host(
860860
# to setting --runtime=nvidia in the docker commandline.
861861
if self.instance_type == "local_gpu":
862862
host_config["deploy"] = {
863-
"resources": {"reservations": {"devices": [{"capabilities": ["gpu"]}]}}
863+
"resources": {
864+
"reservations": {"devices": [{"count": "all", "capabilities": ["gpu"]}]}
865+
}
864866
}
865867

866868
if not self.is_studio and command == "serve":

tests/unit/sagemaker/local/test_local_image.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ def test_container_has_gpu_support(tmpdir, sagemaker_session):
871871
docker_host = sagemaker_container._create_docker_host("host-1", {}, set(), "train", [])
872872
assert "deploy" in docker_host
873873
assert docker_host["deploy"] == {
874-
"resources": {"reservations": {"devices": [{"capabilities": ["gpu"]}]}}
874+
"resources": {"reservations": {"devices": [{"count": "all", "capabilities": ["gpu"]}]}}
875875
}
876876

877877

0 commit comments

Comments
 (0)