From 7555d699e45f03df79a6859c9d14c04c687dc609 Mon Sep 17 00:00:00 2001 From: Lauren Yu <6631887+laurenyu@users.noreply.github.com> Date: Wed, 10 Jun 2020 13:32:27 -0700 Subject: [PATCH 1/3] doc: update documentation with v2.0.0.rc0 changes --- CHANGELOG.md | 24 +++++++++++++++++++ doc/v2.rst | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 90 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c097e85827..8ee5e9511c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## v2.0.0.rc0 + +### Breaking Changes + + * remove estimator parameters for TF legacy mode + * remove legacy `TensorFlowModel` and `TensorFlowPredictor` classes + * force image URI to be passed for legacy TF images + * rename `sagemaker.tensorflow.serving` to `sagemaker.tensorflow.model` + * require `framework_version` and `py_version` for framework estimator and model classes + +### Bug Fixes and Other Changes + + * add v2 migration tool + +### Documentation Changes + + * update TF documentation to reflect breaking changes and how to upgrade + * start v2 usage and migration documentation + +### Testing and Release Infrastructure + + * remove scipy from dependencies + * remove TF from optional dependencies + ## v1.60.2 (2020-05-29) ### Bug Fixes and Other Changes diff --git a/doc/v2.rst b/doc/v2.rst index 2ce68e980d..6980cde662 100644 --- a/doc/v2.rst +++ b/doc/v2.rst @@ -35,7 +35,72 @@ If you are executing this pip install command in a notebook, make sure to restar Changes ******* -To see what changes have been made, see the `CHANGELOG `_. +This section is for major changes that may require updates to your SageMaker Python SDK code. +You can also see what changes have been made in the `CHANGELOG `_. + +Require ``framework_version`` and ``py_version`` for Frameworks +=============================================================== + +Framework estimator and model classes now require ``framework_version`` and ``py_version`` instead of supplying defaults, +unless an image URI is explicitly supplied. + +For example: + +.. code:: python + + from sagemaker.tensorflow import TensorFlow + + TensorFlow( + entry_point="script.py", + framework_version="2.2.0", # now required + py_version="py37", # now required + role="my-role", + train_instance_type="ml.m5.xlarge", + train_instance_count=1, + ) + + from sagemaker.mxnet import MXNetModel + + MXNetModel( + model_data="s3://bucket/model.tar.gz", + role="my-role", + entry_point="inference.py", + framework_version="1.6.0", # now required + py_version="py3", # now required + ) + +Deprecate Legacy TensorFlow +=========================== + +TensorFlow versions 1.4-1.10 and some variations of versions 1.11-1.12 +(see `What Constitutes "Legacy TensorFlow Support" `_) +are no longer natively supported by the SageMaker Python SDK. + +To use those versions of TensorFlow, you must specify the Docker image URI explicitly, +and configure settings via hyperparameters or environment variables rather than using SDK parameters. +For more information, see `Upgrade from Legacy TensorFlow Support `_. + +Dependency Changes +================== + +SciPy +----- + +SciPy is no longer a required dependency of the SageMaker Python SDK. + +If you use :func:`sagemaker.amazon.common.write_spmatrix_to_sparse_tensor` and +don't already install SciPy in your environment, you can use our ``scipy`` installation target: + +.. code:: bash + + pip install sagemaker[scipy] + +TensorFlow +---------- + +The ``tensorflow`` installation target has been removed, as it is no longer needed for any SageMaker Python SDK functionality. + +If you want to install TensorFlow, see `the TensorFlow documentation `_. ******************************* Automatically Upgrade Your Code From abbb4247c6b4727ae02abf6c5fe9d4a12160a554 Mon Sep 17 00:00:00 2001 From: Lauren Yu <6631887+laurenyu@users.noreply.github.com> Date: Thu, 11 Jun 2020 16:47:55 -0700 Subject: [PATCH 2/3] update docs based on latest zwei changes --- doc/v2.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/doc/v2.rst b/doc/v2.rst index 6980cde662..6cb82853af 100644 --- a/doc/v2.rst +++ b/doc/v2.rst @@ -80,6 +80,22 @@ To use those versions of TensorFlow, you must specify the Docker image URI expli and configure settings via hyperparameters or environment variables rather than using SDK parameters. For more information, see `Upgrade from Legacy TensorFlow Support `_. +Parameter Changes for ``sagemaker.model.Model`` +=============================================== + +The parameter order for :class:`sagemaker.model.Model` changed: instead of ``model_data`` being first, ``image`` now is first. +As a result, ``model_data`` has now been made into an optional parameter. + +If you are using the :class:`sagemaker.model.Model` class, your code should be changed as follows: + +.. code:: python + + # v1.x + Model("s3://bucket/path/model.tar.gz", "my-image:latest") + + # v2.0 and later + Model("my-image:latest", model_data="s3://bucket/path/model.tar.gz") + Dependency Changes ================== @@ -149,3 +165,8 @@ TensorFlow Serving ------------------ If you are using the ``sagemaker.tensorflow.serving.Model`` class, the tool does not take care of adding a framework version or changing it to ``sagemaker.tensorflow.TensorFlowModel``. + +``sagemaker.model.Model`` +------------------------- + +If you are using the :class:`sagemaker.model.Model` class, the tool does not take care of switching the order between ``model_data`` and ``image``. From fea2cc0b59c556bc21b5d2648d4b51a18b37c697 Mon Sep 17 00:00:00 2001 From: Lauren Yu <6631887+laurenyu@users.noreply.github.com> Date: Thu, 11 Jun 2020 16:50:29 -0700 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ee5e9511c..21d9077153 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * force image URI to be passed for legacy TF images * rename `sagemaker.tensorflow.serving` to `sagemaker.tensorflow.model` * require `framework_version` and `py_version` for framework estimator and model classes + * change `Model` parameter order to make `model_data` optional ### Bug Fixes and Other Changes