Skip to content

Commit 585de94

Browse files
Merge branch 'aws:master' into master
2 parents 5cf09d4 + 4c0d3cf commit 585de94

38 files changed

+1661
-159
lines changed

CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,62 @@
11
# Changelog
22

3+
## v2.46.1 (2021-06-22)
4+
5+
### Bug Fixes and Other Changes
6+
7+
* Register model step tags
8+
9+
### Documentation Changes
10+
11+
* update to include new batch_get_record api call
12+
* Correct type annotation for TrainingStep inputs
13+
* introduce input mode FastFile
14+
* update hf transformer version
15+
16+
## v2.46.0 (2021-06-15)
17+
18+
### Features
19+
20+
* Add HF transformer version 4.6.1
21+
22+
### Bug Fixes and Other Changes
23+
24+
* encode localmode payload to UTF-8
25+
* call DescribeDomain as fallback in get_execution_role
26+
* parameterize PT and TF version for HuggingFace tests
27+
28+
### Documentation Changes
29+
30+
* Add import statement in Batch Transform Overview doc
31+
32+
## v2.45.0 (2021-06-07)
33+
34+
### Features
35+
36+
* Add support for Callback steps in model building pipelines
37+
38+
## v2.44.0 (2021-06-01)
39+
40+
### Features
41+
42+
* support endpoint_name_prefix, seed and version for Clarify
43+
44+
## v2.43.0 (2021-05-31)
45+
46+
### Features
47+
48+
* add xgboost framework version 1.3-1
49+
50+
### Bug Fixes and Other Changes
51+
52+
* remove duplicated tags in _append_project_tags
53+
54+
## v2.42.1 (2021-05-27)
55+
56+
### Bug Fixes and Other Changes
57+
58+
* default value removed if zero for integer param
59+
360
## v2.42.0 (2021-05-24)
461

562
### Features

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.42.1.dev0
1+
2.46.2.dev0

doc/amazon_sagemaker_featurestore.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,13 @@ example identifier to retrieve the record.
291291
record_identifier_value = str(2990130)
292292
featurestore_runtime.get_record(FeatureGroupName=transaction_feature_group_name, RecordIdentifierValueAsString=record_identifier_value)
293293
294+
You can use the ``batch_get_record`` function to retrieve multiple records simultaneously from your feature store. The following example uses this API to retrieve a batch of records.
295+
296+
.. code:: python
297+
298+
record_identifier_values = ["573291", "109382", "828400", "124013"]
299+
featurestore_runtime.batch_get_record(Identifiers=[{"FeatureGroupName": transaction_feature_group_name, "RecordIdentifiersValueAsString": record_identifier_values}])
300+
294301
An example response from the fraud detection example:
295302
296303
.. code:: python

doc/frameworks/pytorch/using_pytorch.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ To train a PyTorch model by using the SageMaker Python SDK:
3131
Prepare a PyTorch Training Script
3232
=================================
3333

34-
Your PyTorch training script must be a Python 2.7 or 3.5 compatible source file.
34+
Your PyTorch training script must be a Python 3.6 compatible source file.
3535

3636
Prepare your script in a separate source file than the notebook, terminal session, or source file you're
3737
using to submit the script to SageMaker via a ``PyTorch`` Estimator. This will be discussed in further detail below.

doc/overview.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,8 @@ Alternatively, if you already have a SageMaker model, you can create an instance
703703

704704
.. code:: python
705705
706+
from sagemaker.transformer import Transformer
707+
706708
transformer = Transformer(model_name='my-previously-trained-model',
707709
instance_count=1,
708710
instance_type='ml.m4.xlarge')

doc/workflows/pipelines/sagemaker.workflow.pipelines.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ ConditionStep
66

77
.. autoclass:: sagemaker.workflow.condition_step.ConditionStep
88

9-
.. autoclass:: sagemaker.workflow.condition_step.JsonGet
109

1110
Conditions
1211
----------
@@ -55,6 +54,7 @@ Functions
5554
---------
5655

5756
.. autoclass:: sagemaker.workflow.functions.Join
57+
.. autoclass:: sagemaker.workflow.functions.JsonGet
5858

5959
Parameters
6060
----------

src/sagemaker/_studio.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def _append_project_tags(tags=None, working_dir=None):
4646
return tags
4747

4848
all_tags = tags or []
49+
additional_tags = [tag for tag in additional_tags if tag not in all_tags]
4950
all_tags.extend(additional_tags)
5051

5152
return all_tags

src/sagemaker/clarify.py

Lines changed: 93 additions & 23 deletions
Large diffs are not rendered by default.

