Skip to content

skip test for p2 instance for TF2.12 and above #3812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@
"me-south-1",
"sa-east-1",
"us-west-1",
"ap-northeast-1", # it has p3, but not enough
"ap-south-1",
"ap-northeast-2", # it has p3, but not enough
"us-east-2", # it has p3, but not enough
]

NO_T2_REGIONS = ["eu-north-1", "ap-east-1", "me-south-1"]
Expand Down
8 changes: 8 additions & 0 deletions tests/integ/test_horovod.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
from sagemaker.tensorflow import TensorFlow
from tests.integ import timeout

from packaging.version import Version

horovod_dir = os.path.join(os.path.dirname(__file__), "..", "data", "horovod")


Expand Down Expand Up @@ -58,6 +60,12 @@ def test_hvd_gpu(
tmpdir,
**kwargs,
):
if (
Version(tensorflow_training_latest_version) >= Version("2.12")
and kwargs["instance_type"] == "ml.p2.xlarge"
):
pytest.skip("P2 instances have been deprecated for sagemaker jobs starting TensorFlow 2.12")

_create_and_fit_estimator(
sagemaker_session,
tensorflow_training_latest_version,
Expand Down
19 changes: 19 additions & 0 deletions tests/integ/test_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from tests.integ.utils import gpu_list, retry_with_instance_list
from tests.integ.s3_utils import assert_s3_file_patterns_exist

from packaging.version import Version

ROLE = "SageMakerRole"

Expand Down Expand Up @@ -56,6 +57,12 @@ def test_framework_processing_job_with_deps(
tensorflow_training_latest_py_version,
**kwargs,
):
if (
Version(tensorflow_training_latest_version) >= Version("2.12")
and kwargs["instance_type"] == "ml.p2.xlarge"
):
pytest.skip("P2 instances have been deprecated for sagemaker jobs starting TensorFlow 2.12")

with timeout.timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
code_path = os.path.join(DATA_DIR, "dummy_code_bundle_with_reqs")
entry_point = "main_script.py"
Expand Down Expand Up @@ -187,6 +194,12 @@ def test_mwms_gpu(
capsys,
**kwargs,
):
if (
Version(tensorflow_training_latest_version) >= Version("2.12")
and kwargs["instance_type"] == "ml.p2.xlarge"
):
pytest.skip("P2 instances have been deprecated for sagemaker jobs starting TensorFlow 2.12")

instance_count = 2
estimator = TensorFlow(
source_dir=os.path.join(RESOURCE_PATH, "tensorflow_mnist"),
Expand Down Expand Up @@ -243,6 +256,12 @@ def test_mnist_distributed_gpu(
tensorflow_training_latest_py_version,
**kwargs,
):
if (
Version(tensorflow_training_latest_version) >= Version("2.12")
and kwargs["instance_type"] == "ml.p2.xlarge"
):
pytest.skip("P2 instances have been deprecated for sagemaker jobs starting TensorFlow 2.12")

_create_and_fit_estimator(
sagemaker_session,
tensorflow_training_latest_version,
Expand Down