Skip to content

Commit d540006

Browse files
feature: add MXNet 1.7.0 images (#1888)
* feat: add MXNet 1.7.0 to image_uri_config * update mxnet_py_version test fixtures * update usage of mxnet_py_version test fixtures * format with black * format with black * fix flake8 violation * format with black * black line length 100 Co-authored-by: Chuyang <[email protected]>
1 parent 0aa443f commit d540006

File tree

4 files changed

+129
-39
lines changed

4 files changed

+129
-39
lines changed

src/sagemaker/image_uri_config/mxnet.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,36 @@
280280
},
281281
"repository": "mxnet-training",
282282
"py_versions": ["py2", "py3"]
283+
},
284+
"1.7.0": {
285+
"registries": {
286+
"af-south-1": "626614931356",
287+
"ap-east-1": "871362719292",
288+
"ap-northeast-1": "763104351884",
289+
"ap-northeast-2": "763104351884",
290+
"ap-south-1": "763104351884",
291+
"ap-southeast-1": "763104351884",
292+
"ap-southeast-2": "763104351884",
293+
"ca-central-1": "763104351884",
294+
"cn-north-1": "727897471807",
295+
"cn-northwest-1": "727897471807",
296+
"eu-central-1": "763104351884",
297+
"eu-north-1": "763104351884",
298+
"eu-west-1": "763104351884",
299+
"eu-west-2": "763104351884",
300+
"eu-west-3": "763104351884",
301+
"eu-south-1": "692866216735",
302+
"me-south-1": "217643126080",
303+
"sa-east-1": "763104351884",
304+
"us-east-1": "763104351884",
305+
"us-east-2": "763104351884",
306+
"us-gov-west-1": "442386744353",
307+
"us-iso-east-1": "886529160074",
308+
"us-west-1": "763104351884",
309+
"us-west-2": "763104351884"
310+
},
311+
"repository": "mxnet-training",
312+
"py_versions": ["py3"]
283313
}
284314
}
285315
},
@@ -564,6 +594,36 @@
564594
},
565595
"repository": "mxnet-inference",
566596
"py_versions": ["py2", "py3"]
597+
},
598+
"1.7.0": {
599+
"registries": {
600+
"af-south-1": "626614931356",
601+
"ap-east-1": "871362719292",
602+
"ap-northeast-1": "763104351884",
603+
"ap-northeast-2": "763104351884",
604+
"ap-south-1": "763104351884",
605+
"ap-southeast-1": "763104351884",
606+
"ap-southeast-2": "763104351884",
607+
"ca-central-1": "763104351884",
608+
"cn-north-1": "727897471807",
609+
"cn-northwest-1": "727897471807",
610+
"eu-central-1": "763104351884",
611+
"eu-north-1": "763104351884",
612+
"eu-west-1": "763104351884",
613+
"eu-west-2": "763104351884",
614+
"eu-west-3": "763104351884",
615+
"eu-south-1": "692866216735",
616+
"me-south-1": "217643126080",
617+
"sa-east-1": "763104351884",
618+
"us-east-1": "763104351884",
619+
"us-east-2": "763104351884",
620+
"us-gov-west-1": "442386744353",
621+
"us-iso-east-1": "886529160074",
622+
"us-west-1": "763104351884",
623+
"us-west-2": "763104351884"
624+
},
625+
"repository": "mxnet-inference",
626+
"py_versions": ["py3"]
567627
}
568628
}
569629
},

tests/conftest.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,23 @@ def chainer_py_version(request):
135135

136136

137137
@pytest.fixture(scope="module", params=["py2", "py3"])
138-
def mxnet_py_version(request):
138+
def mxnet_inference_py_version(mxnet_inference_version, request):
139+
if Version(mxnet_inference_version) < Version("1.7.0"):
140+
return request.param
141+
else:
142+
return "py3"
143+
144+
145+
@pytest.fixture(scope="module", params=["py2", "py3"])
146+
def mxnet_training_py_version(mxnet_training_version, request):
147+
if Version(mxnet_training_version) < Version("1.7.0"):
148+
return request.param
149+
else:
150+
return "py3"
151+
152+
153+
@pytest.fixture(scope="module", params=["py2", "py3"])
154+
def mxnet_eia_py_version(request):
139155
return request.param
140156

