Skip to content

Commit 6fd61c0

Browse files
committed
Merge branch 'master' into from-processing
2 parents a37d0bd + c9aa033 commit 6fd61c0

30 files changed

+566
-166
lines changed

CHANGELOG.md

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

3+
## v1.48.1 (2019-12-18)
4+
5+
### Bug fixes and other changes
6+
7+
* use name_from_base in auto_ml.py but unique_name_from_base in tests.
8+
* make test's custom bucket include region and account name.
9+
* add Keras to the list of Neo-supported frameworks
10+
11+
### Documentation changes
12+
13+
* add link to parent classes to clarify **kwargs
14+
* add link to framework-related parent classes to clarify **kwargs
15+
16+
## v1.48.0 (2019-12-17)
17+
18+
### Features
19+
20+
* allow setting the default bucket in Session
21+
22+
### Bug fixes and other changes
23+
24+
* set integration test parallelization to 512
25+
* shorten base job name to avoid collision
26+
* multi model integration test to create ECR repo with unique names to allow independent parallel executions
27+
328
## v1.47.1 (2019-12-16)
429

530
### Bug fixes and other changes

VERSION

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

buildspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ phases:
2020
- start_time=`date +%s`
2121
- |
2222
if has-matching-changes "tests/" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"; then
23-
tox -e py36 -- tests/integ -m "not local_mode" -n 48 --reruns 3 --reruns-delay 5 --durations 50 --boto-config '{"region_name": "us-east-2"}'
23+
tox -e py36 -- tests/integ -m "not local_mode" -n 512 --reruns 3 --reruns-delay 5 --durations 50 --boto-config '{"region_name": "us-east-2"}'
2424
fi
2525
- ./ci-scripts/displaytime.sh 'py36 tests/integ' $start_time
2626

src/sagemaker/algorithm.py

