diff --git a/README.rst b/README.rst index 7aeedb3fb0..0cbf4ef1a7 100644 --- a/README.rst +++ b/README.rst @@ -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. diff --git a/src/sagemaker/pytorch/README.rst b/src/sagemaker/pytorch/README.rst index b02775f3ab..21a1413240 100644 --- a/src/sagemaker/pytorch/README.rst +++ b/src/sagemaker/pytorch/README.rst @@ -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. @@ -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. diff --git a/src/sagemaker/pytorch/defaults.py b/src/sagemaker/pytorch/defaults.py index 21629fa66f..9d769b7631 100644 --- a/src/sagemaker/pytorch/defaults.py +++ b/src/sagemaker/pytorch/defaults.py @@ -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" diff --git a/src/sagemaker/pytorch/estimator.py b/src/sagemaker/pytorch/estimator.py index f6a441d8e6..33acf49e47 100644 --- a/src/sagemaker/pytorch/estimator.py +++ b/src/sagemaker/pytorch/estimator.py @@ -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__( diff --git a/tests/data/pytorch_mnist/mnist.py b/tests/data/pytorch_mnist/mnist.py index 6eb2d43228..49664ee192 100644 --- a/tests/data/pytorch_mnist/mnist.py +++ b/tests/data/pytorch_mnist/mnist.py @@ -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): @@ -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 @@ -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,