Skip to content

Commit 9b96ee1

Browse files
authored
Merge branch 'master' into change-unit-tests
2 parents b4089eb + fcbd0bf commit 9b96ee1

File tree

14 files changed

+358
-56
lines changed

14 files changed

+358
-56
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## v2.212.0 (2024-03-06)
4+
5+
### Features
6+
7+
* Update SM Python SDK for PT 2.2.0 SM DLC
8+
9+
### Bug Fixes and Other Changes
10+
11+
* Create custom tarfile extractall util to fix backward compatibility issue
12+
* Upgrade smp to version 2.2
13+
* Enhance model builder selection logic to include model size
14+
315
## v2.211.0 (2024-03-05)
416

517
### Features

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.211.1.dev0
1+
2.212.1.dev0

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def read_requirements(filename):
6363
"PyYAML~=6.0",
6464
"jsonschema",
6565
"platformdirs",
66-
"tblib>=1.7.0,<3",
66+
"tblib>=1.7.0,<4",
6767
"urllib3>=1.26.8,<3.0.0",
6868
"requests",
6969
"docker",

src/sagemaker/fw_utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
"2.0.0",
159159
"2.0.1",
160160
"2.1.0",
161+
"2.2.0",
161162
]
162163

163164

src/sagemaker/image_uri_config/pytorch.json

