-
Notifications
You must be signed in to change notification settings - Fork 1.2k
doc: start v2 usage and migration documentation #1553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ Overview | |
:maxdepth: 2 | ||
|
||
overview | ||
v2 | ||
|
||
The SageMaker Python SDK APIs: | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
########################################################## | ||
Use Version 2.0 of the SageMaker Python SDK (experimental) | ||
########################################################## | ||
|
||
Development on v2.0.0 of the SageMaker Python SDK is underway. | ||
For more info on our plans, see https://github.com/aws/sagemaker-python-sdk/issues/1459. | ||
|
||
.. contents:: | ||
:local: | ||
|
||
************ | ||
Installation | ||
************ | ||
|
||
.. warning:: | ||
Version 2.0.0 is currently experimental, so proceed with caution. If you do run into issues or have any other feedback, | ||
please let us know by `opening an issue <https://github.com/aws/sagemaker-python-sdk/issues/new/choose>`_ | ||
or `commenting on our planning issue <https://github.com/aws/sagemaker-python-sdk/issues/1459>`_. | ||
|
||
To install the latest release candidate: | ||
|
||
.. code:: bash | ||
|
||
pip install [email protected]:aws/[email protected] | ||
|
||
To install the latest version of v2: | ||
|
||
.. code:: bash | ||
|
||
pip install [email protected]:aws/sagemaker-python-sdk.git@zwei | ||
|
||
If you are executing this pip install command in a notebook, make sure to restart your kernel. | ||
|
||
******* | ||
Changes | ||
******* | ||
|
||
To see what changes have been made, see the `CHANGELOG <https://github.com/aws/sagemaker-python-sdk/blob/zwei/CHANGELOG.md>`_. | ||
|
||
******************************* | ||
Automatically Upgrade Your Code | ||
******************************* | ||
|
||
To help make your transition as seamless as possible, v2 of the SageMaker Python SDK comes with a command-line tool to automate updating your code. | ||
It automates as much as possible, but there are still syntactical and stylistic changes that cannot be performed by the script. | ||
|
||
.. warning:: | ||
While the tool is intended to be easy to use, we recommend using it as part of a process that includes testing before and after you run the tool. | ||
|
||
Usage | ||
===== | ||
|
||
Currently, the tool supports only converting one file at a time: | ||
|
||
.. code:: | ||
|
||
$ sagemaker-upgrade-v2 --in-file input.py --out-file output.py | ||
$ sagemaker-upgrade-v2 --in-file input.ipynb --out-file output.ipynb | ||
|
||
You can apply it to a set of files using a loop: | ||
|
||
.. code:: bash | ||
|
||
$ for file in $(find input-dir); do sagemaker-upgrade-v2 --in-file $file --out-file output-dir/$file; done | ||
|
||
Limitations | ||
=========== | ||
|
||
Aliased Imports | ||
--------------- | ||
|
||
The tool checks for a limited number of patterns when looking for constructors. | ||
For example, if you are using a TensorFlow estimator, only the following invocation styles are handled: | ||
|
||
.. code:: python | ||
|
||
TensorFlow() | ||
sagemaker.tensorflow.TensorFlow() | ||
sagemaker.tensorflow.estimator.TensorFlow() | ||
|
||
If you have aliased an import, e.g. ``from sagemaker.tensorflow import TensorFlow as TF``, the tool does not take care of updating its parameters. | ||
|
||
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``. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like I'd want to see a before and after example. After reading this, I'm still not sure what changed and how much work I'd have to do if I used an aliased import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. I'll populate the "Changes" section when I update the changelog in a new PR