Skip to content

Commit 78df06c

Browse files
authored
Merge branch 'master' into cv_s3_upload
2 parents 2a6b242 + c217e1c commit 78df06c

File tree

10 files changed

+415
-11
lines changed

10 files changed

+415
-11
lines changed

CHANGELOG.md

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

3+
## v2.147.0 (2023-04-18)
4+
5+
### Features
6+
7+
* support different types of deletion mode
8+
39
## v2.146.1 (2023-04-17)
410

511
### Bug Fixes and Other Changes

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.146.2.dev0
1+
2.147.1.dev0

src/sagemaker/fw_utils.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
"1.12.0",
136136
"1.12.1",
137137
"1.13.1",
138+
"2.0.0",
138139
],
139140
}
140141

@@ -148,10 +149,11 @@
148149
"1.12.0",
149150
"1.12.1",
150151
"1.13.1",
152+
"2.0.0",
151153
]
152154

153155

154-
TORCH_DISTRIBUTED_GPU_SUPPORTED_FRAMEWORK_VERSIONS = ["1.13.1"]
156+
TORCH_DISTRIBUTED_GPU_SUPPORTED_FRAMEWORK_VERSIONS = ["1.13.1", "2.0.0"]
155157

156158
TRAINIUM_SUPPORTED_DISTRIBUTION_STRATEGIES = ["torch_distributed"]
157159
TRAINIUM_SUPPORTED_TORCH_DISTRIBUTED_FRAMEWORK_VERSIONS = [
@@ -161,6 +163,7 @@
161163
"1.12.0",
162164
"1.12.1",
163165
"1.13.1",
166+
"2.0.0",
164167
]
165168

166169
SMDISTRIBUTED_SUPPORTED_STRATEGIES = ["dataparallel", "modelparallel"]

src/sagemaker/image_uri_config/pytorch.json