+99-2
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,7 @@
848848
"ap-northeast-2": "763104351884",
849849
"ap-northeast-3": "364406365360",
850850
"ap-south-1": "763104351884",
851+
"ap-south-2": "772153158452",
851852
"ap-southeast-1": "763104351884",
852853
"ap-southeast-2": "763104351884",
853854
"ap-southeast-3": "907027046896",
@@ -856,11 +857,13 @@
856857
"cn-north-1": "727897471807",
857858
"cn-northwest-1": "727897471807",
858859
"eu-central-1": "763104351884",
860+
"eu-central-2": "380420809688",
859861
"eu-north-1": "763104351884",
860862
"eu-west-1": "763104351884",
861863
"eu-west-2": "763104351884",
862864
"eu-west-3": "763104351884",
863865
"eu-south-1": "692866216735",
866+
"eu-south-2": "503227376785",
864867
"me-south-1": "217643126080",
865868
"sa-east-1": "763104351884",
866869
"us-east-1": "763104351884",
@@ -887,6 +890,7 @@
887890
"ap-northeast-2": "763104351884",
888891
"ap-northeast-3": "364406365360",
889892
"ap-south-1": "763104351884",
893+
"ap-south-2": "772153158452",
890894
"ap-southeast-1": "763104351884",
891895
"ap-southeast-2": "763104351884",
892896
"ap-southeast-3": "907027046896",
@@ -895,11 +899,13 @@
895899
"cn-north-1": "727897471807",
896900
"cn-northwest-1": "727897471807",
897901
"eu-central-1": "763104351884",
902+
"eu-central-2": "380420809688",
898903
"eu-north-1": "763104351884",
899904
"eu-west-1": "763104351884",
900905
"eu-west-2": "763104351884",
901906
"eu-west-3": "763104351884",
902907
"eu-south-1": "692866216735",
908+
"eu-south-2": "503227376785",
903909
"me-south-1": "217643126080",
904910
"sa-east-1": "763104351884",
905911
"us-east-1": "763104351884",
@@ -926,6 +932,7 @@
926932
"ap-northeast-2": "763104351884",
927933
"ap-northeast-3": "364406365360",
928934
"ap-south-1": "763104351884",
935+
"ap-south-2": "772153158452",
929936
"ap-southeast-1": "763104351884",
930937
"ap-southeast-2": "763104351884",
931938
"ap-southeast-3": "907027046896",
@@ -934,11 +941,13 @@
934941
"cn-north-1": "727897471807",
935942
"cn-northwest-1": "727897471807",
936943
"eu-central-1": "763104351884",
944+
"eu-central-2": "380420809688",
937945
"eu-north-1": "763104351884",
938946
"eu-west-1": "763104351884",
939947
"eu-west-2": "763104351884",
940948
"eu-west-3": "763104351884",
941949
"eu-south-1": "692866216735",
950+
"eu-south-2": "503227376785",
942951
"me-south-1": "217643126080",
943952
"sa-east-1": "763104351884",
944953
"us-east-1": "763104351884",
@@ -965,6 +974,7 @@
965974
"ap-northeast-2": "763104351884",
966975
"ap-northeast-3": "364406365360",
967976
"ap-south-1": "763104351884",
977+
"ap-south-2": "772153158452",
968978
"ap-southeast-1": "763104351884",
969979
"ap-southeast-2": "763104351884",
970980
"ap-southeast-3": "907027046896",
@@ -973,11 +983,55 @@
973983
"cn-north-1": "727897471807",
974984
"cn-northwest-1": "727897471807",
975985
"eu-central-1": "763104351884",
986+
"eu-central-2": "380420809688",
976987
"eu-north-1": "763104351884",
977988
"eu-west-1": "763104351884",
978989
"eu-west-2": "763104351884",
979990
"eu-west-3": "763104351884",
980991
"eu-south-1": "692866216735",
992+
"eu-south-2": "503227376785",
993+
"me-south-1": "217643126080",
994+
"sa-east-1": "763104351884",
995+
"us-east-1": "763104351884",
996+
"us-east-2": "763104351884",
997+
"us-gov-east-1": "446045086412",
998+
"us-gov-west-1": "442386744353",
999+
"us-iso-east-1": "886529160074",
1000+
"us-isob-east-1": "094389454867",
1001+
"us-west-1": "763104351884",
1002+
"us-west-2": "763104351884",
1003+
"ca-west-1": "204538143572"
1004+
},
1005+
"repository": "pytorch-inference"
1006+
},
1007+
"2.2.0": {
1008+
"py_versions": [
1009+
"py310"
1010+
],
1011+
"registries": {
1012+
"af-south-1": "626614931356",
1013+
"il-central-1": "780543022126",
1014+
"ap-east-1": "871362719292",
1015+
"ap-northeast-1": "763104351884",
1016+
"ap-northeast-2": "763104351884",
1017+
"ap-northeast-3": "364406365360",
1018+
"ap-south-1": "763104351884",
1019+
"ap-south-2": "772153158452",
1020+
"ap-southeast-1": "763104351884",
1021+
"ap-southeast-2": "763104351884",
1022+
"ap-southeast-3": "907027046896",
1023+
"ap-southeast-4": "457447274322",
1024+
"ca-central-1": "763104351884",
1025+
"cn-north-1": "727897471807",
1026+
"cn-northwest-1": "727897471807",
1027+
"eu-central-1": "763104351884",
1028+
"eu-central-2": "380420809688",
1029+
"eu-north-1": "763104351884",
1030+
"eu-west-1": "763104351884",
1031+
"eu-west-2": "763104351884",
1032+
"eu-west-3": "763104351884",
1033+
"eu-south-1": "692866216735",
1034+
"eu-south-2": "503227376785",
9811035
"me-south-1": "217643126080",
9821036
"sa-east-1": "763104351884",
9831037
"us-east-1": "763104351884",
@@ -1190,7 +1244,8 @@
11901244
"1.12": "1.12.1",
11911245
"1.13": "1.13.1",
11921246
"2.0": "2.0.1",
1193-
"2.1": "2.1.0"
1247+
"2.1": "2.1.0",
1248+
"2.2": "2.2.0"
11941249
},
11951250
"versions": {
11961251
"0.4.0": {
@@ -2113,7 +2168,49 @@
21132168
"ca-west-1": "204538143572"
21142169
},
21152170
"repository": "pytorch-training"
2171+
},
2172+
"2.2.0": {
2173+
"py_versions": [
2174+
"py310"
2175+
],
2176+
"registries": {
2177+
"af-south-1": "626614931356",
2178+
"il-central-1": "780543022126",
2179+
"ap-east-1": "871362719292",
2180+
"ap-northeast-1": "763104351884",
2181+
"ap-northeast-2": "763104351884",
2182+
"ap-northeast-3": "364406365360",
2183+
"ap-south-1": "763104351884",
2184+
"ap-south-2": "772153158452",
2185+
"ap-southeast-1": "763104351884",
2186+
"ap-southeast-2": "763104351884",
2187+
"ap-southeast-3": "907027046896",
2188+
"ap-southeast-4": "457447274322",
2189+
"ca-central-1": "763104351884",
2190+
"cn-north-1": "727897471807",
2191+
"cn-northwest-1": "727897471807",
2192+
"eu-central-1": "763104351884",
2193+
"eu-central-2": "380420809688",
2194+
"eu-north-1": "763104351884",
2195+
"eu-west-1": "763104351884",
2196+
"eu-west-2": "763104351884",
2197+
"eu-west-3": "763104351884",
2198+
"eu-south-1": "692866216735",
2199+
"eu-south-2": "503227376785",
2200+
"me-south-1": "217643126080",
2201+
"sa-east-1": "763104351884",
2202+
"us-east-1": "763104351884",
2203+
"us-east-2": "763104351884",
2204+
"us-gov-east-1": "446045086412",
2205+
"us-gov-west-1": "442386744353",
2206+
"us-iso-east-1": "886529160074",
2207+
"us-isob-east-1": "094389454867",
2208+
"us-west-1": "763104351884",
2209+
"us-west-2": "763104351884",
2210+
"ca-west-1": "204538143572"
2211+
},
2212+
"repository": "pytorch-training"
21162213
}
21172214
}
21182215
}
2119-
}
2216+
}

