Skip to content

change: update PyTorch version #947

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 3 commits into from
Jul 19, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ PyTorch SageMaker Estimators

With PyTorch SageMaker Estimators, you can train and host PyTorch models on Amazon SageMaker.

Supported versions of PyTorch: ``0.4.0``, ``1.0.0``.
Supported versions of PyTorch: ``0.4.0``, ``1.0.0``, ``1.1.0``.

We recommend that you use the latest supported version, because that's where we focus most of our development efforts.

Expand Down
72 changes: 36 additions & 36 deletions src/sagemaker/pytorch/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SageMaker PyTorch Estimators and Models

With PyTorch Estimators and Models, you can train and host PyTorch models on Amazon SageMaker.

Supported versions of PyTorch: ``0.4.0``, ``1.0.0``.
Supported versions of PyTorch: ``0.4.0``, ``1.0.0``, ``1.1.0``.

We recommend that you use the latest supported version, because that's where we focus most of our development efforts.

Expand Down Expand Up @@ -37,41 +37,41 @@ This Python version applies to both the Training Job, created by fit, and the En

The PyTorch Docker images have the following dependencies installed:

+-----------------------------+---------------+-------------------+
| Dependencies | pytorch 0.4.0 | pytorch 1.0.0 |
+-----------------------------+---------------+-------------------+
| boto3 | >=1.7.35 | >=1.9.11 |
+-----------------------------+---------------+-------------------+
| botocore | >=1.10.35 | >=1.12.11 |
+-----------------------------+---------------+-------------------+
| CUDA (GPU image only) | 9.0 | 9.0 |
+-----------------------------+---------------+-------------------+
| numpy | >=1.14.3 | >=1.15.2 |
+-----------------------------+---------------+-------------------+
| Pillow | >=5.1.0 | >=5.2.0 |
+-----------------------------+---------------+-------------------+
| pip | >=10.0.1 | >=18.0 |
+-----------------------------+---------------+-------------------+
| python-dateutil | >=2.7.3 | >=2.7.3 |
+-----------------------------+---------------+-------------------+
| retrying | >=1.3.3 | >=1.3.3 |
+-----------------------------+---------------+-------------------+
| s3transfer | >=0.1.13 | >=0.1.13 |
+-----------------------------+---------------+-------------------+
| sagemaker-containers | >=2.1.0 | >=2.1.0 |
+-----------------------------+---------------+-------------------+
| sagemaker-pytorch-container | 1.0 | 1.0 |
+-----------------------------+---------------+-------------------+
| setuptools | >=39.2.0 | >=40.4.3 |
+-----------------------------+---------------+-------------------+
| six | >=1.11.0 | >=1.11.0 |
+-----------------------------+---------------+-------------------+
| torch | 0.4.0 | 1.0.0 |
+-----------------------------+---------------+-------------------+
| torchvision | 0.2.1 | 0.2.1 |
+-----------------------------+---------------+-------------------+
| Python | 2.7 or 3.5 | 2.7 or 3.6 |
+-----------------------------+---------------+-------------------+
+-----------------------------+---------------+-------------------+-------------------+
| Dependencies | pytorch 0.4.0 | pytorch 1.0.0 | pytorch 1.1.0 |
+-----------------------------+---------------+-------------------+-------------------+
| boto3 | >=1.7.35 | >=1.9.11 | 1.9.82 |
+-----------------------------+---------------+-------------------+-------------------+
| botocore | >=1.10.35 | >=1.12.11 | >= 1.12.11 |
+-----------------------------+---------------+-------------------+-------------------+
| CUDA (GPU image only) | 9.0 | 9.0 | 10.1 |
+-----------------------------+---------------+-------------------+-------------------+
| numpy | >=1.14.3 | >=1.15.2 | 1.16.4 |
+-----------------------------+---------------+-------------------+-------------------+
| Pillow | >=5.1.0 | >=5.2.0 | 6.0.0 |
+-----------------------------+---------------+-------------------+-------------------+
| pip | >=10.0.1 | >=18.0 | >=18.0 |
+-----------------------------+---------------+-------------------+-------------------+
| python-dateutil | >=2.7.3 | >=2.7.3 | >=2.7.3 |
+-----------------------------+---------------+-------------------+-------------------+
| retrying | >=1.3.3 | >=1.3.3 | 1.3.3 |
+-----------------------------+---------------+-------------------+-------------------+
| s3transfer | >=0.1.13 | >=0.1.13 | >=0.1.13 |
+-----------------------------+---------------+-------------------+-------------------+
| sagemaker-containers | >=2.1.0 | >=2.1.0 | 2.4.10.post0 |
+-----------------------------+---------------+-------------------+-------------------+
| sagemaker-pytorch-container | 1.0 | 1.1 | 1.2 |
+-----------------------------+---------------+-------------------+-------------------+
| setuptools | >=39.2.0 | >=40.4.3 | >=40.4.3 |
+-----------------------------+---------------+-------------------+-------------------+
| six | >=1.11.0 | >=1.11.0 | 1.12.0 |
+-----------------------------+---------------+-------------------+-------------------+
| torch | 0.4.0 | 1.0.0 | 1.1.0 |
+-----------------------------+---------------+-------------------+-------------------+
| torchvision | 0.2.1 | 0.2.1 | 0.3.0 |
+-----------------------------+---------------+-------------------+-------------------+
| Python | 2.7 or 3.5 | 2.7 or 3.6 | 2.7 or 3.6 |
+-----------------------------+---------------+-------------------+-------------------+

