Skip to content

change: update pytorch version #857

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

Closed
wants to merge 11 commits into from
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,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.169 |
+-----------------------------+---------------+-------------------+-------------------+
| 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
4 changes: 2 additions & 2 deletions src/sagemaker/pytorch/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# language governing permissions and limitations under the License.
from __future__ import absolute_import

PYTORCH_VERSION = "0.4"
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 @@ -33,7 +33,7 @@ class PyTorch(Framework):

__framework_name__ = "pytorch"

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

def __init__(
Expand Down
3 changes: 3 additions & 0 deletions tests/data/pytorch_mnist/mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
logger.addHandler(logging.StreamHandler(sys.stdout))



class Net(nn.Module):
# Based on https://github.com/pytorch/examples/blob/master/mnist/main.py
def __init__(self):
Expand Down Expand Up @@ -47,6 +48,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 +72,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