src/sagemaker/estimator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,8 @@ def register(
10071007
if compile_model_family is not None:
10081008
model = self._compiled_models[compile_model_family]
10091009
else:
1010+
if "model_kms_key" not in kwargs:
1011+
kwargs["model_kms_key"] = self.output_kms_key
10101012
model = self.create_model(image_uri=image_uri, **kwargs)
10111013
model.name = model_name
10121014
return model.register(

src/sagemaker/feature_store/feature_group.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from __future__ import absolute_import
2323

24+
import copy
2425
import logging
2526
import math
2627
import os
@@ -193,6 +194,10 @@ def _ingest_single_batch(
193194
Returns:
194195
List of row indices that failed to be ingested.
195196
"""
197+
retry_config = client_config.retries
198+
if "max_attempts" not in retry_config and "total_max_attempts" not in retry_config:
199+
client_config = copy.deepcopy(client_config)
200+
client_config.retries = {"max_attempts": 10, "mode": "standard"}
196201
sagemaker_featurestore_runtime_client = boto3.Session().client(
197202
service_name="sagemaker-featurestore-runtime", config=client_config
198203
)

src/sagemaker/huggingface/estimator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(
6666
must point to a file located at the root of ``source_dir``.
6767
transformers_version (str): Transformers version you want to use for
6868
executing your model training code. Defaults to ``None``. Required unless
69-
``image_uri`` is provided. The current supported version is ``4.4.2``.
69+
``image_uri`` is provided. The current supported version is ``4.6.1``.
7070
tensorflow_version (str): TensorFlow version you want to use for
7171
executing your model training code. Defaults to ``None``. Required unless
7272
``pytorch_version`` is provided. The current supported version is ``1.6.0``.

src/sagemaker/image_uri_config/huggingface.json

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"processors": ["gpu"],
44
"version_aliases": {
55
"4.4": "4.4.2",
6-
"4.5": "4.5.0"
6+
"4.5": "4.5.0",
7+
"4.6": "4.6.1"
78
},
89
"versions": {
910
"4.4.2": {
@@ -137,6 +138,103 @@
137138
},
138139
"repository": "huggingface-tensorflow-training"
139140
}
141+
},
142+
"4.6.1": {
143+
"version_aliases": {
144+
"pytorch1.6": "pytorch1.6.0",
145+
"pytorch1.7": "pytorch1.7.1",
146+
"tensorflow2.4": "tensorflow2.4.1"
147+
},
148+
"pytorch1.6.0": {
149+
"py_versions": ["py36"],
150+
"registries": {
151+
"af-south-1": "626614931356",
152+
"ap-east-1": "871362719292",
153+
"ap-northeast-1": "763104351884",
154+
"ap-northeast-2": "763104351884",
155+
"ap-south-1": "763104351884",
156+
"ap-southeast-1": "763104351884",
157+
"ap-southeast-2": "763104351884",
158+
"ca-central-1": "763104351884",
159+
"cn-north-1": "727897471807",
160+
"cn-northwest-1": "727897471807",
161+
"eu-central-1": "763104351884",
162+
"eu-north-1": "763104351884",
163+
"eu-west-1": "763104351884",
164+
"eu-west-2": "763104351884",
165+
"eu-west-3": "763104351884",
166+
"eu-south-1": "692866216735",
167+
"me-south-1": "217643126080",
168+
"sa-east-1": "763104351884",
169+
"us-east-1": "763104351884",
170+
"us-east-2": "763104351884",
171+
"us-gov-west-1": "442386744353",
172+
"us-iso-east-1": "886529160074",
173+
"us-west-1": "763104351884",
174+
"us-west-2": "763104351884"
175+
},
176+
"repository": "huggingface-pytorch-training"
177+
},
178+
"pytorch1.7.1": {
179+
"py_versions": ["py36"],
180+
"registries": {
181+
"af-south-1": "626614931356",
182+
"ap-east-1": "871362719292",
183+
"ap-northeast-1": "763104351884",
184+
"ap-northeast-2": "763104351884",
185+
"ap-south-1": "763104351884",
186+
"ap-southeast-1": "763104351884",
187+
"ap-southeast-2": "763104351884",
188+
"ca-central-1": "763104351884",
189+
"cn-north-1": "727897471807",
190+
"cn-northwest-1": "727897471807",
191+
"eu-central-1": "763104351884",
192+
"eu-north-1": "763104351884",
193+
"eu-west-1": "763104351884",
194+
"eu-west-2": "763104351884",
195+
"eu-west-3": "763104351884",
196+
"eu-south-1": "692866216735",
197+
"me-south-1": "217643126080",
198+
"sa-east-1": "763104351884",
199+
"us-east-1": "763104351884",
200+
"us-east-2": "763104351884",
201+
"us-gov-west-1": "442386744353",
202+
"us-iso-east-1": "886529160074",
203+
"us-west-1": "763104351884",
204+
"us-west-2": "763104351884"
205+
},
206+
"repository": "huggingface-pytorch-training"
207+
},
208+
"tensorflow2.4.1": {
209+
"py_versions": ["py37"],
210+
"registries": {
211+
"af-south-1": "626614931356",
212+
"ap-east-1": "871362719292",
213+
"ap-northeast-1": "763104351884",
214+
"ap-northeast-2": "763104351884",
215+
"ap-south-1": "763104351884",
216+
"ap-southeast-1": "763104351884",
217+
"ap-southeast-2": "763104351884",
218+
"ca-central-1": "763104351884",
219+
"cn-north-1": "727897471807",
220+
"cn-northwest-1": "727897471807",
221+
"eu-central-1": "763104351884",
222+
"eu-north-1": "763104351884",
223+
"eu-south-1": "692866216735",
224+
"eu-west-1": "763104351884",
225+
"eu-west-2": "763104351884",
226+
"eu-west-3": "763104351884",
227+
"me-south-1": "217643126080",
228+
"sa-east-1": "763104351884",
229+
"us-east-1": "763104351884",
230+
"us-east-2": "763104351884",
231+
"us-gov-west-1": "442386744353",
232+
"us-iso-east-1": "886529160074",
233+
"us-west-1": "763104351884",
234+
"us-west-2": "763104351884"
235+
},
236+
"repository": "huggingface-tensorflow-training"
237+
}
140238
}
141239
}
142240
}

src/sagemaker/image_uri_config/xgboost.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,35 @@
183183
"us-west-2": "246618743249"
184184
},
185185
"repository": "sagemaker-xgboost"
186+
},
187+
"1.3-1": {
188+
"registries": {
189+
"af-south-1": "510948584623",
190+
"ap-east-1": "651117190479",
191+
"ap-northeast-1": "354813040037",
192+
"ap-northeast-2": "366743142698",
193+
"ap-south-1": "720646828776",
194+
"ap-southeast-1": "121021644041",
195+
"ap-southeast-2": "783357654285",
196+
"ca-central-1": "341280168497",
197+
"cn-north-1": "450853457545",
198+
"cn-northwest-1": "451049120500",
199+
"eu-central-1": "492215442770",
200+
"eu-north-1": "662702820516",
201+
"eu-west-1": "141502667606",
202+
"eu-west-2": "764974769150",
203+
"eu-west-3": "659782779980",
204+
"eu-south-1": "978288397137",
205+
"me-south-1": "801668240914",
206+
"sa-east-1": "737474898029",
207+
"us-east-1": "683313688378",
208+
"us-east-2": "257758044811",
209+
"us-gov-west-1": "414596584902",
210+
"us-iso-east-1": "833128469047",
211+
"us-west-1": "746614075791",
212+
"us-west-2": "246618743249"
213+
},
214+
"repository": "sagemaker-xgboost"
186215
}
187216
}
188217
}

src/sagemaker/inputs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ def __init__(
7070
a local directory.
7171
* 'Pipe' - Amazon SageMaker streams data directly from S3 to the container via
7272
a Unix-named pipe.
73+
* 'FastFile' - Amazon SageMaker streams data from S3 on demand instead of
74+
downloading the entire dataset before training begins.
7375
7476
attribute_names (list[str]): A list of one or more attribute names to use that are
7577
found in a specified AugmentedManifestFile.

src/sagemaker/local/local_session.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,9 @@ def invoke_endpoint(
469469
if InferenceId is not None:
470470
headers["X-Amzn-SageMaker-Inference-Id"] = InferenceId
471471

472+
# The http client encodes all strings using latin-1, which is not what we want.
473+
if isinstance(Body, str):
474+
Body = Body.encode("utf-8")
472475
r = self.http.request("POST", url, body=Body, preload_content=False, headers=headers)
473476

474477
return {"Body": r, "ContentType": Accept}

src/sagemaker/model.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def _get_model_package_args(
195195
marketplace_cert=False,
196196
approval_status=None,
197197
description=None,
198+
tags=None,
198199
):
199200
"""Get arguments for session.create_model_package method.
200201
@@ -250,6 +251,8 @@ def _get_model_package_args(
250251
model_package_args["approval_status"] = approval_status
251252
if description is not None:
252253
model_package_args["description"] = description
254+
if tags is not None:
255+
model_package_args["tags"] = tags
253256
return model_package_args
254257

255258
def _init_sagemaker_session_if_does_not_exist(self, instance_type):

0 commit comments

Comments
 (0)