Skip to content

Commit 0cca8a0

Browse files
fix unit test
1 parent 9cd3631 commit 0cca8a0

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

src/sagemaker/image_uris.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -369,20 +369,15 @@ def _config_for_framework_and_scope(framework, image_scope, accelerator_type=Non
369369

370370
def _validate_instance_deprecation(framework, instance_type, version):
371371
"""Check if instance type is deprecated for a certain framework with a certain version"""
372-
if (
373-
framework == "pytorch"
374-
and _get_instance_type_family(instance_type) == "p2"
375-
and Version(version) >= Version("1.13")
376-
) or (
377-
framework == "tensorflow"
378-
and _get_instance_type_family(instance_type) == "p2"
379-
and Version(version) >= Version("2.12")
380-
):
381-
raise ValueError(
382-
"P2 instances have been deprecated for sagemaker jobs starting PyTorch 1.13 and TensorFlow 2.12"
383-
"For information about supported instance types please refer to "
384-
"https://aws.amazon.com/sagemaker/pricing/"
385-
)
372+
if _get_instance_type_family(instance_type) == "p2":
373+
if (framework == "pytorch" and Version(version) >= Version("1.13")) or (
374+
framework == "tensorflow" and Version(version) >= Version("2.12")
375+
):
376+
raise ValueError(
377+
"P2 instances have been deprecated for sagemaker jobs starting PyTorch 1.13 and TensorFlow 2.12"
378+
"For information about supported instance types please refer to "
379+
"https://aws.amazon.com/sagemaker/pricing/"
380+
)
386381

387382

388383
def _validate_for_suppported_frameworks_and_instance_type(framework, instance_type):

0 commit comments

Comments
 (0)