Skip to content

Commit 8ac6ca8

Browse files
skip test for p2 instance for TF2.12 and above (#3812)
1 parent b6a7439 commit 8ac6ca8

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

tests/conftest.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@
5252
"me-south-1",
5353
"sa-east-1",
5454
"us-west-1",
55-
"ap-northeast-1", # it has p3, but not enough
56-
"ap-south-1",
57-
"ap-northeast-2", # it has p3, but not enough
58-
"us-east-2", # it has p3, but not enough
5955
]
6056

6157
NO_T2_REGIONS = ["eu-north-1", "ap-east-1", "me-south-1"]

tests/integ/test_horovod.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
from sagemaker.tensorflow import TensorFlow
2525
from tests.integ import timeout
2626

27+
from packaging.version import Version
28+
2729
horovod_dir = os.path.join(os.path.dirname(__file__), "..", "data", "horovod")
2830

2931

@@ -58,6 +60,12 @@ def test_hvd_gpu(
5860
tmpdir,
5961
**kwargs,
6062
):
63+
if (
64+
Version(tensorflow_training_latest_version) >= Version("2.12")
65+
and kwargs["instance_type"] == "ml.p2.xlarge"
66+
):
67+
pytest.skip("P2 instances have been deprecated for sagemaker jobs starting TensorFlow 2.12")
68+
6169
_create_and_fit_estimator(
6270
sagemaker_session,
6371
tensorflow_training_latest_version,

tests/integ/test_tf.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from tests.integ.utils import gpu_list, retry_with_instance_list
2929
from tests.integ.s3_utils import assert_s3_file_patterns_exist
3030

31+
from packaging.version import Version
3132

3233
ROLE = "SageMakerRole"
3334

@@ -56,6 +57,12 @@ def test_framework_processing_job_with_deps(
5657
tensorflow_training_latest_py_version,
5758
**kwargs,
5859
):
60+
if (
61+
Version(tensorflow_training_latest_version) >= Version("2.12")
62+
and kwargs["instance_type"] == "ml.p2.xlarge"
63+
):
64+
pytest.skip("P2 instances have been deprecated for sagemaker jobs starting TensorFlow 2.12")
65+
5966
with timeout.timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
6067
code_path = os.path.join(DATA_DIR, "dummy_code_bundle_with_reqs")
6168
entry_point = "main_script.py"
@@ -187,6 +194,12 @@ def test_mwms_gpu(
187194
capsys,
188195
**kwargs,
189196
):
197+
if (
198+
Version(tensorflow_training_latest_version) >= Version("2.12")
199+
and kwargs["instance_type"] == "ml.p2.xlarge"
200+
):
201+
pytest.skip("P2 instances have been deprecated for sagemaker jobs starting TensorFlow 2.12")
202+
190203
instance_count = 2
191204
estimator = TensorFlow(
192205
source_dir=os.path.join(RESOURCE_PATH, "tensorflow_mnist"),
@@ -243,6 +256,12 @@ def test_mnist_distributed_gpu(
243256
tensorflow_training_latest_py_version,
244257
**kwargs,
245258
):
259+
if (
260+
Version(tensorflow_training_latest_version) >= Version("2.12")
261+
and kwargs["instance_type"] == "ml.p2.xlarge"
262+
):
263+
pytest.skip("P2 instances have been deprecated for sagemaker jobs starting TensorFlow 2.12")
264+
246265
_create_and_fit_estimator(
247266
sagemaker_session,
248267
tensorflow_training_latest_version,

0 commit comments

Comments
 (0)