Skip to content

Commit 8df13cb

Browse files
skip test for p2
1 parent 2bac010 commit 8df13cb

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

tests/integ/test_horovod.py

Lines changed: 10 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,14 @@ 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(
68+
f"P2 instances have been deprecated for sagemaker jobs starting TensorFlow 2.12"
69+
)
70+
6171
_create_and_fit_estimator(
6272
sagemaker_session,
6373
tensorflow_training_latest_version,

tests/integ/test_tf.py

Lines changed: 25 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,14 @@ 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(
65+
f"P2 instances have been deprecated for sagemaker jobs starting TensorFlow 2.12"
66+
)
67+
5968
with timeout.timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
6069
code_path = os.path.join(DATA_DIR, "dummy_code_bundle_with_reqs")
6170
entry_point = "main_script.py"
@@ -187,6 +196,14 @@ def test_mwms_gpu(
187196
capsys,
188197
**kwargs,
189198
):
199+
if (
200+
Version(tensorflow_training_latest_version) >= Version("2.12")
201+
and kwargs["instance_type"] == "ml.p2.xlarge"
202+
):
203+
pytest.skip(
204+
f"P2 instances have been deprecated for sagemaker jobs starting TensorFlow 2.12"
205+
)
206+
190207
instance_count = 2
191208
estimator = TensorFlow(
192209
source_dir=os.path.join(RESOURCE_PATH, "tensorflow_mnist"),
@@ -243,6 +260,14 @@ def test_mnist_distributed_gpu(
243260
tensorflow_training_latest_py_version,
244261
**kwargs,
245262
):
263+
if (
264+
Version(tensorflow_training_latest_version) >= Version("2.12")
265+
and kwargs["instance_type"] == "ml.p2.xlarge"
266+
):
267+
pytest.skip(
268+
f"P2 instances have been deprecated for sagemaker jobs starting TensorFlow 2.12"
269+
)
270+
246271
_create_and_fit_estimator(
247272
sagemaker_session,
248273
tensorflow_training_latest_version,

0 commit comments

Comments
 (0)