Skip to content

Commit dba0ef9

Browse files
chuyang-dengDeng
andauthored
feature: add EIA support for TFS 1.15.0 and 2.0.0 (aws#1436)
Co-authored-by: Deng <[email protected]>
1 parent 3bf569e commit dba0ef9

File tree

7 files changed

+16
-12
lines changed

7 files changed

+16
-12
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ By using TensorFlow SageMaker Estimators, you can train and host TensorFlow mode
215215

216216
Supported versions of TensorFlow: ``1.4.1``, ``1.5.0``, ``1.6.0``, ``1.7.0``, ``1.8.0``, ``1.9.0``, ``1.10.0``, ``1.11.0``, ``1.12.0``, ``1.13.1``, ``1.14.0``, ``1.15.0``, ``1.15.2``, ``2.0.0``, ``2.0.1``, ``2.1.0``.
217217

218-
Supported versions of TensorFlow for Elastic Inference: ``1.11.0``, ``1.12.0``, ``1.13.1``, ``1.14.0``.
218+
Supported versions of TensorFlow for Elastic Inference: ``1.11.0``, ``1.12.0``, ``1.13.1``, ``1.14.0``, ``1.15.0``, ``2.0.0``.
219219

220220
We recommend that you use the latest supported version, because that's where we focus most of our development efforts.
221221

src/sagemaker/tensorflow/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Documentation of the previous Legacy Mode versions: `1.4.1 <https://github.com/a
2020
| You can find the Legacy Mode README `here <https://github.com/aws/sagemaker-python-sdk/tree/v1.12.0/src/sagemaker/tensorflow#tensorflow-sagemaker-estimators-and-models>`_. |
2121
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2222

23-
Supported versions of TensorFlow for Elastic Inference: ``1.11``, ``1.12``, ``1.13``, ``1.14``.
23+
Supported versions of TensorFlow for Elastic Inference: ``1.11``, ``1.12``, ``1.13``, ``1.14``, ``1.15``, ``2.0``.
2424

2525
Supported versions of TensorFlow for Inferentia: ``1.15.0``.
2626

src/sagemaker/tensorflow/serving.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class Model(sagemaker.model.FrameworkModel):
130130
logging.ERROR: "error",
131131
logging.CRITICAL: "crit",
132132
}
133-
LATEST_EIA_VERSION = [1, 14]
133+
LATEST_EIA_VERSION = [2, 0]
134134

135135
def __init__(
136136
self,

tests/conftest.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def pytest_addoption(parser):
6565
)
6666
parser.addoption("--sklearn-full-version", action="store", default=SKLEARN_VERSION)
6767
parser.addoption("--tf-full-version", action="store")
68-
parser.addoption("--ei-tf-full-version", action="store", default=TensorFlow.LATEST_VERSION)
68+
parser.addoption("--ei-tf-full-version", action="store")
6969
parser.addoption("--xgboost-full-version", action="store", default=SKLEARN_VERSION)
7070

7171

@@ -268,9 +268,13 @@ def tf_full_version(request):
268268
return tf_version
269269

270270

271-
@pytest.fixture(scope="module")
271+
@pytest.fixture(scope="module", params=["1.15.0", "2.0.0"])
272272
def ei_tf_full_version(request):
273-
return request.config.getoption("--ei-tf-full-version")
273+
tf_ei_version = request.config.getoption("--ei-tf-full-version")
274+
if tf_ei_version is None:
275+
return request.param
276+
else:
277+
tf_ei_version
274278

275279

276280
@pytest.fixture(scope="session")

tests/integ/test_tfs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def tfs_predictor_with_model_and_entry_point_and_dependencies(
111111

112112

113113
@pytest.fixture(scope="module")
114-
def tfs_predictor_with_accelerator(sagemaker_session, tf_full_version, cpu_instance_type):
114+
def tfs_predictor_with_accelerator(sagemaker_session, ei_tf_full_version, cpu_instance_type):
115115
endpoint_name = sagemaker.utils.unique_name_from_base("sagemaker-tensorflow-serving")
116116
model_data = sagemaker_session.upload_data(
117117
path=os.path.join(tests.integ.DATA_DIR, "tensorflow-serving-test-model.tar.gz"),
@@ -121,7 +121,7 @@ def tfs_predictor_with_accelerator(sagemaker_session, tf_full_version, cpu_insta
121121
model = Model(
122122
model_data=model_data,
123123
role="SageMakerRole",
124-
framework_version="1.14",
124+
framework_version=ei_tf_full_version,
125125
sagemaker_session=sagemaker_session,
126126
)
127127
predictor = model.deploy(

tests/unit/test_fw_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,13 @@ def test_tf_eia_images():
302302
"us-west-2",
303303
"tensorflow-serving",
304304
"ml.m4.xlarge",
305-
"1.14.0",
305+
"2.0.0",
306306
"py3",
307307
accelerator_type="ml.eia1.medium",
308308
)
309309
assert (
310310
image_uri
311-
== "{}.dkr.ecr.us-west-2.amazonaws.com/tensorflow-inference-eia:1.14.0-cpu".format(
311+
== "{}.dkr.ecr.us-west-2.amazonaws.com/tensorflow-inference-eia:2.0.0-cpu".format(
312312
fw_utils.ASIMOV_PROD_ACCOUNT
313313
)
314314
)

tests/unit/test_tfs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def test_tfs_model_image_accelerator_not_supported(sagemaker_session):
115115
model = Model(
116116
"s3://some/data.tar.gz",
117117
role=ROLE,
118-
framework_version="1.15",
118+
framework_version="2.1",
119119
sagemaker_session=sagemaker_session,
120120
)
121121

@@ -130,7 +130,7 @@ def test_tfs_model_image_accelerator_not_supported(sagemaker_session):
130130
initial_instance_count=1,
131131
)
132132

133-
assert str(e.value) == "The TensorFlow version 1.15 doesn't support EIA."
133+
assert str(e.value) == "The TensorFlow version 2.1 doesn't support EIA."
134134

135135

136136
def test_tfs_model_with_log_level(sagemaker_session, tf_version):

0 commit comments

Comments
 (0)