Skip to content

change: remove unnecessary P3 tests from TFS integration tests #885

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 3 commits into from
Jun 26, 2019
Merged
Changes from 2 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
27 changes: 4 additions & 23 deletions tests/integ/test_tfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,8 @@
from sagemaker.tensorflow.serving import Model, Predictor


@pytest.fixture(
scope="session",
params=[
"ml.c5.xlarge",
pytest.param(
"ml.p3.2xlarge",
marks=pytest.mark.skipif(
tests.integ.test_region() in tests.integ.HOSTING_NO_P3_REGIONS,
reason="no ml.p3 instances in this region",
),
),
],
)
def instance_type(request):
return request.param


@pytest.fixture(scope="module")
def tfs_predictor(instance_type, sagemaker_session, tf_full_version):
def tfs_predictor(sagemaker_session, tf_full_version):
endpoint_name = sagemaker.utils.unique_name_from_base("sagemaker-tensorflow-serving")
model_data = sagemaker_session.upload_data(
path=os.path.join(tests.integ.DATA_DIR, "tensorflow-serving-test-model.tar.gz"),
Expand All @@ -57,7 +40,7 @@ def tfs_predictor(instance_type, sagemaker_session, tf_full_version):
framework_version=tf_full_version,
sagemaker_session=sagemaker_session,
)
predictor = model.deploy(1, instance_type, endpoint_name=endpoint_name)
predictor = model.deploy(1, "ml.c5.xlarge", endpoint_name=endpoint_name)
yield predictor


Expand Down Expand Up @@ -130,8 +113,6 @@ def tfs_predictor_with_model_and_entry_point_and_dependencies(
@pytest.fixture(scope="module")
def tfs_predictor_with_accelerator(sagemaker_session, tf_full_version):
endpoint_name = sagemaker.utils.unique_name_from_base("sagemaker-tensorflow-serving")
instance_type = "ml.c4.large"
accelerator_type = "ml.eia1.medium"
model_data = sagemaker_session.upload_data(
path=os.path.join(tests.integ.DATA_DIR, "tensorflow-serving-test-model.tar.gz"),
key_prefix="tensorflow-serving/models",
Expand All @@ -144,13 +125,13 @@ def tfs_predictor_with_accelerator(sagemaker_session, tf_full_version):
sagemaker_session=sagemaker_session,
)
predictor = model.deploy(
1, instance_type, endpoint_name=endpoint_name, accelerator_type=accelerator_type
1, "ml.c4.large", endpoint_name=endpoint_name, accelerator_type="ml.eia1.medium"
)
yield predictor


@pytest.mark.canary_quick
def test_predict(tfs_predictor, instance_type): # pylint: disable=W0613
def test_predict(tfs_predictor): # pylint: disable=W0613
input_data = {"instances": [1.0, 2.0, 5.0]}
expected_result = {"predictions": [3.5, 4.0, 5.5]}

Expand Down