Lines changed: 65 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"). You
44
# may not use this file except in compliance with the License. A copy of
@@ -59,110 +59,72 @@ def __init__(
5959
6060
Args:
6161
algorithm_arn (str): algorithm arn used for training. Can be just the name if your
62-
account owns the algorithm.
63-
64-
role (str): An AWS IAM role (either name or full ARN). The Amazon SageMaker
65-
training jobs and APIsthat create Amazon SageMaker endpoints use this role to
66-
access training data and model artifacts. After the endpoint
67-
is created, the inference code might use the IAM role, if it
68-
needs to access an AWS resource.
69-
70-
train_instance_count (int): Number of Amazon EC2 instances to
62+
account owns the algorithm.
63+
role (str): An AWS IAM role (either name or full ARN). The Amazon SageMaker
64+
training jobs and APIsthat create Amazon SageMaker endpoints use this role to
65+
access training data and model artifacts. After the endpoint
66+
is created, the inference code might use the IAM role, if it
67+
needs to access an AWS resource.
68+
train_instance_count (int): Number of Amazon EC2 instances to
7169
use for training. train_instance_type (str): Type of EC2
7270
instance to use for training, for example, 'ml.c4.xlarge'.
73-
train_volume_size (int): Size in GB of the EBS volume to use for
74-
storing input data
75-
76-
during training (default: 30). Must be large enough to store
77-
training data if File Mode is used (which is the default).
78-
79-
train_volume_kms_key (str): Optional. KMS key ID for encrypting EBS volume attached
80-
to the training instance (default: None).
81-
82-
train_max_run (int): Timeout in seconds for training (default: 24 * 60 * 60).
83-
After this amount of time Amazon SageMaker terminates the
84-
job regardless of its current status.
85-
86-
input_mode (str): The input mode that the algorithm supports
87-
(default: 'File'). Valid modes:
88-
89-
* 'File' - Amazon SageMaker copies the training dataset from
90-
the S3 location to a local directory.
91-
* 'Pipe' - Amazon SageMaker streams data directly from S3 to
92-
the container via a Unix-named pipe.
93-
94-
This argument can be overriden on a per-channel basis using
95-
``sagemaker.session.s3_input.input_mode``.
96-
97-
output_path (str): S3 location for saving the training result (model artifacts and
98-
output files). If not specified, results are stored to a default bucket. If
99-
the bucket with the specific name does not exist, the
100-
estimator creates the bucket during the
101-
:meth:`~sagemaker.estimator.EstimatorBase.fit` method
102-
execution.
103-
104-
output_kms_key (str): Optional. KMS key ID for encrypting the
71+
train_volume_size (int): Size in GB of the EBS volume to use for
72+
storing input data during training (default: 30). Must be large enough to store
73+
training data if File Mode is used (which is the default).
74+
train_volume_kms_key (str): Optional. KMS key ID for encrypting EBS volume attached
75+
to the training instance (default: None).
76+
train_max_run (int): Timeout in seconds for training (default: 24 * 60 * 60).
77+
After this amount of time Amazon SageMaker terminates the
78+
job regardless of its current status.
79+
input_mode (str): The input mode that the algorithm supports
80+
(default: 'File'). Valid modes:
81+
82+
* 'File' - Amazon SageMaker copies the training dataset from
83+
the S3 location to a local directory.
84+
* 'Pipe' - Amazon SageMaker streams data directly from S3 to
85+
the container via a Unix-named pipe.
86+
87+
This argument can be overriden on a per-channel basis using
88+
``sagemaker.session.s3_input.input_mode``.
89+
90+
output_path (str): S3 location for saving the training result (model artifacts and
91+
output files). If not specified, results are stored to a default bucket. If
92+
the bucket with the specific name does not exist, the
93+
estimator creates the bucket during the
94+
:meth:`~sagemaker.estimator.EstimatorBase.fit` method
95+
execution.
96+
output_kms_key (str): Optional. KMS key ID for encrypting the
10597
training output (default: None). base_job_name (str): Prefix for
10698
training job name when the
10799
:meth:`~sagemaker.estimator.EstimatorBase.fit`
108-
109-
method launches. If not specified, the estimator generates a
110-
default job name, based on the training image name and
111-
current timestamp.
112-
113-
sagemaker_session (sagemaker.session.Session): Session object which manages
114-
interactions with Amazon SageMaker APIs and any other AWS services needed. If
115-
not specified, the estimator creates one using the default
116-
AWS configuration chain.
117-
118-
tags (list[dict]): List of tags for labeling a training job. For more, see
119-
https://docs.aws.amazon.com/sagemaker/latest/dg/API_Tag.html.
120-
121-
subnets (list[str]): List of subnet ids. If not specified
100+
method launches. If not specified, the estimator generates a
101+
default job name, based on the training image name and
102+
current timestamp.
103+
sagemaker_session (sagemaker.session.Session): Session object which manages
104+
interactions with Amazon SageMaker APIs and any other AWS services needed. If
105+
not specified, the estimator creates one using the default
106+
AWS configuration chain.
107+
tags (list[dict]): List of tags for labeling a training job. For more, see
108+
https://docs.aws.amazon.com/sagemaker/latest/dg/API_Tag.html.
109+
subnets (list[str]): List of subnet ids. If not specified
122110
training job will be created without VPC config.
123111
security_group_ids (list[str]): List of security group ids. If
124-
not specified training job will be created
125-
126-
without VPC config.
127-
128-
model_uri (str): URI where a pre-trained model is stored, either locally or in S3
129-
(default: None). If specified, the estimator will create a channel pointing to
130-
the model so the training job can download it. This model
131-
can be a 'model.tar.gz' from a previous training job, or
132-
other artifacts coming from a different source.
133-
More information:
134-
https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-training.html#td-deserialization
135-
136-
model_channel_name (str): Name of the channel where 'model_uri'
112+
not specified training job will be created without VPC config.
113+
model_uri (str): URI where a pre-trained model is stored, either locally or in S3
114+
(default: None). If specified, the estimator will create a channel pointing to
115+
the model so the training job can download it. This model
116+
can be a 'model.tar.gz' from a previous training job, or
117+
other artifacts coming from a different source.
118+
More information:
119+
https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-training.html#td-deserialization
120+
model_channel_name (str): Name of the channel where 'model_uri'
137121
will be downloaded (default: 'model'). metric_definitions
138122
(list[dict]): A list of dictionaries that defines the metric(s)
139-
used to evaluate the
140-
141-
training jobs. Each dictionary contains two keys: 'Name' for
142-
the name of the metric, and 'Regex' for the regular
143-
expression used to extract the metric from the logs.
144-
145-
encrypt_inter_container_traffic (bool): Specifies whether traffic between training
146-
containers is encrypted for the training job (default: ``False``).
147-
role:
148-
train_instance_count:
149-
train_instance_type:
150-
train_volume_size:
151-
train_volume_kms_key:
152-
train_max_run:
153-
input_mode:
154-
output_path:
155-
output_kms_key:
156-
base_job_name:
157-
sagemaker_session:
158-
hyperparameters:
159-
tags:
160-
subnets:
161-
security_group_ids:
162-
model_uri:
163-
model_channel_name:
164-
metric_definitions:
165-
encrypt_inter_container_traffic:
123+
used to evaluate the training jobs. Each dictionary contains two keys: 'Name' for
124+
the name of the metric, and 'Regex' for the regular
125+
expression used to extract the metric from the logs.
126+
encrypt_inter_container_traffic (bool): Specifies whether traffic between training
127+
containers is encrypted for the training job (default: ``False``).
166128
**kwargs: Additional kwargs. This is unused. It's only added for AlgorithmEstimator
167129
to ignore the irrelevant arguments.
168130
"""
@@ -309,7 +271,13 @@ def create_model(
309271
the model. Default: use subnets and security groups from this Estimator.
310272
* 'Subnets' (list[str]): List of subnet ids.
311273
* 'SecurityGroupIds' (list[str]): List of security group ids.
312-
**kwargs:
274+
**kwargs: Additional arguments for creating a :class:`~sagemaker.model.ModelPackage`.
275+
276+
.. tip::
277+
278+
You can find additional parameters for using this method at
279+
:class:`~sagemaker.model.ModelPackage` and
280+
:class:`~sagemaker.model.Model`.
313281
314282
Returns:
315283
a Model ready for deployment.

src/sagemaker/automl/automl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def _prepare_for_auto_ml_job(self, job_name=None):
379379
if self.base_job_name:
380380
base_name = self.base_job_name
381381
else:
382-
base_name = "sagemaker-auto-ml"
382+
base_name = "automl"
383383
# CreateAutoMLJob API validates that member length less than or equal to 32
384384
self.current_job_name = name_from_base(base_name, max_length=32)
385385

src/sagemaker/chainer/estimator.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,20 @@ def __init__(
111111
image_name (str): If specified, the estimator will use this image
112112
for training and hosting, instead of selecting the appropriate
113113
SageMaker official image based on framework_version and
114-
py_version. It can be an ECR url or dockerhub image and tag. ..
115-
admonition:: Examples
114+
py_version. It can be an ECR url or dockerhub image and tag.
115+
116+
Examples
117+
* ``123412341234.dkr.ecr.us-west-2.amazonaws.com/my-custom-image:1.0``
118+
* ``custom-image:latest``
116119
117-
123.dkr.ecr.us-west-2.amazonaws.com/my-custom-image:1.0
118-
custom-image:latest.
119120
**kwargs: Additional kwargs passed to the
120121
:class:`~sagemaker.estimator.Framework` constructor.
122+
123+
.. tip::
124+
125+
You can find additional parameters for initializing this class at
126+
:class:`~sagemaker.estimator.Framework` and
127+
:class:`~sagemaker.estimator.EstimatorBase`.
121128
"""
122129
if framework_version is None:
123130
logger.warning(empty_framework_version_warning(CHAINER_VERSION, self.LATEST_VERSION))

src/sagemaker/chainer/model.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"). You
44
# may not use this file except in compliance with the License. A copy of
@@ -93,8 +93,14 @@ def __init__(
9393
model_server_workers (int): Optional. The number of worker processes
9494
used by the inference server. If None, server will use one
9595
worker per vCPU.
96-
**kwargs: Keyword arguments passed to the ``FrameworkModel``
97-
initializer.
96+
**kwargs: Keyword arguments passed to the
97+
:class:`~sagemaker.model.FrameworkModel` initializer.
98+
99+
.. tip::
100+
101+
You can find additional parameters for initializing this class at
102+
:class:`~sagemaker.model.FrameworkModel` and
103+
:class:`~sagemaker.model.Model`.
98104
"""
99105
super(ChainerModel, self).__init__(
100106
model_data, image, role, entry_point, predictor_cls=predictor_cls, **kwargs

src/sagemaker/estimator.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,8 @@ def compile_model(
492492
'var2':[1,1,28,28]}
493493
output_path (str): Specifies where to store the compiled model
494494
framework (str): The framework that is used to train the original
495-
model. Allowed values: 'mxnet', 'tensorflow', 'pytorch', 'onnx',
496-
'xgboost'
495+
model. Allowed values: 'mxnet', 'tensorflow', 'keras', 'pytorch',
496+
'onnx', 'xgboost'
497497
framework_version (str): The version of the framework
498498
compile_max_run (int): Timeout in seconds for compilation (default:
499499
3 * 60). After this amount of time Amazon SageMaker Neo
@@ -1336,9 +1336,15 @@ def create_model(
13361336
Default: use subnets and security groups from this Estimator.
13371337
* 'Subnets' (list[str]): List of subnet ids.
13381338
* 'SecurityGroupIds' (list[str]): List of security group ids.
1339-
**kwargs:
1339+
**kwargs: Additional parameters passed to :class:`~sagemaker.model.Model`
1340+
1341+
.. tip::
1342+
1343+
You can find additional parameters for using this method at
1344+
:class:`~sagemaker.model.Model`.
13401345
1341-
Returns: a Model ready for deployment.
1346+
Returns:
1347+
(sagemaker.model.Model) a Model ready for deployment.
13421348
"""
13431349
if predictor_cls is None:
13441350

@@ -1566,6 +1572,11 @@ def __init__(
15661572
(default: ``None``).
15671573
**kwargs: Additional kwargs passed to the ``EstimatorBase``
15681574
constructor.
1575+
1576+
.. tip::
1577+
1578+
You can find additional parameters for initializing this class at
1579+
:class:`~sagemaker.estimator.EstimatorBase`.
15691580
"""
15701581
super(Framework, self).__init__(**kwargs)
15711582
if entry_point.startswith("s3://"):

src/sagemaker/model.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"qcs605",
4646
]
4747
)
48-
NEO_ALLOWED_FRAMEWORKS = set(["mxnet", "tensorflow", "pytorch", "onnx", "xgboost"])
48+
NEO_ALLOWED_FRAMEWORKS = set(["mxnet", "tensorflow", "keras", "pytorch", "onnx", "xgboost"])
4949

5050
NEO_IMAGE_ACCOUNT = {
5151
"us-west-1": "710691900526",
@@ -322,8 +322,8 @@ def compile(
322322
3 * 60). After this amount of time Amazon SageMaker Neo
323323
terminates the compilation job regardless of its current status.
324324
framework (str): The framework that is used to train the original
325-
model. Allowed values: 'mxnet', 'tensorflow', 'pytorch', 'onnx',
326-
'xgboost'
325+
model. Allowed values: 'mxnet', 'tensorflow', 'keras', 'pytorch',
326+
'onnx', 'xgboost'
327327
framework_version (str):
328328
329329
Returns:
@@ -734,6 +734,11 @@ def __init__(
734734
try to use either CodeCommit credential helper or local
735735
credential storage for authentication.
736736
**kwargs: Keyword arguments passed to the ``Model`` initializer.
737+
738+
.. tip::
739+
740+
You can find additional parameters for initializing this class at
741+
:class:`~sagemaker.model.Model`.
737742
"""
738743
super(FrameworkModel, self).__init__(
739744
model_data,

src/sagemaker/multidatamodel.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ def __init__(
6666
object, used for SageMaker interactions (default: None). If not
6767
specified, one is created using the default AWS configuration
6868
chain.
69-
**kwargs: Keyword arguments passed to the ``Model`` initializer.
69+
**kwargs: Keyword arguments passed to the
70+
:class:`~sagemaker.model.Model` initializer.
71+
72+
.. tip::
73+
74+
You can find additional parameters for initializing this class at
75+
:class:`~sagemaker.model.Model`.
7076
"""
7177
# Validate path
7278
if not model_data_prefix.startswith("s3://"):

0 commit comments

Comments
 (0)