Skip to content

Commit 5bf7bfb

Browse files
committed
Merge branch 'master' of https://github.com/aws/sagemaker-python-sdk into refactor-mxnet
2 parents 5f967d5 + 9b9bc5b commit 5bf7bfb

Some content is hidden

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

43 files changed

+887
-748
lines changed

.pylintrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ disable=
8383
too-many-arguments,
8484
invalid-name,
8585
too-many-instance-attributes,
86-
line-too-long, # We let Flake8 take care of this # TODO: Fix these and stop relying on flake8
8786
len-as-condition, # TODO: Enable this check once pylint 2.4.0 is released and consumed due to the fix in https://github.com/PyCQA/pylint/issues/2684
8887
import-error, # Since we run Pylint before any of our builds in tox, this will always fail
8988
protected-access, # TODO: Fix access
@@ -228,8 +227,9 @@ max-nested-blocks=5
228227
# Maximum number of characters on a single line.
229228
max-line-length=100
230229

231-
# Regexp for a line that is allowed to be longer than the limit.
232-
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
230+
# Regexp for a line that is allowed to be longer than the limit. Can only be a single regex.
231+
# The following matches any semblance of a url of any sort.
232+
ignore-long-lines=^\s*.*(# )?(<?https?:\/\/)?[-a-zA-Z0-9@:%%._\+~#=><]{1,256}\.[a-zA-Z0-9()]{1,6}\b[-a-zA-Z0-9()@:%%_\+.~#?&\/\/=<>]*\S*>?$
233233

234234
# Allow the body of an if to be on the same line as the test if there is no
235235
# else.

CHANGELOG.md

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

3+
## v1.34.1 (2019-07-23)
4+
5+
### Bug fixes and other changes
6+
7+
* enable line-too-long Pylint check
8+
* improving Chainer integ tests
9+
* update TensorFlow script mode dependency list
10+
* improve documentation of some functions
11+
* update PyTorch version
12+
* allow serving script to be defined for deploy() and transformer() with frameworks
13+
* format and add missing docstring placeholders
14+
* add MXNet 1.4.1 support
15+
16+
### Documentation changes
17+
18+
* add instructions for setting up Cloud9 environment.
19+
* update using_tensorflow topic
20+
321
## v1.34.0 (2019-07-18)
422

523
### Features

CONTRIBUTING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ reported the issue. Please try to include as much information as you can. Detail
1919
* Any modifications you've made relevant to the bug
2020
* A description of your environment or deployment
2121

22+
## Setting up your development environment [optional, but recommended]
23+
24+
* Set up the Cloud9 environment:
25+
* Instance type: You'll need at least 4 GB of RAM to avoid running into memory issues. We recommend at least a t3.medium to run the unit tests. Larger hosts will reduce the chance of encountering resource limits.
26+
* Follow the instructions at [Creating a Cloud9 EC2 Environment](https://docs.aws.amazon.com/cloud9/latest/user-guide/create-environment.html#create-environment-main) to set up a Cloud9 EC2 environment
27+
* Expand the storage of the EC2 instance from 10GB to 20GB
28+
* Because you'll need a minimum of 11GB of disk storage on the EC2 instance to run the repository's unit tests, you'll need to expand your EC2 volume size. We recommend at least 20GB. A larger volume will reduce the chance of encountering resource limits.
29+
* Follow the instructions at [Modifying an EBS Volume Using Elastic Volumes (Console)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/requesting-ebs-volume-modifications.html#modify-ebs-volume) to increase the EBS volume size associated with the newly created EC2 instance.
30+
* Wait 5-10min for the new EBS volume increase to take effect.
31+
* Allow EC2 to claim the additional space by stopping and then starting your EC2 host.
32+
* Create a fork of this repository on GitHub. You should end up with a fork at `https://github.com/<username>/sagemaker-python-sdk`
33+
* Follow the instructions at [Fork a repo](https://help.github.com/en/articles/fork-a-repo) to fork a GitHub repository.
34+
* In the Cloud9 UI, pull down this repository by clicking on "Clone from Github" or running the following command in the Cloud9 terminal: `git clone https://github.com/<username>/sagemaker-python-sdk` where <username> is your github username.
35+
* Install tox using `pip install tox`
36+
* Install coverage using `pip install .[test]`
37+
* cd into the sagemaker-python-sdk folder: `cd sagemaker-python-sdk` or `cd /environment/sagemaker-python-sdk`
38+
* Run the following tox command and verify that all unit tests pass: `tox tests/unit`
2239

2340
## Contributing via Pull Requests
2441
Contributions via pull requests are much appreciated.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ By using TensorFlow SageMaker Estimators, you can train and host TensorFlow mode
191191

192192
Supported versions of TensorFlow: ``1.4.1``, ``1.5.0``, ``1.6.0``, ``1.7.0``, ``1.8.0``, ``1.9.0``, ``1.10.0``, ``1.11.0``, ``1.12.0``, ``1.13.1``.
193193

194-
Supported versions of TensorFlow for Elastic Inference: ``1.11.0``, ``1.12.0``.
194+
Supported versions of TensorFlow for Elastic Inference: ``1.11.0``, ``1.12.0``, ``1.13.0``
195195

196196
We recommend that you use the latest supported version, because that's where we focus most of our development efforts.
197197

VERSION

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

src/sagemaker/algorithm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def __init__(
128128
(default: None). If specified, the estimator will create a channel pointing to
129129
the model so the training job can download it. This model
130130
can be a 'model.tar.gz' from a previous training job, or
131-
other artifacts coming from a different source. More
131+
other artifacts coming from a different source.
132132
More information:
133133
https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-training.html#td-deserialization
134134

src/sagemaker/amazon/linear_learner.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ class LinearLearner(AmazonAlgorithmEstimatorBase):
8383
"softmax_loss",
8484
"auto",
8585
),
86-
'"logistic", "squared_loss", "absolute_loss", "hinge_loss", "eps_insensitive_squared_loss", '
87-
'"eps_insensitive_absolute_loss", "quantile_loss", "huber_loss", "softmax_loss" or "auto"',
86+
'"logistic", "squared_loss", "absolute_loss", "hinge_loss", "eps_insensitive_squared_loss",'
87+
' "eps_insensitive_absolute_loss", "quantile_loss", "huber_loss", "softmax_loss" or "auto"',
8888
str,
8989
)
9090
wd = hp("wd", ge(0), "A float greater-than or equal to 0", float)
@@ -369,7 +369,8 @@ def __init__(
369369
num_classes is None or num_classes < 3
370370
):
371371
raise ValueError(
372-
"For predictor_type 'multiclass_classifier', 'num_classes' should be set to a value greater than 2."
372+
"For predictor_type 'multiclass_classifier', 'num_classes' should be set to a "
373+
"value greater than 2."
373374
)
374375

375376
def create_model(self, vpc_config_override=VPC_CONFIG_DEFAULT):

src/sagemaker/analytics.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def description(self, force_refresh=False):
176176
if force_refresh:
177177
self.clear_cache()
178178
if not self._tuning_job_describe_result:
179-
self._tuning_job_describe_result = self._sage_client.describe_hyper_parameter_tuning_job(
179+
self._tuning_job_describe_result = self._sage_client.describe_hyper_parameter_tuning_job( # noqa: E501 # pylint: disable=line-too-long
180180
HyperParameterTuningJobName=self.name
181181
)
182182
return self._tuning_job_describe_result
@@ -288,10 +288,12 @@ def _determine_timeinterval(self):
288288
description = self._sage_client.describe_training_job(TrainingJobName=self.name)
289289
start_time = self._start_time or description[u"TrainingStartTime"] # datetime object
290290
# Incrementing end time by 1 min since CloudWatch drops seconds before finding the logs.
291-
# This results in logs being searched in the time range in which the correct log line was not present.
291+
# This results in logs being searched in the time range in which the correct log line was
292+
# not present.
292293
# Example - Log time - 2018-10-22 08:25:55
293-
# Here calculated end time would also be 2018-10-22 08:25:55 (without 1 min addition)
294-
# CW will consider end time as 2018-10-22 08:25 and will not be able to search the correct log.
294+
# Here calculated end time would also be 2018-10-22 08:25:55 (without 1 min addition)
295+
# CW will consider end time as 2018-10-22 08:25 and will not be able to search the
296+
# correct log.
295297
end_time = self._end_time or description.get(
296298
u"TrainingEndTime", datetime.datetime.utcnow()
297299
) + datetime.timedelta(minutes=1)

src/sagemaker/chainer/estimator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ def create_model(
177177
the model. Default: use subnets and security groups from this Estimator.
178178
* 'Subnets' (list[str]): List of subnet ids.
179179
* 'SecurityGroupIds' (list[str]): List of security group ids.
180-
entry_point (str): Path (absolute or relative) to the local Python source file which should be executed
181-
as the entry point to training. If not specified, the training entry point is used.
180+
entry_point (str): Path (absolute or relative) to the local Python source file which
181+
should be executed as the entry point to training. If not specified, the training
182+
entry point is used.
182183
source_dir (str): Path (absolute or relative) to a directory with any other serving
183184
source code dependencies aside from the entry point file.
184185
If not specified, the model source directory from training is used.

src/sagemaker/estimator.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,13 @@ def fit(self, inputs=None, wait=True, logs=True, job_name=None):
279279
280280
* (str) the S3 location where training data is saved.
281281
282-
* (dict[str, str] or dict[str, sagemaker.session.s3_input]) If using multiple channels for
283-
training data, you can specify a dict mapping channel
284-
names to strings or :func:`~sagemaker.session.s3_input`
285-
objects.
286-
287-
* (sagemaker.session.s3_input) - channel configuration for S3 data sources that can provide
288-
additional information as well as the path to the training
289-
dataset. See :func:`sagemaker.session.s3_input` for full
290-
details.
282+
* (dict[str, str] or dict[str, sagemaker.session.s3_input]) If using multiple
283+
channels for training data, you can specify a dict mapping channel names to
284+
strings or :func:`~sagemaker.session.s3_input` objects.
285+
286+
* (sagemaker.session.s3_input) - channel configuration for S3 data sources that can
287+
provide additional information as well as the path to the training dataset.
288+
See :func:`sagemaker.session.s3_input` for full details.
291289
wait (bool): Whether the call should wait until the job completes
292290
(default: True).
293291
logs (bool): Whether to show the logs produced by the job. Only
@@ -990,9 +988,9 @@ def create_model(
990988
):
991989
"""Create a model to deploy.
992990
993-
The serializer, deserializer, content_type, and accept arguments are only used to define a default
994-
RealTimePredictor. They are ignored if an explicit predictor class is passed in. Other arguments
995-
are passed through to the Model class.
991+
The serializer, deserializer, content_type, and accept arguments are only used to define a
992+
default RealTimePredictor. They are ignored if an explicit predictor class is passed in.
993+
Other arguments are passed through to the Model class.
996994
997995
Args:
998996
role (str): The ``ExecutionRoleArn`` IAM Role ARN for the ``Model``,
@@ -1562,8 +1560,9 @@ def transformer(
15621560
worker per vCPU.
15631561
volume_kms_key (str): Optional. KMS key ID for encrypting the volume
15641562
attached to the ML compute instance (default: None).
1565-
entry_point (str): Path (absolute or relative) to the local Python source file which should be executed
1566-
as the entry point to training. If not specified, the training entry point is used.
1563+
entry_point (str): Path (absolute or relative) to the local Python source file which
1564+
should be executed as the entry point to training. If not specified, the training
1565+
entry point is used.
15671566
15681567
Returns:
15691568
sagemaker.transformer.Transformer: a ``Transformer`` object that can be used to start a

0 commit comments

Comments
 (0)