+115-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@
7777
"1.10": "1.10.2",
7878
"1.11": "1.11.0",
7979
"1.12": "1.12.1",
80-
"1.13": "1.13.1"
80+
"1.13": "1.13.1",
81+
"2.0": "2.0.0"
8182
},
8283
"versions": {
8384
"0.4.0": {
@@ -838,6 +839,43 @@
838839
"us-west-2": "763104351884"
839840
},
840841
"repository": "pytorch-inference"
842+
},
843+
"2.0.0": {
844+
"py_versions": [
845+
"py310"
846+
],
847+
"registries": {
848+
"af-south-1": "626614931356",
849+
"ap-east-1": "871362719292",
850+
"ap-northeast-1": "763104351884",
851+
"ap-northeast-2": "763104351884",
852+
"ap-northeast-3": "364406365360",
853+
"ap-south-1": "763104351884",
854+
"ap-southeast-1": "763104351884",
855+
"ap-southeast-2": "763104351884",
856+
"ap-southeast-3": "907027046896",
857+
"ap-southeast-4": "457447274322",
858+
"ca-central-1": "763104351884",
859+
"cn-north-1": "727897471807",
860+
"cn-northwest-1": "727897471807",
861+
"eu-central-1": "763104351884",
862+
"eu-north-1": "763104351884",
863+
"eu-west-1": "763104351884",
864+
"eu-west-2": "763104351884",
865+
"eu-west-3": "763104351884",
866+
"eu-south-1": "692866216735",
867+
"me-south-1": "217643126080",
868+
"sa-east-1": "763104351884",
869+
"us-east-1": "763104351884",
870+
"us-east-2": "763104351884",
871+
"us-gov-east-1": "446045086412",
872+
"us-gov-west-1": "442386744353",
873+
"us-iso-east-1": "886529160074",
874+
"us-isob-east-1": "094389454867",
875+
"us-west-1": "763104351884",
876+
"us-west-2": "763104351884"
877+
},
878+
"repository": "pytorch-inference"
841879
}
842880
}
843881
},
@@ -846,7 +884,8 @@
846884
"cpu"
847885
],
848886
"version_aliases": {
849-
"1.12": "1.12.1"
887+
"1.12": "1.12.1",
888+
"2.0": "2.0.0"
850889
},
851890
"versions": {
852891
"1.12.1": {
@@ -889,6 +928,41 @@
889928
},
890929
"repository": "pytorch-inference-graviton",
891930
"container_version": {"cpu": "ubuntu20.04"}
931+
},
932+
"2.0.0": {
933+
"py_versions": [
934+
"py310"
935+
],
936+
"registries": {
937+
"af-south-1": "626614931356",
938+
"ap-east-1": "871362719292",
939+
"ap-northeast-1": "763104351884",
940+
"ap-northeast-2": "763104351884",
941+
"ap-northeast-3": "364406365360",
942+
"ap-south-1": "763104351884",
943+
"ap-south-2": "772153158452",
944+
"ap-southeast-1": "763104351884",
945+
"ap-southeast-2": "763104351884",
946+
"ap-southeast-3": "907027046896",
947+
"ap-southeast-4": "457447274322",
948+
"ca-central-1": "763104351884",
949+
"eu-central-1": "763104351884",
950+
"eu-central-2": "380420809688",
951+
"eu-north-1": "763104351884",
952+
"eu-west-1": "763104351884",
953+
"eu-west-2": "763104351884",
954+
"eu-west-3": "763104351884",
955+
"eu-south-1": "692866216735",
956+
"eu-south-2": "503227376785",
957+
"me-south-1": "217643126080",
958+
"sa-east-1": "763104351884",
959+
"us-east-1": "763104351884",
960+
"us-east-2": "763104351884",
961+
"us-west-1": "763104351884",
962+
"us-west-2": "763104351884"
963+
},
964+
"repository": "pytorch-inference-graviton",
965+
"container_version": {"cpu": "ubuntu20.04"}
892966
}
893967
}
894968
},
@@ -912,7 +986,8 @@
912986
"1.10": "1.10.2",
913987
"1.11": "1.11.0",
914988
"1.12": "1.12.1",
915-
"1.13": "1.13.1"
989+
"1.13": "1.13.1",
990+
"2.0": "2.0.0"
916991
},
917992
"versions": {
918993
"0.4.0": {
@@ -1674,6 +1749,43 @@
16741749
"us-west-2": "763104351884"
16751750
},
16761751
"repository": "pytorch-training"
1752+
},
1753+
"2.0.0": {
1754+
"py_versions": [
1755+
"py310"
1756+
],
1757+
"registries": {
1758+
"af-south-1": "626614931356",
1759+
"ap-east-1": "871362719292",
1760+
"ap-northeast-1": "763104351884",
1761+
"ap-northeast-2": "763104351884",
1762+
"ap-northeast-3": "364406365360",
1763+
"ap-south-1": "763104351884",
1764+
"ap-southeast-1": "763104351884",
1765+
"ap-southeast-2": "763104351884",
1766+
"ap-southeast-3": "907027046896",
1767+
"ap-southeast-4": "457447274322",
1768+
"ca-central-1": "763104351884",
1769+
"cn-north-1": "727897471807",
1770+
"cn-northwest-1": "727897471807",
1771+
"eu-central-1": "763104351884",
1772+
"eu-north-1": "763104351884",
1773+
"eu-west-1": "763104351884",
1774+
"eu-west-2": "763104351884",
1775+
"eu-west-3": "763104351884",
1776+
"eu-south-1": "692866216735",
1777+
"me-south-1": "217643126080",
1778+
"sa-east-1": "763104351884",
1779+
"us-east-1": "763104351884",
1780+
"us-east-2": "763104351884",
1781+
"us-gov-east-1": "446045086412",
1782+
"us-gov-west-1": "442386744353",
1783+
"us-iso-east-1": "886529160074",
1784+
"us-isob-east-1": "094389454867",
1785+
"us-west-1": "763104351884",
1786+
"us-west-2": "763104351884"
1787+
},
1788+
"repository": "pytorch-training"
16771789
}
16781790
}
16791791
}

src/sagemaker/model_monitor/model_monitoring.py

+42
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ def update_monitoring_schedule(
433433
network_config=None,
434434
role=None,
435435
image_uri=None,
436+
batch_transform_input=None,
436437
):
437438
"""Updates the existing monitoring schedule.
438439
@@ -475,14 +476,29 @@ def update_monitoring_schedule(
475476
role (str): An AWS IAM role name or ARN. The Amazon SageMaker jobs use this role.
476477
image_uri (str): The uri of the image to use for the jobs started by
477478
the Monitor.
479+
batch_transform_input (sagemaker.model_monitor.BatchTransformInput): Inputs to
480+
run the monitoring schedule on the batch transform (default: None)
478481
479482
"""
480483
monitoring_inputs = None
484+
485+
if (batch_transform_input is not None) and (endpoint_input is not None):
486+
message = (
487+
"Cannot update both batch_transform_input and endpoint_input to update an "
488+
"Amazon Model Monitoring Schedule. "
489+
"Please provide atmost one of the above required inputs"
490+
)
491+
_LOGGER.error(message)
492+
raise ValueError(message)
493+
481494
if endpoint_input is not None:
482495
monitoring_inputs = [
483496
self._normalize_endpoint_input(endpoint_input=endpoint_input)._to_request_dict()
484497
]
485498

