Skip to content

Commit db8cdd0

Browse files
committed
Merge remote-tracking branch 'origin/new_regions' into new_regions
2 parents 6da63e7 + d92fdc6 commit db8cdd0

File tree

8 files changed

+180
-21
lines changed

8 files changed

+180
-21
lines changed

CHANGELOG.md

+20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## v2.140.0 (2023-03-17)
4+
5+
### Features
6+
7+
* SDK changes for TRCOMP support
8+
9+
### Bug Fixes and Other Changes
10+
11+
* [Feature - Hugging Face] Update Transformers 4.26 - PyTorch 1.13.1 Image uri
12+
13+
## v2.139.0 (2023-03-15)
14+
15+
### Features
16+
17+
* Add XGBoost framework 1.7-1 version
18+
19+
### Bug Fixes and Other Changes
20+
21+
* Fix image_uris.retrieve() function to return ValueError when framework is not allowed for an instance_type
22+
323
## v2.138.0 (2023-03-13)
424

525
### Features

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.138.1.dev0
1+
2.140.1.dev0

src/sagemaker/huggingface/training_compiler/config.py

+11
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,17 @@ def validate(cls, estimator):
102102

103103
super(TrainingCompilerConfig, cls).validate(estimator)
104104

105+
if estimator.pytorch_version:
106+
if (Version(estimator.pytorch_version) in SpecifierSet("< 1.9")) or (
107+
Version(estimator.pytorch_version) in SpecifierSet("> 1.11")
108+
):
109+
error_helper_string = (
110+
"SageMaker Training Compiler is only supported "
111+
"with HuggingFace PyTorch 1.9-1.11. "
112+
"Received pytorch_version={} which is unsupported."
113+
)
114+
raise ValueError(error_helper_string.format(estimator.pytorch_version))
115+
105116
if estimator.image_uri:
106117
error_helper_string = (
107118
"Overriding the image URI is currently not supported "

src/sagemaker/image_uri_config/huggingface.json

+90-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"4.10": "4.10.2",
99
"4.11": "4.11.0",
1010
"4.12": "4.12.3",
11-
"4.17": "4.17.0"
11+
"4.17": "4.17.0",
12+
"4.26": "4.26.0"
1213
},
1314
"versions": {
1415
"4.4.2": {
@@ -772,6 +773,47 @@
772773
"repository": "huggingface-tensorflow-training",
773774
"container_version": {"gpu": "cu112-ubuntu20.04"}
774775
}
776+
},
777+
"4.26.0": {
778+
"version_aliases": {
779+
"pytorch1.13": "pytorch1.13.1"
780+
},
781+
"pytorch1.13.1": {
782+
"py_versions": ["py39"],
783+
"registries": {
784+
"af-south-1": "626614931356",
785+
"ap-east-1": "871362719292",
786+
"ap-northeast-1": "763104351884",
787+
"ap-northeast-2": "763104351884",
788+
"ap-northeast-3": "364406365360",
789+
"ap-south-1": "763104351884",
790+
"ap-southeast-1": "763104351884",
791+
"ap-southeast-2": "763104351884",
792+
"ap-southeast-3": "907027046896",
793+
"ca-central-1": "763104351884",
794+
"cn-north-1": "727897471807",
795+
"cn-northwest-1": "727897471807",
796+
"eu-central-1": "763104351884",
797+
"eu-north-1": "763104351884",
798+
"eu-west-1": "763104351884",
799+
"eu-west-2": "763104351884",
800+
"eu-west-3": "763104351884",
801+
"eu-south-1": "692866216735",
802+
"me-south-1": "217643126080",
803+
"me-central-1": "914824155844",
804+
"sa-east-1": "763104351884",
805+
"us-east-1": "763104351884",
806+
"us-east-2": "763104351884",
807+
"us-gov-east-1": "446045086412",
808+
"us-gov-west-1": "442386744353",
809+
"us-iso-east-1": "886529160074",
810+
"us-isob-east-1": "094389454867",
811+
"us-west-1": "763104351884",
812+
"us-west-2": "763104351884"
813+
},
814+
"repository": "huggingface-pytorch-training",
815+
"container_version": {"gpu": "cu117-ubuntu20.04"}
816+
}
775817
}
776818
}
777819
},
@@ -783,7 +825,8 @@
783825
"4.10": "4.10.2",
784826
"4.11": "4.11.0",
785827
"4.12": "4.12.3",
786-
"4.17": "4.17.0"
828+
"4.17": "4.17.0",
829+
"4.26": "4.26.0"
787830
},
788831
"versions": {
789832
"4.6.1": {
@@ -1337,6 +1380,51 @@
13371380
"repository": "huggingface-tensorflow-inference",
13381381
"container_version": {"gpu": "cu112-ubuntu20.04", "cpu": "ubuntu20.04" }
13391382
}
1383+
},
1384+
"4.26.0": {
1385+
"version_aliases": {
1386+
"pytorch1.13": "pytorch1.13.1"
1387+
},
1388+
"pytorch1.13.1": {
1389+
"py_versions": ["py39"],
1390+
"registries": {
1391+
"af-south-1": "626614931356",
1392+
"ap-east-1": "871362719292",
1393+
"ap-northeast-1": "763104351884",
1394+
"ap-northeast-2": "763104351884",
1395+
"ap-northeast-3": "364406365360",
1396+
"ap-south-1": "763104351884",
1397+
"ap-south-2": "772153158452",
1398+
"ap-southeast-1": "763104351884",
1399+
"ap-southeast-2": "763104351884",
1400+
"ap-southeast-3": "907027046896",
1401+
"ap-southeast-4": "457447274322",
1402+
"ca-central-1": "763104351884",
1403+
"cn-north-1": "727897471807",
1404+
"cn-northwest-1": "727897471807",
1405+
"eu-central-1": "763104351884",
1406+
"eu-central-2": "380420809688",
1407+
"eu-north-1": "763104351884",
1408+
"eu-west-1": "763104351884",
1409+
"eu-west-2": "763104351884",
1410+
"eu-west-3": "763104351884",
1411+
"eu-south-1": "692866216735",
1412+
"eu-south-2": "503227376785",
1413+
"me-south-1": "217643126080",
1414+
"me-central-1": "914824155844",
1415+
"sa-east-1": "763104351884",
1416+
"us-east-1": "763104351884",
1417+
"us-east-2": "763104351884",
1418+
"us-gov-east-1": "446045086412",
1419+
"us-gov-west-1": "442386744353",
1420+
"us-iso-east-1": "886529160074",
1421+
"us-isob-east-1": "094389454867",
1422+
"us-west-1": "763104351884",
1423+
"us-west-2": "763104351884"
1424+
},
1425+
"repository": "huggingface-pytorch-inference",
1426+
"container_version": {"gpu": "cu117-ubuntu20.04", "cpu": "ubuntu20.04" }
1427+
}
13401428
}
13411429
}
13421430
}