141157

tests/unit/sagemaker/image_uris/test_dlc_frameworks.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,16 @@ def _expected_tf_inference_repo(version, eia):
193193
return repo
194194

195195

196-
def test_mxnet_training(mxnet_training_version, mxnet_py_version):
196+
def test_mxnet_training(mxnet_training_version, mxnet_training_py_version):
197197
expected_fn_args = {
198198
"mxnet_version": mxnet_training_version,
199-
"py_version": mxnet_py_version,
199+
"py_version": mxnet_training_py_version,
200200
}
201201

202202
_test_image_uris(
203203
"mxnet",
204204
mxnet_training_version,
205-
mxnet_py_version,
205+
mxnet_training_py_version,
206206
"training",
207207
_expected_mxnet_training_uri,
208208
expected_fn_args,
@@ -228,42 +228,42 @@ def _expected_mxnet_training_uri(mxnet_version, py_version, processor="cpu", reg
228228
)
229229

230230

231-
def test_mxnet_inference(mxnet_inference_version, mxnet_py_version):
231+
def test_mxnet_inference(mxnet_inference_version, mxnet_inference_py_version):
232232
expected_fn_args = {
233233
"mxnet_version": mxnet_inference_version,
234-
"py_version": mxnet_py_version,
234+
"py_version": mxnet_inference_py_version,
235235
}
236236

237237
_test_image_uris(
238238
"mxnet",
239239
mxnet_inference_version,
240-
mxnet_py_version,
240+
mxnet_inference_py_version,
241241
"inference",
242242
_expected_mxnet_inference_uri,
243243
expected_fn_args,
244244
)
245245

246246

247-
def test_mxnet_eia(mxnet_eia_version, mxnet_py_version):
247+
def test_mxnet_eia(mxnet_eia_version, mxnet_eia_py_version):
248248
base_args = {
249249
"framework": "mxnet",
250250
"version": mxnet_eia_version,
251-
"py_version": mxnet_py_version,
251+
"py_version": mxnet_eia_py_version,
252252
"image_scope": "inference",
253253
"instance_type": "ml.c4.xlarge",
254254
"accelerator_type": "ml.eia1.medium",
255255
}
256256

257257
uri = image_uris.retrieve(region=REGION, **base_args)
258258

259-
expected = _expected_mxnet_inference_uri(mxnet_eia_version, mxnet_py_version, eia=True)
259+
expected = _expected_mxnet_inference_uri(mxnet_eia_version, mxnet_eia_py_version, eia=True)
260260
assert expected == uri
261261

262262
for region in SAGEMAKER_ALTERNATE_REGION_ACCOUNTS.keys():
263263
uri = image_uris.retrieve(region=region, **base_args)
264264

265265
expected = _expected_mxnet_inference_uri(
266-
mxnet_eia_version, mxnet_py_version, region=region, eia=True
266+
mxnet_eia_version, mxnet_eia_py_version, region=region, eia=True
267267
)
268268
assert expected == uri
269269

@@ -301,7 +301,10 @@ def test_pytorch_training(pytorch_training_version, pytorch_training_py_version)
301301
pytorch_training_py_version,
302302
"training",
303303
_expected_pytorch_training_uri,
304-
{"pytorch_version": pytorch_training_version, "py_version": pytorch_training_py_version},
304+
{
305+
"pytorch_version": pytorch_training_version,
306+
"py_version": pytorch_training_py_version,
307+
},
305308
)
306309

307310

@@ -329,7 +332,10 @@ def test_pytorch_inference(pytorch_inference_version, pytorch_inference_py_versi
329332
pytorch_inference_py_version,
330333
"inference",
331334
_expected_pytorch_inference_uri,
332-
{"pytorch_version": pytorch_inference_version, "py_version": pytorch_inference_py_version},
335+
{
336+
"pytorch_version": pytorch_inference_version,
337+
"py_version": pytorch_inference_py_version,
338+
},
333339
)
334340

335341

0 commit comments

Comments
 (0)