Skip to content

Commit 53e1a83

Browse files
author
Shibo Xing
committed
fix: p2 issue for test_pytorch_training
1 parent 42d8b6f commit 53e1a83

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/unit/sagemaker/image_uris/test_dlc_frameworks.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from tests.unit.sagemaker.image_uris import expected_uris
1919

2020
INSTANCE_TYPES_AND_PROCESSORS = (("ml.c4.xlarge", "cpu"), ("ml.p2.xlarge", "gpu"))
21+
RENEWED_PYTORCH_INSTANCE_TYPES_AND_PROCESSORS = (("ml.c4.xlarge", "cpu"), ("ml.g4dn.xlarge", "gpu"))
2122
REGION = "us-west-2"
2223

2324
DLC_ACCOUNT = "763104351884"
@@ -70,7 +71,12 @@ def _test_image_uris(
7071
"image_scope": scope,
7172
}
7273

73-
for instance_type, processor in INSTANCE_TYPES_AND_PROCESSORS:
74+
TYPES_AND_PROCESSORS = INSTANCE_TYPES_AND_PROCESSORS
75+
if framework == "pytorch" and Version(fw_version) >= Version("1.13"):
76+
'''Handle P2 deprecation'''
77+
TYPES_AND_PROCESSORS = RENEWED_PYTORCH_INSTANCE_TYPES_AND_PROCESSORS
78+
79+
for instance_type, processor in TYPES_AND_PROCESSORS:
7480
uri = image_uris.retrieve(region=REGION, instance_type=instance_type, **base_args)
7581

7682
expected = expected_fn(processor=processor, **expected_fn_args)

0 commit comments

Comments
 (0)