Skip to content

Commit 0a127dd

Browse files
authored
Merge branch 'master' into fix-pytorch-inference-test
2 parents 80d80af + 58a0f43 commit 0a127dd

Some content is hidden

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

57 files changed

+840
-175
lines changed

CHANGELOG.md

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

3+
## v2.5.4 (2020-09-08)
4+
5+
### Bug Fixes and Other Changes
6+
7+
* update max_run_wait to max_wait in v2.rst for estimator parameters
8+
* Updating regional account ids for af-south-1 and eu-south-1
9+
* add account ids for af-south-1 and eu-south-1 for debugger rules
10+
11+
## v2.5.3 (2020-09-02)
12+
13+
### Bug Fixes and Other Changes
14+
15+
* Revert "change: update image uri config for pytorch 1.6.0 inference (#1864)"
16+
* update image uri config for pytorch 1.6.0 inference
17+
* add missing framework version image uri config
18+
19+
## v2.5.2 (2020-08-31)
20+
21+
### Bug Fixes and Other Changes
22+
23+
* refactor normalization of args for processing
24+
* set TF 2.1.1 as highest py2 version for TF
25+
* decrease integ test concurrency and increase delay between retries
26+
27+
## v2.5.1 (2020-08-27)
28+
29+
### Bug Fixes and Other Changes
30+
31+
* formatting changes from updates to black
32+
33+
## v2.5.0 (2020-08-25)
34+
35+
### Features
36+
37+
* add mypy tox target
38+
39+
### Bug Fixes and Other Changes
40+
41+
* break out methods to get processing arguments
42+
* break out methods to get train arguments
43+
44+
## v2.4.2 (2020-08-24)
45+
46+
### Bug Fixes and Other Changes
47+
48+
* check ast node on later renamers for cli v2 updater
49+
50+
### Documentation Changes
51+
52+
* Clarify removals in v2
53+
354
## v2.4.1 (2020-08-19)
455

556
### Bug Fixes and Other Changes

VERSION

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

buildspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ phases:
1616

1717
- start_time=`date +%s`
1818
- |
19-
execute-command-if-has-matching-changes "env -u AWS_DEFAULT_REGION tox -e py38 -- tests/integ -m \"not local_mode and not cron\" -n 512 --reruns 3 --reruns-delay 5 --durations 50 --boto-config '{\"region_name\": \"us-east-2\"}'" "tests/integ" "tests/scripts" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"
19+
execute-command-if-has-matching-changes "env -u AWS_DEFAULT_REGION tox -e py38 -- tests/integ -m \"not local_mode and not cron\" -n 384 --reruns 3 --reruns-delay 15 --durations 50 --boto-config '{\"region_name\": \"us-east-2\"}'" "tests/integ" "tests/scripts" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "src/sagemaker/image_uri_config/*.json" "setup.py" "setup.cfg" "buildspec.yml"
2020
- ./ci-scripts/displaytime.sh 'py38 tests/integ' $start_time
2121

2222
post_build:

doc/v2.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ Please instantiate the objects instead.
6666
+--------------------------------------------+------------------------------------------------+
6767
| ``sagemaker.predictor.json_serializer`` | ``sagemaker.serializers.JSONSerializer()`` |
6868
+--------------------------------------------+------------------------------------------------+
69-
| ``sagemaker.predictor.npy_serializer`` | ``sagemaker.deserializers.NumpySerializer()`` |
69+
| ``sagemaker.predictor.npy_serializer`` | ``sagemaker.serializers.NumpySerializer()`` |
7070
+--------------------------------------------+------------------------------------------------+
7171
| ``sagemaker.predictor.csv_deserializer`` | ``sagemaker.deserializers.CSVDeserializer()`` |
7272
+--------------------------------------------+------------------------------------------------+
7373
| ``sagemaker.predictor.json_deserializer`` | ``sagemaker.deserializers.JSONDeserializer()`` |
7474
+--------------------------------------------+------------------------------------------------+
75-
| ``sagemaker.predictor.numpy_deserializer`` | ``sagemaker.serializers.NumpyDeserializer()`` |
75+
| ``sagemaker.predictor.numpy_deserializer`` | ``sagemaker.deserializers.NumpyDeserializer()``|
7676
+--------------------------------------------+------------------------------------------------+
7777

7878
``update_endpoint`` in ``deploy()``
@@ -231,7 +231,7 @@ The following estimator parameters have been renamed:
231231
+------------------------------+------------------------+
232232
| ``train_use_spot_instances`` | ``use_spot_instances`` |
233233
+------------------------------+------------------------+
234-
| ``train_max_run_wait`` | ``max_run_wait`` |
234+
| ``train_max_run_wait`` | ``max_wait`` |
235235
+------------------------------+------------------------+
236236
| ``train_volume_size`` | ``volume_size`` |
237237
+------------------------------+------------------------+

