Skip to content

Commit 23f7841

Browse files
committed
breaking: merge v2 changes into master
2 parents e774fcf + 4a744a1 commit 23f7841

File tree

343 files changed

+20893
-16522
lines changed

Some content is hidden

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

343 files changed

+20893
-16522
lines changed

.coveragerc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
[run]
2-
omit = sagemaker/tests/*, sagemaker/tensorflow/tensorflow_serving/*
2+
concurrency = threading
3+
omit = sagemaker/tests/*
4+
timid = True

CHANGELOG.md

+82
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,63 @@
7474

7575
* add KFP Processing component
7676

77+
## v2.0.0.rc1 (2020-07-08)
78+
79+
### Breaking Changes
80+
81+
* Move StreamDeserializer to sagemaker.deserializers
82+
* Move StringDeserializer to sagemaker.deserializers
83+
* rename record_deserializer to RecordDeserializer
84+
* remove "train_" where redundant in parameter/variable names
85+
* Add BytesDeserializer
86+
* rename image to image_uri
87+
* rename image_name to image_uri
88+
* create new inference resources during model.deploy() and model.transformer()
89+
* rename session parameter to sagemaker_session in S3 utility classes
90+
* rename distributions to distribution in TF/MXNet estimators
91+
* deprecate update_endpoint arg in deploy()
92+
* create new inference resources during estimator.deploy() or estimator.transformer()
93+
* deprecate delete_endpoint() for estimators and HyperparameterTuner
94+
* refactor Predictor attribute endpoint to endpoint_name
95+
* make instance_type optional for Airflow model configs
96+
* refactor name of RealTimePredictor to Predictor
97+
* remove check for Python 2 string in sagemaker.predictor._is_sequence_like()
98+
* deprecate sagemaker.utils.to_str()
99+
* drop Python 2 support
100+
101+
### Features
102+
103+
* add BaseSerializer and BaseDeserializer
104+
* add Predictor.update_endpoint()
105+
106+
### Bug Fixes and Other Changes
107+
108+
* handle "train_*" renames in v2 migration tool
109+
* handle image_uri rename for Session methods in v2 migration tool
110+
* Update BytesDeserializer accept header
111+
* handle image_uri rename for estimators and models in v2 migration tool
112+
* handle image_uri rename in Airflow model config functions in v2 migration tool
113+
* update migration tool for S3 utility functions
114+
* set _current_job_name and base_tuning_job_name in HyperparameterTuner.attach()
115+
* infer base name from job name in estimator.attach()
116+
* ensure generated names are < 63 characters when deploying compiled models
117+
* add TF migration documentation to error message
118+
119+
### Documentation Changes
120+
121+
* update documentation with v2.0.0.rc1 changes
122+
* remove 'train_*' prefix from estimator parameters
123+
* update documentation for image_name/image --> image_uri
124+
125+
### Testing and Release Infrastructure
126+
127+
* refactor matching logic in v2 migration tool
128+
* add cli modifier for RealTimePredictor and derived classes
129+
* change coverage settings to reduce intermittent errors
130+
* clean up pickle.load logic in integ tests
131+
* use fixture for Python version in framework integ tests
132+
* remove assumption of Python 2 unit test runs
133+
77134
## v1.68.0 (2020-07-07)
78135

79136
### Features
@@ -165,6 +222,31 @@
165222
* set logs to False if wait is False in AutoML
166223
* workflow passing spot training param to training job
167224

225+
## v2.0.0.rc0 (2020-06-17)
226+
227+
### Breaking Changes
228+
229+
* remove estimator parameters for TF legacy mode
230+
* remove legacy `TensorFlowModel` and `TensorFlowPredictor` classes
231+
* force image URI to be passed for legacy TF images
232+
* rename `sagemaker.tensorflow.serving` to `sagemaker.tensorflow.model`
233+
* require `framework_version` and `py_version` for framework estimator and model classes
234+
* change `Model` parameter order to make `model_data` optional
235+
236+
### Bug Fixes and Other Changes
237+
238+
* add v2 migration tool
239+
240+
### Documentation Changes
241+
242+
* update TF documentation to reflect breaking changes and how to upgrade
243+
* start v2 usage and migration documentation
244+
245+
### Testing and Release Infrastructure
246+
247+
* remove scipy from dependencies
248+
* remove TF from optional dependencies
249+
168250
## v1.64.1 (2020-06-16)
169251

170252
### Bug Fixes and Other Changes

MANIFEST.in

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
recursive-include src/sagemaker *
1+
recursive-include src/sagemaker *.py
2+
3+
include src/sagemaker/image_uri_config/*.json
24

35
include VERSION
46
include LICENSE.txt

README.rst

+2-4
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ Supported Python Versions
9393

9494
SageMaker Python SDK is tested on:
9595

96-
- Python 2.7
9796
- Python 3.6
9897
- Python 3.7
9998
- Python 3.8
@@ -122,10 +121,9 @@ You can install the libraries needed to run the tests by running :code:`pip inst
122121

123122
**Unit tests**
124123

125-
126124
We run unit tests with tox, which is a program that lets you run unit tests for multiple Python versions, and also make sure the
127-
code fits our style guidelines. We run tox with Python 2.7, 3.6, 3.7, and 3.8, so to run unit tests
128-
with the same configuration we do, you'll need to have interpreters for Python 2.7, Python 3.6, Python 3.7, and Python 3.8 installed.
125+
code fits our style guidelines. We run tox with `all of our supported Python versions <#supported-python-versions>`_, so to run unit tests
126+
with the same configuration we do, you need to have interpreters for those Python versions installed.
129127

130128
To run the unit tests with tox, run:
131129

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.72.1.dev0
1+
2.0.0.rc1

bin/sagemaker-submit

-59
This file was deleted.

buildspec-localmodetests.yml

+2-2
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 py27,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 'py27,py38 local mode' $start_time
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

buildspec-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ phases:
1818
# run unit tests
1919
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
2020
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
21-
tox -e py27,py36,py37,py38 -- tests/unit
21+
tox -e py36,py37,py38 -- tests/unit
2222

2323
# run a subset of the integration tests
2424
- IGNORE_COVERAGE=- tox -e py36 -- tests/integ -m canary_quick -n 64 --boxed --reruns 2

buildspec-unittests.yml

+2-2
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 py27,py36,py37,py38 --parallel all -- tests/unit
22-
- ./ci-scripts/displaytime.sh 'py27,py36,py37,py38 unit' $start_time
21+
tox -e py36,py37,py38 --parallel all -- tests/unit
22+
- ./ci-scripts/displaytime.sh 'py36,py37,py38 unit' $start_time

doc/algorithms/factorization_machines.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker Factorization Machines algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, num_factors, predictor_type, epochs, clip_gradient, mini_batch_size, feature_dim, eps, rescale_grad, bias_lr, linear_lr, factors_lr, bias_wd, linear_wd, factors_wd, bias_init_method, bias_init_scale, bias_init_sigma, bias_init_value, linear_init_method, linear_init_scale, linear_init_sigma, linear_init_value, factors_init_method, factors_init_scale, factors_init_sigma, factors_init_value
11+
:exclude-members: image_uri, num_factors, predictor_type, epochs, clip_gradient, mini_batch_size, feature_dim, eps, rescale_grad, bias_lr, linear_lr, factors_lr, bias_wd, linear_wd, factors_wd, bias_init_method, bias_init_scale, bias_init_sigma, bias_init_value, linear_init_method, linear_init_scale, linear_init_sigma, linear_init_value, factors_init_method, factors_init_scale, factors_init_sigma, factors_init_value
1212

1313

1414
.. autoclass:: sagemaker.FactorizationMachinesModel

doc/algorithms/ipinsights.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker IP Insights algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, num_entity_vectors, vector_dim, batch_metrics_publish_interval, epochs, learning_rate,
11+
:exclude-members: image_uri, num_entity_vectors, vector_dim, batch_metrics_publish_interval, epochs, learning_rate,
1212
num_ip_encoder_layers, random_negative_sampling_rate, shuffled_negative_sampling_rate, weight_decay
1313

1414
.. autoclass:: sagemaker.IPInsightsModel

doc/algorithms/kmeans.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker K-means algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, k, init_method, max_iterations, tol, num_trials, local_init_method, half_life_time_size, epochs, center_factor, mini_batch_size, feature_dim, MAX_DEFAULT_BATCH_SIZE
11+
:exclude-members: image_uri, k, init_method, max_iterations, tol, num_trials, local_init_method, half_life_time_size, epochs, center_factor, mini_batch_size, feature_dim, MAX_DEFAULT_BATCH_SIZE
1212

1313
.. autoclass:: sagemaker.KMeansModel
1414
:members:

doc/algorithms/knn.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker K-Nearest Neighbors (k-NN) algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, k, sample_size, predictor_type, dimension_reduction_target, dimension_reduction_type,
11+
:exclude-members: image_uri, k, sample_size, predictor_type, dimension_reduction_target, dimension_reduction_type,
1212
index_metric, index_type, faiss_index_ivf_nlists, faiss_index_pq_m
1313

1414
.. autoclass:: sagemaker.KNNModel

doc/algorithms/lda.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker LDA algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, num_topics, alpha0, max_restarts, max_iterations, mini_batch_size, feature_dim, tol
11+
:exclude-members: image_uri, num_topics, alpha0, max_restarts, max_iterations, mini_batch_size, feature_dim, tol
1212

1313

1414
.. autoclass:: sagemaker.LDAModel

doc/algorithms/linear_learner.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker LinearLearner algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, train_instance_count, train_instance_type, predictor_type, binary_classifier_model_selection_criteria, target_recall, target_precision, positive_example_weight_mult, epochs, use_bias, num_models, parameter, num_calibration_samples, calibration, init_method, init_scale, init_sigma, init_bias, optimizer, loss, wd, l1, momentum, learning_rate, beta_1, beta_2, bias_lr_mult, use_lr_scheduler, lr_scheduler_step, lr_scheduler_factor, lr_scheduler_minimum_lr, lr_scheduler_minimum_lr, mini_batch_size, feature_dim, bias_wd_mult, MAX_DEFAULT_BATCH_SIZE
11+
:exclude-members: image_uri, instance_count, instance_type, predictor_type, binary_classifier_model_selection_criteria, target_recall, target_precision, positive_example_weight_mult, epochs, use_bias, num_models, parameter, num_calibration_samples, calibration, init_method, init_scale, init_sigma, init_bias, optimizer, loss, wd, l1, momentum, learning_rate, beta_1, beta_2, bias_lr_mult, use_lr_scheduler, lr_scheduler_step, lr_scheduler_factor, lr_scheduler_minimum_lr, lr_scheduler_minimum_lr, mini_batch_size, feature_dim, bias_wd_mult, MAX_DEFAULT_BATCH_SIZE
1212

1313
.. autoclass:: sagemaker.LinearLearnerModel
1414
:members:

doc/algorithms/ntm.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ The Amazon SageMaker NTM algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, num_topics, encoder_layers, epochs, encoder_layers_activation, optimizer, tolerance,
12-
num_patience_epochs, batch_norm, rescale_gradient, clip_gradient, weight_decay, learning_rate
11+
:exclude-members: image_uri, num_topics, encoder_layers, epochs, encoder_layers_activation, optimizer, tolerance,
12+
num_patience_epochs, batch_norm, rescale_gradient, clip_gradient, weight_decay, learning_rate
1313

1414

1515
.. autoclass:: sagemaker.NTMModel

doc/algorithms/object2vec.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker Object2Vec algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, enc_dim, mini_batch_size, epochs, early_stopping_patience, early_stopping_tolerance,
11+
:exclude-members: image_uri, enc_dim, mini_batch_size, epochs, early_stopping_patience, early_stopping_tolerance,
1212
dropout, weight_decay, bucket_width, num_classes, mlp_layers, mlp_dim, mlp_activation,
1313
output_layer, optimizer, learning_rate, enc0_network, enc1_network, enc0_cnn_filter_width,
1414
enc1_cnn_filter_width, enc0_max_seq_len, enc1_max_seq_len, enc0_token_embedding_dim,

doc/algorithms/pca.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker PCA algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, num_components, algorithm_mode, subtract_mean, extra_components, mini_batch_size, feature_dim, MAX_DEFAULT_BATCH_SIZE
11+
:exclude-members: image_uri, num_components, algorithm_mode, subtract_mean, extra_components, mini_batch_size, feature_dim, MAX_DEFAULT_BATCH_SIZE
1212

1313

1414
.. autoclass:: sagemaker.PCAModel

doc/algorithms/randomcutforest.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Amazon SageMaker Random Cut Forest algorithm.
88
:undoc-members:
99
:show-inheritance:
1010
:inherited-members:
11-
:exclude-members: image, num_trees, num_samples_per_tree, eval_metrics, feature_dim, MINI_BATCH_SIZE
11+
:exclude-members: image_uri, num_trees, num_samples_per_tree, eval_metrics, feature_dim, MINI_BATCH_SIZE
1212

1313

1414
.. autoclass:: sagemaker.RandomCutForestModel

doc/amazon_sagemaker_debugger.rst

+14-14
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ The ``DebuggerHookConfig`` accepts one or more objects of type ``CollectionConfi
5454
5555
estimator = TensorFlow(
5656
role=role,
57-
train_instance_count=1,
58-
train_instance_type=train_instance_type,
57+
instance_count=1,
58+
instance_type=instance_type,
5959
debugger_hook_config=debugger_hook_config
6060
)
6161
@@ -215,8 +215,8 @@ Sample Usages
215215
216216
estimator = TensorFlow(
217217
role=role,
218-
train_instance_count=1,
219-
train_instance_type=train_instance_type,
218+
instance_count=1,
219+
instance_type=instance_type,
220220
rules=[Rule.sagemaker(vanishing_gradient())]
221221
)
222222
@@ -232,8 +232,8 @@ In the example above, Amazon SageMaker pulls the collection configuration best s
232232
233233
estimator = TensorFlow(
234234
role=role,
235-
train_instance_count=1,
236-
train_instance_type=train_instance_type,
235+
instance_count=1,
236+
instance_type=instance_type,
237237
rules=[Rule.sagemaker(vanishing_gradient()), Rule.sagemaker(weight_update_ratio())]
238238
)
239239
@@ -269,8 +269,8 @@ Here we modify the ``weight_update_ratio`` rule to store a custom collection rat
269269
270270
estimator = TensorFlow(
271271
role=role,
272-
train_instance_count=1,
273-
train_instance_type=train_instance_type,
272+
instance_count=1,
273+
instance_type=instance_type,
274274
rules=[
275275
Rule.sagemaker(vanishing_gradient()),
276276
wur_with_customization
@@ -317,8 +317,8 @@ To evaluate the custom rule against the training:
317317
318318
estimator = TensorFlow(
319319
role=role,
320-
train_instance_count=1,
321-
train_instance_type=train_instance_type,
320+
instance_count=1,
321+
instance_type=instance_type,
322322
rules=[
323323
custom_gradient_rule
324324
]
@@ -344,8 +344,8 @@ To enable the debugging hook to emit TensorBoard data, you need to specify the n
344344
345345
estimator = TensorFlow(
346346
role=role,
347-
train_instance_count=1,
348-
train_instance_type=train_instance_type,
347+
instance_count=1,
348+
instance_type=instance_type,
349349
tensorboard_output_config=tensorboard_output_config
350350
)
351351
@@ -392,8 +392,8 @@ To disable the hook initialization, you can do so by specifying ``False`` for va
392392
393393
estimator = TensorFlow(
394394
role=role,
395-
train_instance_count=1,
396-
train_instance_type=train_instance_type,
395+
instance_count=1,
396+
instance_type=instance_type,
397397
debugger_hook_config=False
398398
)
399399

doc/amazon_sagemaker_model_monitoring.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Using ``DefaultMonitor.create_monitoring_schedule()``, you can create a model mo
125125
126126
my_monitor.create_monitoring_schedule(
127127
monitor_schedule_name='my-monitoring-schedule',
128-
endpoint_input=predictor.endpoint,
128+
endpoint_input=predictor.endpoint_name,
129129
statistics=my_monitor.baseline_statistics(),
130130
constraints=my_monitor.suggested_constraints(),
131131
schedule_cron_expression=CronExpressionGenerator.hourly(),

0 commit comments

Comments
 (0)