Skip to content

Commit 1c1f2d2

Browse files
authored
Merge branch 'master' into fix-issue-2426
2 parents 003de65 + 9e1fe91 commit 1c1f2d2

File tree

11 files changed

+80
-33
lines changed

11 files changed

+80
-33
lines changed

CHANGELOG.md

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

3+
## v2.48.2 (2021-07-12)
4+
5+
### Bug Fixes and Other Changes
6+
7+
* default time for compilation jobs
8+
* skip hf inference test
9+
10+
## v2.48.1 (2021-07-08)
11+
12+
### Bug Fixes and Other Changes
13+
14+
* skip HF inference test
15+
* remove upsert from test_workflow
16+
17+
### Documentation Changes
18+
19+
* Add Hugging Face docs
20+
* add tuning step to doc
21+
322
## v2.48.0 (2021-07-07)
423

524
### Features

VERSION

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

doc/api/inference/model_monitor.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ Model Monitor
2626
:members:
2727
:undoc-members:
2828
:show-inheritance:
29+
30+
.. automodule:: sagemaker.model_monitor.clarify_model_monitoring
31+
:members:
32+
:undoc-members:
33+
:show-inheritance:

doc/frameworks/huggingface/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ For general information about using the SageMaker Python SDK, see :ref:`overview
99
:maxdepth: 2
1010

1111
sagemaker.huggingface
12-
Use Hugging Face with the SageMaker Python SDK <https://huggingface.co/transformers/sagemaker.html>
12+
Train Hugging Face models on Amazon SageMaker with the SageMaker Python SDK <https://huggingface.co/docs/sagemaker/train>
13+
Deploy Hugging Face models to Amazon SageMaker with the SageMaker Python SDK <https://huggingface.co/docs/sagemaker/inference>
Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1-
HuggingFace
2-
===========
1+
Hugging Face
2+
============
33

4-
HuggingFace Estimator
5-
---------------------
4+
Hugging Face Estimator
5+
----------------------
66

77
.. autoclass:: sagemaker.huggingface.estimator.HuggingFace
88
:members:
99
:undoc-members:
1010
:show-inheritance:
11+
12+
Hugging Face Model
13+
------------------
14+
15+
.. autoclass:: sagemaker.huggingface.model.HuggingFaceModel
16+
:members:
17+
:undoc-members:
18+
:show-inheritance:
19+
20+
HuggingFace Predictor
21+
---------------------
22+
23+
.. autoclass:: sagemaker.huggingface.model.HuggingFacePredictor
24+
:members:
25+
:undoc-members:
26+
:show-inheritance:

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,17 @@ Steps
111111

112112
.. autoclass:: sagemaker.workflow.steps.TrainingStep
113113

114-
.. autoclass:: sagemaker.workflow.steps.CreateModelStep
114+
.. autoclass:: sagemaker.workflow.steps.TuningStep
115+
116+
.. autofunction:: sagemaker.workflow.steps.TuningStep.get_top_model_s3_uri
115117

116118
.. autoclass:: sagemaker.workflow.steps.TransformStep
117119

118120
.. autoclass:: sagemaker.workflow.steps.ProcessingStep
119121

120-
.. autoclass:: sagemaker.workflow.steps.TuningStep
122+
.. autoclass:: sagemaker.workflow.steps.CreateModelStep
123+
124+
.. autoclass:: sagemaker.workflow.callback_step.CallbackStep
121125

122126
Utilities
123127
---------

src/sagemaker/estimator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ def compile_model(
718718
'onnx', 'xgboost'
719719
framework_version (str): The version of the framework
720720
compile_max_run (int): Timeout in seconds for compilation (default:
721-
3 * 60). After this amount of time Amazon SageMaker Neo
721+
15 * 60). After this amount of time Amazon SageMaker Neo
722722
terminates the compilation job regardless of its current status.
723723
tags (list[dict]): List of tags for labeling a compilation job. For
724724
more, see

src/sagemaker/huggingface/model.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030

3131

3232
class HuggingFacePredictor(Predictor):
33-
"""A Predictor for inference against HuggingFace Endpoints.
33+
"""A Predictor for inference against Hugging Face Endpoints.
3434
3535
This is able to serialize Python lists, dictionaries, and numpy arrays to
36-
multidimensional tensors for HuggingFace inference.
36+
multidimensional tensors for Hugging Face inference.
3737
"""
3838

3939
def __init__(
@@ -48,7 +48,7 @@ def __init__(
4848
Args:
4949
endpoint_name (str): The name of the endpoint to perform inference
5050
on.
51-
sagemaker_session (sagemaker.session.Session): Session object which
51+
sagemaker_session (sagemaker.session.Session): Session object that
5252
manages interactions with Amazon SageMaker APIs and any other
5353
AWS services needed. If not specified, the estimator creates one
5454
using the default AWS configuration chain.
@@ -85,7 +85,7 @@ def _validate_pt_tf_versions(pytorch_version, tensorflow_version, image_uri):
8585

8686

8787
class HuggingFaceModel(FrameworkModel):
88-
"""An HuggingFace SageMaker ``Model`` that can be deployed to a SageMaker ``Endpoint``."""
88+
"""A Hugging Face SageMaker ``Model`` that can be deployed to a SageMaker ``Endpoint``."""
8989

9090
_framework_name = "huggingface"
9191

@@ -106,19 +106,19 @@ def __init__(
106106
"""Initialize a HuggingFaceModel.
107107
108108
Args:
109-
model_data (str): The S3 location of a SageMaker model data
109+
model_data (str): The Amazon S3 location of a SageMaker model data
110110
``.tar.gz`` file.
111-
role (str): An AWS IAM role (either name or full ARN). The Amazon
111+
role (str): An AWS IAM role specified with either the name or full ARN. The Amazon
112112
SageMaker training jobs and APIs that create Amazon SageMaker
113113
endpoints use this role to access training data and model
114114
artifacts. After the endpoint is created, the inference code
115115
might use the IAM role, if it needs to access an AWS resource.
116-
entry_point (str): Path (absolute or relative) to the Python source
117-
file which should be executed as the entry point to model
116+
entry_point (str): The absolute or relative path to the Python source
117+
file that should be executed as the entry point to model
118118
hosting. If ``source_dir`` is specified, then ``entry_point``
119119
must point to a file located at the root of ``source_dir``.
120120
Defaults to None.
121-
transformers_version (str): transformers version you want to use for
121+
transformers_version (str): Transformers version you want to use for
122122
executing your model training code. Defaults to None. Required
123123
unless ``image_uri`` is provided.
124124
tensorflow_version (str): TensorFlow version you want to use for
@@ -132,7 +132,7 @@ def __init__(
132132
py_version (str): Python version you want to use for executing your
133133
model training code. Defaults to ``None``. Required unless
134134
``image_uri`` is provided.
135-
image_uri (str): A Docker image URI (default: None). If not specified, a
135+
image_uri (str): A Docker image URI. Defaults to None. If not specified, a
136136
default image for PyTorch will be used. If ``framework_version``
137137
or ``py_version`` are ``None``, then ``image_uri`` is required. If
138138
also ``None``, then a ``ValueError`` will be raised.
@@ -197,19 +197,21 @@ def register(
197197
transform_instances (list): A list of the instance types on which a transformation
198198
job can be run or on which an endpoint can be deployed.
199199
model_package_name (str): Model Package name, exclusive to `model_package_group_name`,
200-
using `model_package_name` makes the Model Package un-versioned (default: None).
200+
using `model_package_name` makes the Model Package un-versioned.
201+
Defaults to ``None``.
201202
model_package_group_name (str): Model Package Group name, exclusive to
202203
`model_package_name`, using `model_package_group_name` makes the Model Package
203-
versioned (default: None).
204-
image_uri (str): Inference image uri for the container. Model class' self.image will
205-
be used if it is None (default: None).
206-
model_metrics (ModelMetrics): ModelMetrics object (default: None).
207-
metadata_properties (MetadataProperties): MetadataProperties object (default: None).
204+
versioned. Defaults to ``None``.
205+
image_uri (str): Inference image URI for the container. Model class' self.image will
206+
be used if it is None. Defaults to ``None``.
207+
model_metrics (ModelMetrics): ModelMetrics object. Defaults to ``None``.
208+
metadata_properties (MetadataProperties): MetadataProperties object.
209+
Defaults to ``None``.
208210
marketplace_cert (bool): A boolean value indicating if the Model Package is certified
209-
for AWS Marketplace (default: False).
211+
for AWS Marketplace. Defaults to ``False``.
210212
approval_status (str): Model Approval Status, values can be "Approved", "Rejected",
211-
or "PendingManualApproval" (default: "PendingManualApproval").
212-
description (str): Model Package description (default: None).
213+
or "PendingManualApproval". Defaults to ``PendingManualApproval``.
214+
description (str): Model Package description. Defaults to ``None``.
213215
214216
Returns:
215217
A `sagemaker.model.ModelPackage` instance.

src/sagemaker/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ def compile(
559559
role,
560560
tags=None,
561561
job_name=None,
562-
compile_max_run=5 * 60,
562+
compile_max_run=15 * 60,
563563
framework=None,
564564
framework_version=None,
565565
target_platform_os=None,
@@ -588,7 +588,7 @@ def compile(
588588
https://docs.aws.amazon.com/sagemaker/latest/dg/API_Tag.html.
589589
job_name (str): The name of the compilation job
590590
compile_max_run (int): Timeout in seconds for compilation (default:
591-
3 * 60). After this amount of time Amazon SageMaker Neo
591+
15 * 60). After this amount of time Amazon SageMaker Neo
592592
terminates the compilation job regardless of its current status.
593593
framework (str): The framework that is used to train the original
594594
model. Allowed values: 'mxnet', 'tensorflow', 'keras', 'pytorch',

src/sagemaker/model_monitor/clarify_model_monitoring.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,7 @@ def suggested_constraints(self, file_name=None, kms_key=None):
12481248
"""Returns a sagemaker.model_monitor.
12491249
12501250
Constraints object representing the constraints JSON file generated by this baselining job.
1251+
12511252
Args:
12521253
file_name (str): Keep this parameter to align with method signature in super class,
12531254
but it will be ignored.

tests/integ/test_huggingface.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,8 @@ def test_huggingface_training_tf(
108108
hf.fit(train_input)
109109

110110

111-
@pytest.mark.release
112-
@pytest.mark.skipif(
113-
integ.test_region() in integ.TRAINING_NO_P2_REGIONS, reason="no ml.p2 instances in this region"
111+
@pytest.mark.skip(
112+
reason="need to re enable it later",
114113
)
115114
def test_huggingface_inference(
116115
sagemaker_session,

0 commit comments

Comments
 (0)