Skip to content

Commit 3989034

Browse files
author
Dan
authored
Merge branch 'master' into fix-disable-profiler-settings
2 parents 7a91c3f + 5348eda commit 3989034

Some content is hidden

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

69 files changed

+488
-256
lines changed

CHANGELOG.md

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

3+
## v2.25.1 (2021-02-20)
4+
5+
### Bug Fixes and Other Changes
6+
7+
* Add tests for visualizer to improve test coverage
8+
9+
### Documentation Changes
10+
11+
* specify correct return type
12+
13+
### Testing and Release Infrastructure
14+
15+
* rename canary_quick pytest mark to release
16+
17+
## v2.25.0 (2021-02-19)
18+
19+
### Features
20+
21+
* Enable step caching
22+
* Add other Neo supported regions for Inferentia inference images
23+
24+
### Bug Fixes and Other Changes
25+
26+
* remove FailStep from pipelines
27+
* use sagemaker_session in workflow tests
28+
* use ECR public for multidatamodel tests
29+
* add the mapping from py3 to cuda11 images
30+
* Add 30s cap time for tag tests
31+
* add build spec for slow tests
32+
* mark top 10 slow tests
33+
* remove slow test_run_xxx_monitor_baseline tests
34+
* pin astroid to 2.4.2
35+
36+
### Testing and Release Infrastructure
37+
38+
* unmark more flaky integ tests
39+
* remove canary_quick pytest mark from flaky/unnecessary tests
40+
* remove python3.8 from buildspec
41+
* remove py38 tox env
42+
* fix release buildspec typo
43+
* unblock regional release builds
44+
* lower test TPS for experiment analytics
45+
* move package preparation and publishing to the deploy step
46+
347
## v2.24.5 (2021-02-12)
448

549
### Bug Fixes and Other Changes

VERSION

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

buildspec-localmodetests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ phases:
1111

1212
# local mode tests
1313
- start_time=`date +%s`
14-
- execute-command-if-has-matching-changes "tox -e py38 -- tests/integ -m local_mode --durations 50" "tests/integ" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec-localmodetests.yml"
15-
- ./ci-scripts/displaytime.sh 'py38 local mode' $start_time
14+
- execute-command-if-has-matching-changes "tox -e py37 -- tests/integ -m local_mode --durations 50" "tests/integ" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec-localmodetests.yml"
15+
- ./ci-scripts/displaytime.sh 'py37 local mode' $start_time

buildspec-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ phases:
1515
# run unit tests
1616
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
1717
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
18-
tox -e py36,py37,py38 -- tests/unit
18+
tox -e py36,py37 -- tests/unit
1919

2020
# run a subset of the integration tests
21-
- IGNORE_COVERAGE=- tox -e py36 -- tests/integ -m canary_quick -n 64 --boxed --reruns 2
21+
- IGNORE_COVERAGE=- tox -e py36 -- tests/integ -m "not (local_mode or slow_test)" -n 32 --boxed --reruns 2

buildspec-slowtests.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 0.2
2+
3+
phases:
4+
pre_build:
5+
commands:
6+
- start-dockerd
7+
8+
build:
9+
commands:
10+
- IGNORE_COVERAGE=-
11+
12+
# slow tests
13+
- start_time=`date +%s`
14+
- execute-command-if-has-matching-changes "tox -e py37 -- tests/integ -m slow_test -n 16 --durations 0" "tests/integ" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec-slowtests.yml"
15+
- ./ci-scripts/displaytime.sh 'py37 slow tests' $start_time

buildspec-unittests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ phases:
1818
- start_time=`date +%s`
1919
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
2020
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
21-
tox -e py36,py37,py38 --parallel all -- tests/unit
22-
- ./ci-scripts/displaytime.sh 'py36,py37,py38 unit' $start_time
21+
tox -e py36,py37 --parallel all -- tests/unit
22+
- ./ci-scripts/displaytime.sh 'py36,py37 unit' $start_time

buildspec.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ phases:
1111

1212
# run integration tests
1313
- start_time=`date +%s`
14-
- execute-command-if-has-matching-changes "python3.8 -u ci-scripts/queue_build.py" "tests/integ" "tests/scripts" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"
14+
- execute-command-if-has-matching-changes "python3.7 -u ci-scripts/queue_build.py" "tests/integ" "tests/scripts" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec.yml"
1515
- ./ci-scripts/displaytime.sh 'build queue' $start_time
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 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"
20-
- ./ci-scripts/displaytime.sh 'py38 tests/integ' $start_time
19+
execute-command-if-has-matching-changes "env -u AWS_DEFAULT_REGION tox -e py37 -- tests/integ -m \"not local_mode and not cron and not slow_test\" -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"
20+
- ./ci-scripts/displaytime.sh 'py37 tests/integ' $start_time
2121

