Skip to content

Commit cdf0e68

Browse files
authored
Merge pull request #2 from aws/master
merge master
2 parents ddd06bb + 561301e commit cdf0e68

File tree

97 files changed

+3172
-238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3172
-238
lines changed

CHANGELOG.md

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

3+
## v2.192.0 (2023-10-11)
4+
5+
### Features
6+
7+
* jumpstart estimator enable infra check flag
8+
* jumpstart default payloads
9+
* allow non-python files in job dependencies
10+
* allow configuring docker container in local mode
11+
12+
### Bug Fixes and Other Changes
13+
14+
* js tagging s3 prefix
15+
* Batch transform: Add support for split_type == "None" in local mode
16+
* use correct line endings and s3 uris on windows
17+
* Fixed bug in _create_training_details
18+
* DJL Neuronx 0.24.0
19+
20+
### Documentation Changes
21+
22+
* Include FeatureGroup's load_feature_definitions API documentation
23+
24+
## v2.191.0 (2023-10-05)
25+
26+
### Features
27+
28+
* Selective Step Execution milestone 2 features
29+
* feature-processor extra data sources support
30+
31+
## v2.190.0 (2023-10-04)
32+
33+
### Features
34+
35+
* Add support for in-memory feature groups and collection type features in Feature Store.
36+
37+
### Bug Fixes and Other Changes
38+
39+
* chore: xfail resource in use failure for specific test
40+
* Add missing API docs for processors
41+
42+
### Documentation Changes
43+
44+
* Bring back (de)serializers documentation
45+
* Add missing AirFlow operators + link to airflow documentation
46+
47+
## v2.189.0 (2023-10-03)
48+
49+
### Features
50+
51+
* add feature processor APIs to public doc
52+
* s3 prefix model data for JumpStartModel
53+
* Model Package support for updating approval
54+
55+
### Bug Fixes and Other Changes
56+
57+
* Add bucket owner check
58+
* transform step unit test
59+
* Release TGI 1.1.0 Image
60+
361
## v2.188.0 (2023-09-26)
462

563
### Features

VERSION

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

doc/api/inference/deserializers.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
Deserializers
22
-------------
33

4-
.. automodule:: sagemaker.deserializers
4+
.. automodule:: sagemaker.base_deserializers
55
:members:
66
:undoc-members:
77
:show-inheritance:
88

9+
.. automodule:: sagemaker.deserializers
10+
:members:
11+
:undoc-members:
12+
:show-inheritance:

doc/api/inference/serializers.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
Serializers
22
-----------
33

4-
.. automodule:: sagemaker.serializers
4+
.. automodule:: sagemaker.base_serializers
55
:members:
66
:undoc-members:
77
:show-inheritance:
88

9+
.. automodule:: sagemaker.serializers
10+
:members:
11+
:undoc-members:
12+
:show-inheritance:

doc/api/prep_data/feature_store.rst

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Feature Group
66

77
.. autoclass:: sagemaker.feature_store.feature_group.FeatureGroup
88
:members:
9-
:exclude-members: load_feature_definitions
109
:show-inheritance:
1110

1211
.. autoclass:: sagemaker.feature_store.feature_group.AthenaQuery
@@ -41,6 +40,25 @@ Feature Definition
4140
:members:
4241
:show-inheritance:
4342

43+
.. autoclass:: sagemaker.feature_store.feature_definition.CollectionTypeEnum
44+
:members:
45+
:show-inheritance:
46+
47+
.. autoclass:: sagemaker.feature_store.feature_definition.CollectionType
48+
:members:
49+
:show-inheritance:
50+
51+
.. autoclass:: sagemaker.feature_store.feature_definition.ListCollectionType
52+
:members:
53+
:show-inheritance:
54+
55+
.. autoclass:: sagemaker.feature_store.feature_definition.SetCollectionType
56+
:members:
57+
:show-inheritance:
58+
59+
.. autoclass:: sagemaker.feature_store.feature_definition.VectorCollectionType
60+
:members:
61+
:show-inheritance:
4462

4563
Inputs
4664
******
@@ -77,6 +95,10 @@ Inputs
7795
:members:
7896
:show-inheritance:
7997