mypy.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[mypy]
2+
ignore_missing_imports = True

src/sagemaker/amazon/amazon_estimator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ def __init__(
9494
def training_image_uri(self):
9595
"""Placeholder docstring"""
9696
return image_uris.retrieve(
97-
self.repo_name, self.sagemaker_session.boto_region_name, version=self.repo_version,
97+
self.repo_name,
98+
self.sagemaker_session.boto_region_name,
99+
version=self.repo_version,
98100
)
99101

100102
def hyperparameters(self):

src/sagemaker/amazon/kmeans.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class KMeans(AmazonAlgorithmEstimatorBase):
2929
3030
As the result of KMeans, members of a group are as similar as possible to one another and as
3131
different as possible from members of other groups. You define the attributes that you want
32-
the algorithm to use to determine similarity. """
32+
the algorithm to use to determine similarity."""
3333

3434
repo_name = "kmeans"
3535
repo_version = 1
@@ -257,7 +257,9 @@ def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
257257
"""
258258
sagemaker_session = sagemaker_session or Session()
259259
image_uri = image_uris.retrieve(
260-
KMeans.repo_name, sagemaker_session.boto_region_name, version=KMeans.repo_version,
260+
KMeans.repo_name,
261+
sagemaker_session.boto_region_name,
262+
version=KMeans.repo_version,
261263
)
262264
super(KMeansModel, self).__init__(
263265
image_uri,

src/sagemaker/amazon/knn.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
246246
"""
247247
sagemaker_session = sagemaker_session or Session()
248248
image_uri = image_uris.retrieve(
249-
KNN.repo_name, sagemaker_session.boto_region_name, version=KNN.repo_version,
249+
KNN.repo_name,
250+
sagemaker_session.boto_region_name,
251+
version=KNN.repo_version,
250252
)
251253
super(KNNModel, self).__init__(
252254
image_uri,

src/sagemaker/amazon/lda.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
class LDA(AmazonAlgorithmEstimatorBase):
2828
"""An unsupervised learning algorithm attempting to describe data as distinct categories.
2929
30-
LDA is most commonly used to discover a
31-
user-specified number of topics shared by documents within a text corpus. Here each
32-
observation is a document, the features are the presence (or occurrence count) of each
33-
word, and the categories are the topics."""
30+
LDA is most commonly used to discover a
31+
user-specified number of topics shared by documents within a text corpus. Here each
32+
observation is a document, the features are the presence (or occurrence count) of each
33+
word, and the categories are the topics."""
3434

3535
repo_name = "lda"
3636
repo_version = 1
@@ -230,7 +230,9 @@ def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
230230
"""
231231
sagemaker_session = sagemaker_session or Session()
232232
image_uri = image_uris.retrieve(
233-
LDA.repo_name, sagemaker_session.boto_region_name, version=LDA.repo_version,
233+
LDA.repo_name,
234+
sagemaker_session.boto_region_name,
235+
version=LDA.repo_version,
234236
)
235237
super(LDAModel, self).__init__(
236238
image_uri,

src/sagemaker/amazon/ntm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
259259
"""
260260
sagemaker_session = sagemaker_session or Session()
261261
image_uri = image_uris.retrieve(
262-
NTM.repo_name, sagemaker_session.boto_region_name, version=NTM.repo_version,
262+
NTM.repo_name,
263+
sagemaker_session.boto_region_name,
264+
version=NTM.repo_version,
263265
)
264266
super(NTMModel, self).__init__(
265267
image_uri,

src/sagemaker/amazon/pca.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
240240
"""
241241
sagemaker_session = sagemaker_session or Session()
242242
image_uri = image_uris.retrieve(
243-
PCA.repo_name, sagemaker_session.boto_region_name, version=PCA.repo_version,
243+
PCA.repo_name,
244+
sagemaker_session.boto_region_name,
245+
version=PCA.repo_version,
244246
)
245247
super(PCAModel, self).__init__(
246248
image_uri,

src/sagemaker/analytics.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,7 @@ def _metric_names_for_training_job(self):
416416

417417

418418
class ExperimentAnalytics(AnalyticsMetricsBase):
419-
"""Fetch trial component data and make them accessible for analytics.
420-
"""
419+
"""Fetch trial component data and make them accessible for analytics."""
421420

422421
MAX_TRIAL_COMPONENTS = 10000
423422

@@ -477,16 +476,14 @@ def __init__(
477476

478477
@property
479478
def name(self):
480-
"""Name of the Experiment being analyzed
481-
"""
479+
"""Name of the Experiment being analyzed"""
482480
return self._experiment_name
483481

484482
def __repr__(self):
485483
return "<sagemaker.ExperimentAnalytics for %s>" % self.name
486484

487485
def clear_cache(self):
488-
"""Clear the object of all local caches of API methods.
489-
"""
486+
"""Clear the object of all local caches of API methods."""
490487
super(ExperimentAnalytics, self).clear_cache()
491488
self._trial_components = None
492489

@@ -570,13 +567,13 @@ def _reshape(self, trial_component):
570567

571568
def _fetch_dataframe(self):
572569
"""Return a pandas dataframe with all the trial_components,
573-
along with their parameters and metrics.
570+
along with their parameters and metrics.
574571
"""
575572
df = pd.DataFrame([self._reshape(component) for component in self._get_trial_components()])
576573
return df
577574

578575
def _get_trial_components(self, force_refresh=False):
579-
""" Get all trial components matching the given search query expression.
576+
"""Get all trial components matching the given search query expression.
580577
581578
Args:
582579
force_refresh (bool): Set to True to fetch the latest data from SageMaker API.

src/sagemaker/automl/automl.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626

2727

2828
class AutoML(object):
29-
"""A class for creating and interacting with SageMaker AutoML jobs
30-
"""
29+
"""A class for creating and interacting with SageMaker AutoML jobs"""
3130

3231
def __init__(
3332
self,

src/sagemaker/cli/framework_upgrade.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,13 @@ def add_region(existing_content, region, account):
158158

159159

160160
def add_version(
161-
existing_content, short_version, full_version, scope, processors, py_versions, tag_prefix,
161+
existing_content,
162+
short_version,
163+
full_version,
164+
scope,
165+
processors,
166+
py_versions,
167+
tag_prefix,
162168
):
163169
"""Read framework image uri information from json file to a dictionary, update it with new
164170
framework version information, then write the dictionary back to json file.
@@ -172,7 +178,7 @@ def add_version(
172178
processors (str): Supported processors (e.g. "cpu,gpu").
173179
py_versions (str): Supported Python versions (e.g. "py3,py37").
174180
tag_prefix (str): Algorithm image's tag prefix.
175-
"""
181+
"""
176182
if py_versions:
177183
py_versions = py_versions.split(",")
178184
processors = processors.split(",")

src/sagemaker/estimator.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,11 +1037,31 @@ def start_new(cls, estimator, inputs, experiment_config):
10371037
:meth:`~sagemaker.estimator.EstimatorBase.fit`. Dictionary contains
10381038
three optional keys, 'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
10391039
1040-
10411040
Returns:
10421041
sagemaker.estimator._TrainingJob: Constructed object that captures
10431042
all information about the started training job.
10441043
"""
1044+
train_args = cls._get_train_args(estimator, inputs, experiment_config)
1045+
estimator.sagemaker_session.train(**train_args)
1046+
1047+
return cls(estimator.sagemaker_session, estimator._current_job_name)
1048+
1049+
@classmethod
1050+
def _get_train_args(cls, estimator, inputs, experiment_config):
1051+
"""Constructs a dict of arguments for an Amazon SageMaker training job from the estimator.
1052+
1053+
Args:
1054+
estimator (sagemaker.estimator.EstimatorBase): Estimator object
1055+
created by the user.
1056+
inputs (str): Parameters used when called
1057+
:meth:`~sagemaker.estimator.EstimatorBase.fit`.
1058+
experiment_config (dict[str, str]): Experiment management configuration used when called
1059+
:meth:`~sagemaker.estimator.EstimatorBase.fit`. Dictionary contains
1060+
three optional keys, 'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
1061+
1062+
Returns:
1063+
Dict: dict for `sagemaker.session.Session.train` method
1064+
"""
10451065

10461066
local_mode = estimator.sagemaker_session.local_mode
10471067
model_uri = estimator.model_uri
@@ -1102,9 +1122,7 @@ def start_new(cls, estimator, inputs, experiment_config):
11021122
if estimator.enable_sagemaker_metrics is not None:
11031123
train_args["enable_sagemaker_metrics"] = estimator.enable_sagemaker_metrics
11041124

1105-
estimator.sagemaker_session.train(**train_args)
1106-
1107-
return cls(estimator.sagemaker_session, estimator._current_job_name)
1125+
return train_args
11081126

11091127
@classmethod
11101128
def _add_spot_checkpoint_args(cls, local_mode, estimator, train_args):

src/sagemaker/image_uri_config/debugger.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"versions": {
44
"latest": {
55
"registries": {
6+
"af-south-1": "314341159256",
67
"ap-east-1": "199566480951",
78
"ap-northeast-1": "430734990657",
89
"ap-northeast-2": "578805364391",
@@ -14,6 +15,7 @@
1415
"cn-northwest-1": "658757709296",
1516
"eu-central-1": "482524230118",
1617
"eu-north-1": "314864569078",
18+
"eu-south-1": "563282790590",
1719
"eu-west-1": "929884845733",
1820
"eu-west-2": "250201462417",
1921
"eu-west-3": "447278800020",

0 commit comments

Comments
 (0)