diff --git a/README.rst b/README.rst index bacf953a20..eff60c8941 100644 --- a/README.rst +++ b/README.rst @@ -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. diff --git a/src/sagemaker/pytorch/README.rst b/src/sagemaker/pytorch/README.rst index b02775f3ab..cb8dc780f3 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.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. diff --git a/src/sagemaker/pytorch/defaults.py b/src/sagemaker/pytorch/defaults.py index f851a473cb..372424b6bd 100644 --- a/src/sagemaker/pytorch/defaults.py +++ b/src/sagemaker/pytorch/defaults.py @@ -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" diff --git a/src/sagemaker/pytorch/estimator.py b/src/sagemaker/pytorch/estimator.py index 9c0ebf1263..74c45b8c6e 100644 --- a/src/sagemaker/pytorch/estimator.py +++ b/src/sagemaker/pytorch/estimator.py @@ -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__( diff --git a/tests/data/pytorch_mnist/mnist.py b/tests/data/pytorch_mnist/mnist.py index 6eb2d43228..a7d542064e 100644 --- a/tests/data/pytorch_mnist/mnist.py +++ b/tests/data/pytorch_mnist/mnist.py @@ -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 @@ -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, diff --git a/tests/integ/test_git.py b/tests/integ/test_git.py index cd0edd6ad0..be3c85e3f2 100644 --- a/tests/integ/test_git.py +++ b/tests/integ/test_git.py @@ -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 @@ -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, py_version=PYTHON_VERSION, train_instance_count=1, train_instance_type="local",