src/sagemaker/local/image.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import sagemaker.local.data
4141
import sagemaker.local.utils
4242
import sagemaker.utils
43-
from sagemaker.utils import check_tarfile_data_filter_attribute
43+
from sagemaker.utils import custom_extractall_tarfile
4444

4545
CONTAINER_PREFIX = "algo"
4646
STUDIO_HOST_NAME = "sagemaker-local"
@@ -687,8 +687,7 @@ def _prepare_serving_volumes(self, model_location):
687687
for filename in model_data_source.get_file_list():
688688
if tarfile.is_tarfile(filename):
689689
with tarfile.open(filename) as tar:
690-
check_tarfile_data_filter_attribute()
691-
tar.extractall(path=model_data_source.get_root_dir(), filter="data")
690+
custom_extractall_tarfile(tar, model_data_source.get_root_dir())
692691

693692
volumes.append(_Volume(model_data_source.get_root_dir(), "/opt/ml/model"))
694693

src/sagemaker/serve/model_server/djl_serving/prepare.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from typing import List
2121
from pathlib import Path
2222

23-
from sagemaker.utils import _tmpdir, check_tarfile_data_filter_attribute
23+
from sagemaker.utils import _tmpdir, custom_extractall_tarfile
2424
from sagemaker.s3 import S3Downloader
2525
from sagemaker.djl_inference import DJLModel
2626
from sagemaker.djl_inference.model import _read_existing_serving_properties
@@ -53,8 +53,7 @@ def _extract_js_resource(js_model_dir: str, js_id: str):
5353
"""Uncompress the jumpstart resource"""
5454
tmp_sourcedir = Path(js_model_dir).joinpath(f"infer-prepack-{js_id}.tar.gz")
5555
with tarfile.open(str(tmp_sourcedir)) as resources:
56-
check_tarfile_data_filter_attribute()
57-
resources.extractall(path=js_model_dir, filter="data")
56+
custom_extractall_tarfile(resources, js_model_dir)
5857

5958

6059
def _copy_jumpstart_artifacts(model_data: str, js_id: str, code_dir: Path):

src/sagemaker/serve/model_server/tgi/prepare.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from pathlib import Path
2020

2121
from sagemaker.serve.utils.local_hardware import _check_disk_space, _check_docker_disk_usage
22-
from sagemaker.utils import _tmpdir, check_tarfile_data_filter_attribute
22+
from sagemaker.utils import _tmpdir, custom_extractall_tarfile
2323
from sagemaker.s3 import S3Downloader
2424

2525
logger = logging.getLogger(__name__)
@@ -29,8 +29,7 @@ def _extract_js_resource(js_model_dir: str, code_dir: Path, js_id: str):
2929
"""Uncompress the jumpstart resource"""
3030
tmp_sourcedir = Path(js_model_dir).joinpath(f"infer-prepack-{js_id}.tar.gz")
3131
with tarfile.open(str(tmp_sourcedir)) as resources:
32-
check_tarfile_data_filter_attribute()
33-
resources.extractall(path=code_dir, filter="data")
32+
custom_extractall_tarfile(resources, code_dir)
3433

3534

3635
def _copy_jumpstart_artifacts(model_data: str, js_id: str, code_dir: Path) -> bool:

0 commit comments

Comments
 (0)