2222
post_build:
2323
finally:

doc/frameworks/mxnet/using_mxnet.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ It loads the model parameters from a ``model.params`` file in the SageMaker mode
377377
return net
378378
379379
MXNet on Amazon SageMaker has support for `Elastic Inference <https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html>`__, which allows for inference acceleration to a hosted endpoint for a fraction of the cost of using a full GPU instance.
380-
In order to load and serve your MXNet model through Amazon Elastic Inference, the MXNet context passed to your MXNet Symbol or Module object within your ``model_fn`` needs to be set to ``eia``, as shown `here <https://docs.aws.amazon.com/dlami/latest/devguide/tutorial-mxnet-elastic-inference.html#ei-mxnet>`__.
380+
In order to load and serve your MXNet model through Amazon Elastic Inference, import the ``eimx`` Python package and make one change in the code to partition your model and optimize it for the ``EIA`` back end, as shown `here <https://docs.aws.amazon.com/dlami/latest/devguide/tutorial-mxnet-elastic-inference.html#ei-mxnet>`__.
381381

382382
Based on the example above, the following code-snippet shows an example custom ``model_fn`` implementation, which enables loading and serving our MXNet model through Amazon Elastic Inference.
383383

@@ -392,11 +392,12 @@ Based on the example above, the following code-snippet shows an example custom `
392392
Returns:
393393
mxnet.gluon.nn.Block: a Gluon network (for this example)
394394
"""
395-
net = models.get_model('resnet34_v2', ctx=mx.eia(), pretrained=False, classes=10)
396-
net.load_params('%s/model.params' % model_dir, ctx=mx.eia())
395+
net = models.get_model('resnet34_v2', ctx=mx.cpu(), pretrained=False, classes=10)
396+
net.load_params('%s/model.params' % model_dir, ctx=mx.cpu())
397+
net.hybridize(backend='EIA', static_alloc=True, static_shape=True)
397398
return net
398399
399-
The `default_model_fn <https://github.com/aws/sagemaker-mxnet-container/pull/55/files#diff-aabf018d906ed282a3c738377d19a8deR71>`__ loads and serve your model through Elastic Inference, if applicable, within the Amazon SageMaker MXNet containers.
400+
If you are using MXNet 1.5.1 and earlier, the `default_model_fn <https://github.com/aws/sagemaker-mxnet-container/pull/55/files#diff-aabf018d906ed282a3c738377d19a8deR71>`__ loads and serve your model through Elastic Inference, if applicable, within the Amazon SageMaker MXNet containers.
400401

401402
For more information on how to enable MXNet to interact with Amazon Elastic Inference, see `Use Elastic Inference with MXNet <https://docs.aws.amazon.com/dlami/latest/devguide/tutorial-mxnet-elastic-inference.html>`__.
402403

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ Steps
110110

111111
.. autoclass:: sagemaker.workflow.steps.ProcessingStep
112112

113-
.. autoclass:: sagemaker.workflow.steps.FailStep
114-
115113
Utilities
116114
---------
117115

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def read_version():
6666
"pytest<6.1.0",
6767
"pytest-cov",
6868
"pytest-rerunfailures",
69+
"pytest-timeout",
6970
"pytest-xdist",
7071
"mock",
7172
"contextlib2",

src/sagemaker/clarify.py

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import tempfile
2222

2323
from sagemaker.processing import ProcessingInput, ProcessingOutput, Processor
24-
from sagemaker import image_uris, utils
24+
from sagemaker import image_uris, s3, utils
2525

2626