src/sagemaker/tensorflow/training_compiler/config.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class TrainingCompilerConfig(BaseConfig):
2626

2727
SUPPORTED_INSTANCE_CLASS_PREFIXES = ["p3", "p3dn", "g4dn", "p4d", "g5"]
2828
MIN_SUPPORTED_VERSION = "2.9"
29+
MAX_SUPPORTED_VERSION = "2.11"
2930

3031
def __init__(self, enabled=True, debug=False):
3132
"""This class initializes a ``TrainingCompilerConfig`` instance.
@@ -91,15 +92,17 @@ def validate(cls, estimator):
9192
super(TrainingCompilerConfig, cls).validate(estimator)
9293

9394
if estimator.framework_version:
94-
if Version(estimator.framework_version) in SpecifierSet(
95-
f"< {cls.MIN_SUPPORTED_VERSION}"
95+
if Version(estimator.framework_version) not in SpecifierSet(
96+
f">= {cls.MIN_SUPPORTED_VERSION}", f"<= {cls.MAX_SUPPORTED_VERSION}"
9697
):
9798
error_helper_string = (
9899
"SageMaker Training Compiler only supports TensorFlow version "
99-
">= {} but received {}"
100+
"between {} to {} but received {}"
100101
)
101102
error_helper_string = error_helper_string.format(
102-
cls.MIN_SUPPORTED_VERSION, estimator.framework_version
103+
cls.MIN_SUPPORTED_VERSION,
104+
cls.MAX_SUPPORTED_VERSION,
105+
estimator.framework_version,
103106
)
104107
raise ValueError(error_helper_string)
105108

tests/conftest.py

+18-9
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,12 @@ def huggingface_pytorch_training_version(huggingface_training_version):
273273

274274
@pytest.fixture(scope="module")
275275
def huggingface_pytorch_training_py_version(huggingface_pytorch_training_version):
276-
return "py38" if Version(huggingface_pytorch_training_version) >= Version("1.9") else "py36"
276+
if Version(huggingface_pytorch_training_version) >= Version("1.13"):
277+
return "py39"
278+
elif Version(huggingface_pytorch_training_version) >= Version("1.9"):
279+
return "py38"
280+
else:
281+
return "py36"
277282

278283

279284
@pytest.fixture(scope="module")
@@ -328,9 +333,12 @@ def huggingface_training_compiler_pytorch_py_version(
328333
def huggingface_pytorch_latest_training_py_version(
329334
huggingface_training_pytorch_latest_version,
330335
):
331-
return (
332-
"py38" if Version(huggingface_training_pytorch_latest_version) >= Version("1.9") else "py36"
333-
)
336+
if Version(huggingface_training_pytorch_latest_version) >= Version("1.13"):
337+
return "py39"
338+
elif Version(huggingface_training_pytorch_latest_version) >= Version("1.9"):
339+
return "py38"
340+
else:
341+
return "py36"
334342

335343

336344
@pytest.fixture(scope="module")
@@ -347,11 +355,12 @@ def pytorch_training_compiler_py_version(
347355
def huggingface_pytorch_latest_inference_py_version(
348356
huggingface_inference_pytorch_latest_version,
349357
):
350-
return (
351-
"py38"
352-
if Version(huggingface_inference_pytorch_latest_version) >= Version("1.9")
353-
else "py36"
354-
)
358+
if Version(huggingface_inference_pytorch_latest_version) >= Version("1.13"):
359+
return "py39"
360+
elif Version(huggingface_inference_pytorch_latest_version) >= Version("1.9"):
361+
return "py38"
362+
else:
363+
return "py36"
355364

356365

357366
@pytest.fixture(scope="module")

tests/unit/sagemaker/training_compiler/test_huggingface_pytorch_compiler.py

+19-4
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def test_unsupported_gpu_instance(
218218
).fit()
219219

220220

221-
def test_unsupported_framework_version(
221+
def test_unsupported_framework_version_min(
222222
huggingface_training_compiler_version,
223223
):
224224
with pytest.raises(ValueError):
@@ -229,9 +229,24 @@ def test_unsupported_framework_version(
229229
instance_count=INSTANCE_COUNT,
230230
instance_type=INSTANCE_TYPE,
231231
transformers_version=huggingface_training_compiler_version,
232-
pytorch_version=".".join(
233-
["99"] * len(huggingface_training_compiler_version.split("."))
234-
),
232+
pytorch_version="1.8",
233+
enable_sagemaker_metrics=False,
234+
compiler_config=TrainingCompilerConfig(),
235+
).fit()
236+
237+
238+
def test_unsupported_framework_version_max(
239+
huggingface_training_compiler_version,
240+
):
241+
with pytest.raises(ValueError):
242+
HuggingFace(
243+
py_version="py38",
244+
entry_point=SCRIPT_PATH,
245+
role=ROLE,
246+
instance_count=INSTANCE_COUNT,
247+
instance_type=INSTANCE_TYPE,
248+
transformers_version=huggingface_training_compiler_version,
249+
pytorch_version="1.12",
235250
enable_sagemaker_metrics=False,
236251
compiler_config=TrainingCompilerConfig(),
237252
).fit()

tests/unit/sagemaker/training_compiler/test_tensorflow_compiler.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def test_gpu_instance(
189189
compiler_config=TrainingCompilerConfig(),
190190
).fit()
191191

192-
def test_framework_version(self, tensorflow_training_py_version):
192+
def test_framework_version_min(self, tensorflow_training_py_version):
193193
with pytest.raises(ValueError):
194194
TensorFlow(
195195
py_version=tensorflow_training_py_version,
@@ -202,6 +202,19 @@ def test_framework_version(self, tensorflow_training_py_version):
202202
compiler_config=TrainingCompilerConfig(),
203203
).fit()
204204

205+
def test_framework_version_max(self, tensorflow_training_py_version):
206+
with pytest.raises(ValueError):
207+
TensorFlow(
208+
py_version=tensorflow_training_py_version,
209+
entry_point=SCRIPT_PATH,
210+
role=ROLE,
211+
instance_count=INSTANCE_COUNT,
212+
instance_type=INSTANCE_TYPE,
213+
framework_version="2.12",
214+
enable_sagemaker_metrics=False,
215+
compiler_config=TrainingCompilerConfig(),
216+
).fit()
217+
205218
def test_mwms(self, tensorflow_training_version, tensorflow_training_py_version):
206219
with pytest.raises(ValueError):
207220
TensorFlow(

0 commit comments

Comments
 (0)