Skip to content

Skip gpu tests in regions without gpu #461

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 4 commits into from
Nov 7, 2018
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
3 changes: 3 additions & 0 deletions tests/integ/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
import os
import sys

import boto3

DATA_DIR = os.path.join(os.path.dirname(__file__), '..', 'data')
TRAINING_DEFAULT_TIMEOUT_MINUTES = 20
TUNING_DEFAULT_TIMEOUT_MINUTES = 20
TRANSFORM_DEFAULT_TIMEOUT_MINUTES = 20
PYTHON_VERSION = 'py' + str(sys.version_info.major)
REGION = boto3.session.Session().region_name

logging.getLogger('boto3').setLevel(logging.INFO)
logging.getLogger('botocore').setLevel(logging.INFO)
4 changes: 3 additions & 1 deletion tests/integ/test_chainer_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from sagemaker.chainer.estimator import Chainer
from sagemaker.chainer.model import ChainerModel
from sagemaker.utils import sagemaker_timestamp
from tests.integ import DATA_DIR, PYTHON_VERSION, TRAINING_DEFAULT_TIMEOUT_MINUTES
from tests.integ import DATA_DIR, PYTHON_VERSION, TRAINING_DEFAULT_TIMEOUT_MINUTES, REGION
from tests.integ.timeout import timeout, timeout_and_delete_endpoint_by_name


Expand All @@ -35,6 +35,8 @@ def test_distributed_cpu_training(sagemaker_session, chainer_full_version):
_run_mnist_training_job(sagemaker_session, "ml.c4.xlarge", 2, chainer_full_version)


@pytest.mark.skipif(REGION in ['us-west-1', 'eu-west-2', 'ca-central-1'],
reason='No ml.p2.xlarge supported in these regions')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about p3? can't we use p3 then?

Copy link
Contributor Author

@yangaws yangaws Nov 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 is either not supported or supported only by 1/3 of availability zones. So for these 3 regions we just skip tests for now to make canary good for now.

def test_distributed_gpu_training(sagemaker_session, chainer_full_version):
_run_mnist_training_job(sagemaker_session, "ml.p2.xlarge", 2, chainer_full_version)

Expand Down
4 changes: 3 additions & 1 deletion tests/integ/test_pytorch_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from sagemaker.pytorch.estimator import PyTorch
from sagemaker.pytorch.model import PyTorchModel
from sagemaker.utils import sagemaker_timestamp
from tests.integ import DATA_DIR, PYTHON_VERSION, TRAINING_DEFAULT_TIMEOUT_MINUTES
from tests.integ import DATA_DIR, PYTHON_VERSION, TRAINING_DEFAULT_TIMEOUT_MINUTES, REGION
from tests.integ.timeout import timeout, timeout_and_delete_endpoint_by_name

MNIST_DIR = os.path.join(DATA_DIR, 'pytorch_mnist')
Expand Down Expand Up @@ -69,6 +69,8 @@ def test_deploy_model(pytorch_training_job, sagemaker_session):
assert output.shape == (batch_size, 10)


@pytest.mark.skipif(REGION in ['us-west-1', 'eu-west-2', 'ca-central-1'],
reason='No ml.p2.xlarge supported in these regions')
def test_async_fit_deploy(sagemaker_session, pytorch_full_version):
training_job_name = ""
# TODO: add tests against local mode when it's ready to be used
Expand Down
4 changes: 3 additions & 1 deletion tests/integ/test_tf_cifar.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import pytest

from sagemaker.tensorflow import TensorFlow
from tests.integ import DATA_DIR, PYTHON_VERSION
from tests.integ import DATA_DIR, PYTHON_VERSION, REGION
from tests.integ.timeout import timeout_and_delete_endpoint_by_name, timeout

PICKLE_CONTENT_TYPE = 'application/python-pickle'
Expand All @@ -35,6 +35,8 @@ def __call__(self, data):

@pytest.mark.continuous_testing
@pytest.mark.skipif(PYTHON_VERSION != 'py2', reason="TensorFlow image supports only python 2.")
@pytest.mark.skipif(REGION in ['us-west-1', 'eu-west-2', 'ca-central-1'],
reason='No ml.p2.xlarge supported in these regions')
def test_cifar(sagemaker_session, tf_full_version):
with timeout(minutes=45):
script_path = os.path.join(DATA_DIR, 'cifar_10', 'source')
Expand Down
4 changes: 3 additions & 1 deletion tests/integ/test_tf_keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
import pytest

from sagemaker.tensorflow import TensorFlow
from tests.integ import DATA_DIR, PYTHON_VERSION
from tests.integ import DATA_DIR, PYTHON_VERSION, REGION
from tests.integ.timeout import timeout_and_delete_endpoint_by_name, timeout


@pytest.mark.continuous_testing
@pytest.mark.skipif(PYTHON_VERSION != 'py2', reason="TensorFlow image supports only python 2.")
@pytest.mark.skipif(REGION in ['us-west-1', 'eu-west-2', 'ca-central-1'],
reason='No ml.p2.xlarge supported in these regions')
def test_keras(sagemaker_session, tf_full_version):
script_path = os.path.join(DATA_DIR, 'cifar_10', 'source')
dataset_path = os.path.join(DATA_DIR, 'cifar_10', 'data')
Expand Down