Skip to content

Commit 791bf0a

Browse files
icywang86ruiRui Wang Napieralski
andauthored
fix: only run DataParallel and EdgePackaging tests in supported regions (#2023)
Co-authored-by: Rui Wang Napieralski <[email protected]>
1 parent 4470dac commit 791bf0a

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

tests/integ/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,18 @@
118118
"eu-south-1",
119119
]
120120
NO_MODEL_MONITORING_REGIONS = ["me-south-1", "af-south-1", "eu-south-1"]
121+
EDGE_PACKAGING_SUPPORTED_REGIONS = [
122+
"us-east-2",
123+
"us-west-2",
124+
"us-east-1",
125+
"eu-west-1",
126+
"ap-northeast-1",
127+
"eu-central-1",
128+
]
129+
# Data parallelism need to be tested with p3.16xlarge.
130+
# The instance type is expensive and not supported in all the regions.
131+
# Limiting the test to run in IAD and CMH
132+
DATA_PARALLEL_TESTING_REGIONS = ["us-east-2", "us-east-1"]
121133

122134

123135
EFS_TEST_ENABLED_REGION = []

tests/integ/test_edge.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717
import pytest
1818

1919
from sagemaker.mxnet.estimator import MXNet
20-
from tests.integ import DATA_DIR, TRAINING_DEFAULT_TIMEOUT_MINUTES
20+
from tests.integ import (
21+
DATA_DIR,
22+
TRAINING_DEFAULT_TIMEOUT_MINUTES,
23+
EDGE_PACKAGING_SUPPORTED_REGIONS,
24+
test_region,
25+
)
2126
from tests.integ.timeout import timeout
2227

2328

@@ -53,6 +58,10 @@ def mxnet_training_job(
5358
return mx.latest_training_job.name
5459

5560

61+
@pytest.mark.skipif(
62+
test_region() not in EDGE_PACKAGING_SUPPORTED_REGIONS,
63+
reason="Edge packaging isn't supported in that specific region.",
64+
)
5665
def test_edge_packaging_job(mxnet_training_job, sagemaker_session):
5766
estimator = MXNet.attach(mxnet_training_job, sagemaker_session=sagemaker_session)
5867
model = estimator.compile_model(

tests/integ/test_smdataparallel_pt.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
import os
1616

17+
import pytest
18+
1719
import sagemaker.utils
1820
import tests.integ as integ
1921

@@ -26,6 +28,10 @@
2628
)
2729

2830

31+
@pytest.mark.skipif(
32+
integ.test_region() not in integ.DATA_PARALLEL_TESTING_REGIONS,
33+
reason="Only allow this test to run in IAD and CMH to limit usage of p3.16xlarge",
34+
)
2935
def test_smdataparallel_pt_mnist(
3036
sagemaker_session,
3137
pytorch_training_latest_version,

tests/integ/test_smdataparallel_tf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
import os
1616

17+
import pytest
18+
1719
import sagemaker.utils
1820
import tests.integ as integ
1921

@@ -25,6 +27,10 @@
2527
)
2628

2729

30+
@pytest.mark.skipif(
31+
integ.test_region() not in integ.DATA_PARALLEL_TESTING_REGIONS,
32+
reason="Only allow this test to run in IAD and CMH to limit usage of p3.16xlarge",
33+
)
2834
def test_smdataparallel_tf_mnist(
2935
sagemaker_session,
3036
tensorflow_training_latest_version,

0 commit comments

Comments
 (0)