98+
.. autoclass:: sagemaker.feature_store.inputs.OnlineStoreStorageTypeEnum
99+
:members:
100+
:show-inheritance:
101+
80102
.. autoclass:: sagemaker.feature_store.inputs.ResourceEnum
81103
:members:
82104
:show-inheritance:
@@ -120,3 +142,41 @@ Feature Store
120142
.. autoclass:: sagemaker.feature_store.feature_store.FeatureStore
121143
:members:
122144
:show-inheritance:
145+
146+
147+
@feature_processor Decorator
148+
****************************
149+
150+
.. autodecorator:: sagemaker.feature_store.feature_processor.feature_processor
151+
152+
153+
Feature Processor Data Source
154+
*****************************
155+
156+
.. autoclass:: sagemaker.feature_store.feature_processor.FeatureGroupDataSource
157+
:members:
158+
:show-inheritance:
159+
160+
.. autoclass:: sagemaker.feature_store.feature_processor.CSVDataSource
161+
:members:
162+
:show-inheritance:
163+
164+
.. autoclass:: sagemaker.feature_store.feature_processor.ParquetDataSource
165+
:members:
166+
:show-inheritance:
167+
168+
169+
Feature Processor Scheduler
170+
***************************
171+
172+
.. automethod:: sagemaker.feature_store.feature_processor.to_pipeline
173+
174+
.. automethod:: sagemaker.feature_store.feature_processor.schedule
175+
176+
.. automethod:: sagemaker.feature_store.feature_processor.execute
177+
178+
.. automethod:: sagemaker.feature_store.feature_processor.delete_schedule
179+
180+
.. automethod:: sagemaker.feature_store.feature_processor.describe
181+
182+
.. automethod:: sagemaker.feature_store.feature_processor.list_pipelines

doc/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@
109109
# autosectionlabel
110110
autosectionlabel_prefix_document = True
111111

112+
autodoc_mock_imports = ["pyspark", "feature_store_pyspark", "py4j"]
113+
112114

113115
def setup(app):
114116
sys.stdout.write("Generating JumpStart model table...")

doc/frameworks/huggingface/sagemaker.huggingface.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,11 @@ Hugging Face Predictor
3232
:members:
3333
:undoc-members:
3434
:show-inheritance:
35+
36+
Hugging Face Processor
37+
----------------------
38+
39+
.. autoclass:: sagemaker.huggingface.processing.HuggingFaceProcessor
40+
:members:
41+
:undoc-members:
42+
:show-inheritance:

doc/frameworks/mxnet/sagemaker.mxnet.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,33 @@ MXNet Classes
33

44

55
MXNet Estimator
6-
---------------------------
6+
---------------
77

88
.. autoclass:: sagemaker.mxnet.estimator.MXNet
99
:members:
1010
:undoc-members:
1111
:show-inheritance:
1212

1313
MXNet Model
14-
---------------------------
14+
-----------
1515

1616
.. autoclass:: sagemaker.mxnet.model.MXNetModel
1717
:members:
1818
:undoc-members:
1919
:show-inheritance:
2020

2121
MXNet Predictor
22-
---------------------------
22+
---------------
2323

2424
.. autoclass:: sagemaker.mxnet.model.MXNetPredictor
2525
:members:
2626
:undoc-members:
2727
:show-inheritance:
28+
29+
MXNet Processor
30+
---------------
31+
32+
.. autoclass:: sagemaker.mxnet.processing.MXNetProcessor
33+
:members:
34+
:undoc-members:
35+
:show-inheritance:

doc/frameworks/pytorch/sagemaker.pytorch.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,11 @@ PyTorch Predictor
2424
:members:
2525
:undoc-members:
2626
:show-inheritance:
27+
28+
PyTorch Processor
29+
-----------------
30+
31+
.. autoclass:: sagemaker.pytorch.processing.PyTorchProcessor
32+
:members:
33+
:undoc-members:
34+
:show-inheritance:

doc/frameworks/tensorflow/sagemaker.tensorflow.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,12 @@ TensorFlow Serving Predictor
3333
:members:
3434
:undoc-members:
3535
:show-inheritance:
36+
37+
38+
TensorFlow Processor
39+
--------------------
40+
41+
.. autoclass:: sagemaker.tensorflow.processing.TensorFlowProcessor
42+
:members:
43+
:undoc-members:
44+
:show-inheritance:

doc/overview.rst

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,9 +1560,20 @@ You can install necessary dependencies for this feature using pip.
15601560
Additionally, Local Mode also requires Docker Compose V2. Follow the guidelines in https://docs.docker.com/compose/install/ to install.
15611561
Make sure to have a Compose Version compatible with your Docker Engine installation. Check Docker Engine release notes https://docs.docker.com/engine/release-notes to find a compatible version.
15621562

1563-
If you want to keep everything local, and not use Amazon S3 either, you can enable "local code" in one of two ways:
1563+
Local mode configuration
1564+
========================
15641565

1565-
- Create a file at ``~/.sagemaker/config.yaml`` that contains:
1566+
The local mode uses a YAML configuration file located at ``~/.sagemaker/config.yaml`` to define the default values that are automatically passed to the ``config`` attribute of ``LocalSession``. This is an example of the configuration, for the full schema, see `sagemaker.config.config_schema.SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA <https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/config/config_schema.py>`_.
1567+
1568+
.. code:: yaml
1569+
1570+
local:
1571+
local_code: true # Using everything locally
1572+
region_name: "us-west-2" # Name of the region
1573+
container_config: # Additional docker container config
1574+
shm_size: "128M
1575+
1576+
If you want to keep everything local, and not use Amazon S3 either, you can enable "local code" in one of two ways:
15661577
15671578
.. code:: yaml
15681579
@@ -1583,6 +1594,9 @@ If you want to keep everything local, and not use Amazon S3 either, you can enab
15831594
.. note::
15841595
If you enable "local code," then you cannot use the ``dependencies`` parameter in your estimator or model.
15851596