499+
elif batch_transform_input is not None:
500+
monitoring_inputs = [batch_transform_input._to_request_dict()]
501+
486502
monitoring_output_config = None
487503
if output is not None:
488504
normalized_monitoring_output = self._normalize_monitoring_output_fields(output=output)
@@ -1895,6 +1911,7 @@ def update_monitoring_schedule(
18951911
network_config=None,
18961912
enable_cloudwatch_metrics=None,
18971913
role=None,
1914+
batch_transform_input=None,
18981915
):
18991916
"""Updates the existing monitoring schedule.
19001917
@@ -1936,8 +1953,20 @@ def update_monitoring_schedule(
19361953
enable_cloudwatch_metrics (bool): Whether to publish cloudwatch metrics as part of
19371954
the baselining or monitoring jobs.
19381955
role (str): An AWS IAM role name or ARN. The Amazon SageMaker jobs use this role.
1956+
batch_transform_input (sagemaker.model_monitor.BatchTransformInput): Inputs to
1957+
run the monitoring schedule on the batch transform (default: None)
19391958
19401959
"""
1960+
1961+
if (batch_transform_input is not None) and (endpoint_input is not None):
1962+
message = (
1963+
"Cannot update both batch_transform_input and endpoint_input to update an "
1964+
"Amazon Model Monitoring Schedule. "
1965+
"Please provide atmost one of the above required inputs"
1966+
)
1967+
_LOGGER.error(message)
1968+
raise ValueError(message)
1969+
19411970
# check if this schedule is in v2 format and update as per v2 format if it is
19421971
if self.job_definition_name is not None:
19431972
self._update_data_quality_monitoring_schedule(
@@ -1958,13 +1987,17 @@ def update_monitoring_schedule(
19581987
network_config=network_config,
19591988
enable_cloudwatch_metrics=enable_cloudwatch_metrics,
19601989
role=role,
1990+
batch_transform_input=batch_transform_input,
19611991
)
19621992
return
19631993

19641994
monitoring_inputs = None
19651995
if endpoint_input is not None:
19661996
monitoring_inputs = [self._normalize_endpoint_input(endpoint_input)._to_request_dict()]
19671997

1998+
elif batch_transform_input is not None:
1999+
monitoring_inputs = [batch_transform_input._to_request_dict()]
2000+
19682001
record_preprocessor_script_s3_uri = None
19692002
if record_preprocessor_script is not None:
19702003
record_preprocessor_script_s3_uri = self._s3_uri_from_local_path(
@@ -3022,6 +3055,15 @@ def update_monitoring_schedule(
30223055
self._update_monitoring_schedule(self.job_definition_name, schedule_cron_expression)
30233056
return
30243057

3058+
if (batch_transform_input is not None) and (endpoint_input is not None):
3059+
message = (
3060+
"Cannot update both batch_transform_input and endpoint_input to update an "
3061+
"Amazon Model Monitoring Schedule. "
3062+
"Please provide atmost one of the above required inputs"
3063+
)
3064+
_LOGGER.error(message)
3065+
raise ValueError(message)
3066+
30253067
# Need to update schedule with a new job definition
30263068
job_desc = self.sagemaker_session.sagemaker_client.describe_model_quality_job_definition(
30273069
JobDefinitionName=self.job_definition_name

tests/conftest.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ def mxnet_eia_latest_py_version():
243243

244244
@pytest.fixture(scope="module", params=["py2", "py3"])
245245
def pytorch_training_py_version(pytorch_training_version, request):
246-
if Version(pytorch_training_version) >= Version("1.13"):
246+
if Version(pytorch_training_version) >= Version("2.0"):
247+
return "py310"
248+
elif Version(pytorch_training_version) >= Version("1.13"):
247249
return "py39"
248250
elif Version(pytorch_training_version) >= Version("1.9"):
249251
return "py38"
@@ -255,7 +257,9 @@ def pytorch_training_py_version(pytorch_training_version, request):
255257

256258
@pytest.fixture(scope="module", params=["py2", "py3"])
257259
def pytorch_inference_py_version(pytorch_inference_version, request):
258-
if Version(pytorch_inference_version) >= Version("1.13"):
260+
if Version(pytorch_inference_version) >= Version("2.0"):
261+
return "py310"
262+
elif Version(pytorch_inference_version) >= Version("1.13"):
259263
return "py39"
260264
elif Version(pytorch_inference_version) >= Version("1.9"):
261265
return "py38"

0 commit comments

Comments
 (0)