The Docker images extend Ubuntu 16.04.

Expand Down
2 changes: 1 addition & 1 deletion src/sagemaker/pytorch/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

PYTORCH_VERSION = "0.4"
"""Default PyTorch version for when the framework version is not specified.
This is no longer updated so as to not break existing workflows.
The latest PyTorch version is 1.1.0, but the default version is no longer updated so as to not break existing workflows.
"""

PYTHON_VERSION = "py3"
2 changes: 1 addition & 1 deletion src/sagemaker/pytorch/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class PyTorch(Framework):

__framework_name__ = "pytorch"

LATEST_VERSION = "1.0"
LATEST_VERSION = "1.1"
"""The latest version of PyTorch included in the SageMaker pre-built Docker images."""

def __init__(
Expand Down
2 changes: 2 additions & 0 deletions tests/data/pytorch_mnist/mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def _get_train_data_loader(training_dir, is_distributed, batch_size, **kwargs):
transform=transforms.Compose(
[transforms.ToTensor(), transforms.Normalize((0.1307,), (0.3081,))]
),
download=True,
)
train_sampler = (
torch.utils.data.distributed.DistributedSampler(dataset) if is_distributed else None
Expand All @@ -70,6 +71,7 @@ def _get_test_data_loader(training_dir, **kwargs):
transform=transforms.Compose(
[transforms.ToTensor(), transforms.Normalize((0.1307,), (0.3081,))]
),
download=True,
),
batch_size=1000,
shuffle=True,
Expand Down
3 changes: 2 additions & 1 deletion tests/integ/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

from tests.integ import lock as lock
from sagemaker.mxnet.estimator import MXNet
from sagemaker.pytorch.defaults import PYTORCH_VERSION
from sagemaker.pytorch.estimator import PyTorch
from sagemaker.sklearn.estimator import SKLearn
from sagemaker.mxnet.model import MXNetModel
Expand Down Expand Up @@ -60,7 +61,7 @@ def test_git_support_with_pytorch(sagemaker_local_session):
entry_point=script_path,
role="SageMakerRole",
source_dir="pytorch",
framework_version=PyTorch.LATEST_VERSION,
framework_version=PYTORCH_VERSION,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Because the script used in the test GitHub repo is not updated, and will fail when PyTorch version is 1.1.

py_version=PYTHON_VERSION,
train_instance_count=1,
train_instance_type="local",
Expand Down