Skip to content

Commit b0ac311

Browse files
author
Dan
authored
Merge branch 'master' into inference-id
2 parents 9cd4705 + 49cab87 commit b0ac311

Some content is hidden

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

55 files changed

+422
-142
lines changed

CHANGELOG.md

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

3+
## v2.25.2 (2021-02-25)
4+
5+
### Bug Fixes and Other Changes
6+
7+
* Use the output path to store the Clarify config file
8+
* feature group should ignore nan values
9+
* ignore failing smdataparallel test
10+
* Add tests for Training job & Transform job in visualizer
11+
* visualizer for pipeline processing job steps
12+
13+
### Documentation Changes
14+
15+
* update doc for Elastic Inference MXNet 1.7.0
16+
17+
## v2.25.1 (2021-02-20)
18+
19+
### Bug Fixes and Other Changes
20+
21+
* Add tests for visualizer to improve test coverage
22+
23+
### Documentation Changes
24+
25+
* specify correct return type
26+
27+
### Testing and Release Infrastructure
28+
29+
* rename canary_quick pytest mark to release
30+
31+
## v2.25.0 (2021-02-19)
32+
33+
### Features
34+
35+
* Enable step caching
36+
* Add other Neo supported regions for Inferentia inference images
37+
38+
### Bug Fixes and Other Changes
39+
40+
* remove FailStep from pipelines
41+
* use sagemaker_session in workflow tests
42+
* use ECR public for multidatamodel tests
43+
* add the mapping from py3 to cuda11 images
44+
* Add 30s cap time for tag tests
45+
* add build spec for slow tests
46+
* mark top 10 slow tests
47+
* remove slow test_run_xxx_monitor_baseline tests
48+
* pin astroid to 2.4.2
49+
50+
### Testing and Release Infrastructure
51+
52+
* unmark more flaky integ tests
53+
* remove canary_quick pytest mark from flaky/unnecessary tests
54+
* remove python3.8 from buildspec
55+
* remove py38 tox env
56+
* fix release buildspec typo
57+
* unblock regional release builds
58+
* lower test TPS for experiment analytics
59+
* move package preparation and publishing to the deploy step
60+
361
## v2.24.5 (2021-02-12)
462

563
### 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.3.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: 1 addition & 1 deletion
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
2121
- IGNORE_COVERAGE=- tox -e py36 -- tests/integ -m "not (local_mode or slow_test)" -n 32 --boxed --reruns 2

buildspec-slowtests.yml

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

1212
# slow tests
1313
- start_time=`date +%s`
14-
- execute-command-if-has-matching-changes "tox -e py38 -- 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 'py38 slow tests' $start_time
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 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 '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

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/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)