2727
class DataConfig:
@@ -405,9 +405,15 @@ def _run(
405405
analysis_config_file = os.path.join(tmpdirname, "analysis_config.json")
406406
with open(analysis_config_file, "w") as f:
407407
json.dump(analysis_config, f)
408+
s3_analysis_config_file = _upload_analysis_config(
409+
analysis_config_file,
410+
data_config.s3_output_path,
411+
self.sagemaker_session,
412+
kms_key,
413+
)
408414
config_input = ProcessingInput(
409415
input_name="analysis_config",
410-
source=analysis_config_file,
416+
source=s3_analysis_config_file,
411417
destination=self._CLARIFY_CONFIG_INPUT,
412418
s3_data_type="S3Prefix",
413419
s3_input_mode="File",
@@ -638,6 +644,30 @@ def run_explainability(
638644
self._run(data_config, analysis_config, wait, logs, job_name, kms_key)
639645

640646

647+
def _upload_analysis_config(analysis_config_file, s3_output_path, sagemaker_session, kms_key):
648+
"""Uploads the local analysis_config_file to the s3_output_path.
649+
650+
Args:
651+
analysis_config_file (str): File path to the local analysis config file.
652+
s3_output_path (str): S3 prefix to store the analysis config file.
653+
sagemaker_session (:class:`~sagemaker.session.Session`):
654+
Session object which manages interactions with Amazon SageMaker and
655+
any other AWS services needed. If not specified, the processor creates
656+
one using the default AWS configuration chain.
657+
kms_key (str): The ARN of the KMS key that is used to encrypt the
658+
user code file (default: None).
659+
660+
Returns:
661+
The S3 uri of the uploaded file.
662+
"""
663+
return s3.S3Uploader.upload(
664+
local_path=analysis_config_file,
665+
desired_s3_uri=s3_output_path,
666+
sagemaker_session=sagemaker_session,
667+
kms_key=kms_key,
668+
)
669+
670+
641671
def _set(value, key, dictionary):
642672
"""Sets dictionary[key] = value if value is not None."""
643673
if value is not None:

src/sagemaker/feature_store/feature_group.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ def _ingest_single_batch(
185185
feature_name=data_frame.columns[index], value_as_string=str(row[index])
186186
)
187187
for index in range(len(row))
188+
if pd.notna(row[index])
188189
]
189190
sagemaker_session.put_record(
190191
feature_group_name=feature_group_name, record=[value.to_dict() for value in record]

src/sagemaker/image_uris.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ def retrieve(
9898
"mxnet-1.8.0-gpu-py37": "cu110-ubuntu16.04",
9999
"pytorch-1.6-gpu-py36": "cu110-ubuntu18.04-v3",
100100
"pytorch-1.6.0-gpu-py36": "cu110-ubuntu18.04",
101+
"pytorch-1.6-gpu-py3": "cu110-ubuntu18.04-v3",
102+
"pytorch-1.6.0-gpu-py3": "cu110-ubuntu18.04",
101103
}
102104
key = "-".join([framework, tag])
103105
if key in container_versions:

src/sagemaker/lineage/visualizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _get_start_arn_from_pipeline_execution_step(self, pipeline_execution_step):
105105
return None
106106

107107
metadata = pipeline_execution_step["Metadata"]
108-
jobs = ["TrainingJob", "ProccessingJob", "TransformJob"]
108+
jobs = ["TrainingJob", "ProcessingJob", "TransformJob"]
109109
for job in jobs:
110110
if job in metadata and metadata[job]:
111111
job_arn = metadata[job]["Arn"]

src/sagemaker/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def register(
146146
description (str): Model Package description (default: None).
147147
148148
Returns:
149-
str: A string of SageMaker Model Package ARN.
149+
A `sagemaker.model.ModelPackage` instance.
150150
"""
151151
if self.model_data is None:
152152
raise ValueError("SageMaker Model Package cannot be created without model data.")

src/sagemaker/mxnet/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def register(
183183
description (str): Model Package description (default: None).
184184
185185
Returns:
186-
str: A string of SageMaker Model Package ARN.
186+
A `sagemaker.model.ModelPackage` instance.
187187
"""
188188
instance_type = inference_instances[0]
189189
self._init_sagemaker_session_if_does_not_exist(instance_type)

src/sagemaker/pytorch/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def register(
182182
description (str): Model Package description (default: None).
183183
184184
Returns:
185-
str: A string of SageMaker Model Package ARN.
185+
A `sagemaker.model.ModelPackage` instance.
186186
"""
187187
instance_type = inference_instances[0]
188188
self._init_sagemaker_session_if_does_not_exist(instance_type)

src/sagemaker/tensorflow/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def register(
226226
description (str): Model Package description (default: None).
227227
228228
Returns:
229-
str: A string of SageMaker Model Package ARN.
229+
A `sagemaker.model.ModelPackage` instance.
230230
"""
231231
instance_type = inference_instances[0]
232232
self._init_sagemaker_session_if_does_not_exist(instance_type)

0 commit comments

Comments
 (0)