1597+
Activating local mode by ``instance_type`` argument
1598+
====================================================
1599+
15861600
We can take the example in `Using Estimators <#using-estimators>`__ , and use either ``local`` or ``local_gpu`` as the instance type.
15871601

15881602
.. code:: python

doc/workflows/airflow/using_workflow.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ the configuration dictionary in the SageMaker Python SDK. Currently, the followi
2222
* ``SageMakerTransformOperator``
2323
* ``SageMakerEndpointConfigOperator``
2424
* ``SageMakerEndpointOperator``
25+
* ``SageMakerProcessingOperator``
26+
* ``SageMakerDeleteModelOperator``
27+
* ``SageMakerStartPipelineOperator``
28+
* ``SageMakerStopPipelineOperator``
29+
* ``SageMakerRegisterModelVersionOperator``
30+
* ``SageMakerAutoMLOperator``
31+
* ``SageMakerCreateExperimentOperator``
32+
33+
You can look into `the Apache Airflow documentation <https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/operators/sagemaker.html>`_ for the full
34+
list of operators with examples.
2535

2636
2. PythonOperator: Airflow built-in operator that executes Python callables. You can use the PythonOperator to execute
2737
operations in the SageMaker Python SDK to create a SageMaker workflow.

src/sagemaker/base_predictor.py

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from __future__ import print_function, absolute_import
1515

1616
import abc
17-
from typing import Any, Tuple
17+
from typing import Any, Optional, Tuple, Union
1818

1919
from sagemaker.deprecations import (
2020
deprecated_class,
@@ -32,6 +32,9 @@
3232
StreamDeserializer,
3333
StringDeserializer,
3434
)
35+
from sagemaker.jumpstart.payload_utils import PayloadSerializer
36+
from sagemaker.jumpstart.types import JumpStartSerializablePayload
37+
from sagemaker.jumpstart.utils import get_jumpstart_content_bucket
3538
from sagemaker.model_monitor import (
3639
DataCaptureConfig,
3740
DefaultModelMonitor,
@@ -201,20 +204,44 @@ def _create_request_args(
201204
custom_attributes=None,
202205
):
203206
"""Placeholder docstring"""
207+
208+
jumpstart_serialized_data: Optional[Union[str, bytes]] = None
209+
jumpstart_accept: Optional[str] = None
210+
jumpstart_content_type: Optional[str] = None
211+
212+
if isinstance(data, JumpStartSerializablePayload):
213+
s3_client = self.sagemaker_session.s3_client
214+
region = self.sagemaker_session._region_name
215+
bucket = get_jumpstart_content_bucket(region)
216+
217+
jumpstart_serialized_data = PayloadSerializer(
218+
bucket=bucket, region=region, s3_client=s3_client
219+
).serialize(data)
220+
jumpstart_content_type = data.content_type
221+
jumpstart_accept = data.accept
222+
204223
args = dict(initial_args) if initial_args else {}
205224

206225
if "EndpointName" not in args:
207226
args["EndpointName"] = self.endpoint_name
208227

209228
if "ContentType" not in args:
210-
args["ContentType"] = (
211-
self.content_type
212-
if isinstance(self.content_type, str)
213-
else ", ".join(self.content_type)
214-
)
229+
if isinstance(data, JumpStartSerializablePayload) and jumpstart_content_type:
230+
args["ContentType"] = jumpstart_content_type
231+
else:
232+
args["ContentType"] = (
233+
self.content_type
234+
if isinstance(self.content_type, str)
235+
else ", ".join(self.content_type)
236+
)
215237

216238
if "Accept" not in args:
217-
args["Accept"] = self.accept if isinstance(self.accept, str) else ", ".join(self.accept)
239+
if isinstance(data, JumpStartSerializablePayload) and jumpstart_accept:
240+
args["Accept"] = jumpstart_accept
241+
else:
242+
args["Accept"] = (
243+
self.accept if isinstance(self.accept, str) else ", ".join(self.accept)
244+
)
218245

219246
if target_model:
220247
args["TargetModel"] = target_model
@@ -228,7 +255,11 @@ def _create_request_args(
228255
if custom_attributes:
229256
args["CustomAttributes"] = custom_attributes
230257

231-
data = self.serializer.serialize(data)
258+
data = (
259+
jumpstart_serialized_data
260+
if isinstance(data, JumpStartSerializablePayload) and jumpstart_serialized_data
261+
else self.serializer.serialize(data)
262+
)
232263

233264
args["Body"] = data
234265
return args

0 commit comments

Comments
 (0)