diff --git a/src/sagemaker/image_uri_config/pytorch.json b/src/sagemaker/image_uri_config/pytorch.json index 584312e4da..5d7256b3e6 100644 --- a/src/sagemaker/image_uri_config/pytorch.json +++ b/src/sagemaker/image_uri_config/pytorch.json @@ -1,6 +1,49 @@ { - "training": { - "processors": ["cpu", "gpu"], + "eia": { + "processors": [ + "cpu" + ], + "version_aliases": { + "1.3": "1.3.1" + }, + "versions": { + "1.3.1": { + "py_versions": [ + "py3" + ], + "registries": { + "ap-east-1": "871362719292", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-south-1": "763104351884", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ca-central-1": "763104351884", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-north-1": "763104351884", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "me-south-1": "217643126080", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-west-1": "442386744353", + "us-iso-east-1": "886529160074", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "pytorch-inference-eia" + } + } + }, + "inference": { + "processors": [ + "cpu", + "gpu" + ], "version_aliases": { "0.4": "0.4.0", "1.0": "1.0.0", @@ -12,6 +55,10 @@ }, "versions": { "0.4.0": { + "py_versions": [ + "py2", + "py3" + ], "registries": { "ap-east-1": "057415533634", "ap-northeast-1": "520713654638", @@ -36,10 +83,13 @@ "us-west-1": "520713654638", "us-west-2": "520713654638" }, - "repository": "sagemaker-pytorch", - "py_versions": ["py2", "py3"] + "repository": "sagemaker-pytorch" }, "1.0.0": { + "py_versions": [ + "py2", + "py3" + ], "registries": { "ap-east-1": "057415533634", "ap-northeast-1": "520713654638", @@ -64,10 +114,13 @@ "us-west-1": "520713654638", "us-west-2": "520713654638" }, - "repository": "sagemaker-pytorch", - "py_versions": ["py2", "py3"] + "repository": "sagemaker-pytorch" }, "1.1.0": { + "py_versions": [ + "py2", + "py3" + ], "registries": { "ap-east-1": "057415533634", "ap-northeast-1": "520713654638", @@ -92,10 +145,13 @@ "us-west-1": "520713654638", "us-west-2": "520713654638" }, - "repository": "sagemaker-pytorch", - "py_versions": ["py2", "py3"] + "repository": "sagemaker-pytorch" }, "1.2.0": { + "py_versions": [ + "py2", + "py3" + ], "registries": { "ap-east-1": "871362719292", "ap-northeast-1": "763104351884", @@ -120,10 +176,13 @@ "us-west-1": "763104351884", "us-west-2": "763104351884" }, - "repository": "pytorch-training", - "py_versions": ["py2", "py3"] + "repository": "pytorch-inference" }, "1.3.1": { + "py_versions": [ + "py2", + "py3" + ], "registries": { "ap-east-1": "871362719292", "ap-northeast-1": "763104351884", @@ -148,10 +207,12 @@ "us-west-1": "763104351884", "us-west-2": "763104351884" }, - "repository": "pytorch-training", - "py_versions": ["py2", "py3"] + "repository": "pytorch-inference" }, "1.4.0": { + "py_versions": [ + "py3" + ], "registries": { "ap-east-1": "871362719292", "ap-northeast-1": "763104351884", @@ -176,10 +237,12 @@ "us-west-1": "763104351884", "us-west-2": "763104351884" }, - "repository": "pytorch-training", - "py_versions": ["py2", "py3"] + "repository": "pytorch-inference" }, "1.5.0": { + "py_versions": [ + "py3" + ], "registries": { "ap-east-1": "871362719292", "ap-northeast-1": "763104351884", @@ -204,13 +267,15 @@ "us-west-1": "763104351884", "us-west-2": "763104351884" }, - "repository": "pytorch-training", - "py_versions": ["py3"] + "repository": "pytorch-inference" } } }, - "inference": { - "processors": ["cpu", "gpu"], + "training": { + "processors": [ + "cpu", + "gpu" + ], "version_aliases": { "0.4": "0.4.0", "1.0": "1.0.0", @@ -218,10 +283,15 @@ "1.2": "1.2.0", "1.3": "1.3.1", "1.4": "1.4.0", - "1.5": "1.5.0" + "1.5": "1.5.0", + "1.6": "1.6.0" }, "versions": { "0.4.0": { + "py_versions": [ + "py2", + "py3" + ], "registries": { "ap-east-1": "057415533634", "ap-northeast-1": "520713654638", @@ -246,10 +316,13 @@ "us-west-1": "520713654638", "us-west-2": "520713654638" }, - "repository": "sagemaker-pytorch", - "py_versions": ["py2", "py3"] + "repository": "sagemaker-pytorch" }, "1.0.0": { + "py_versions": [ + "py2", + "py3" + ], "registries": { "ap-east-1": "057415533634", "ap-northeast-1": "520713654638", @@ -274,10 +347,13 @@ "us-west-1": "520713654638", "us-west-2": "520713654638" }, - "repository": "sagemaker-pytorch", - "py_versions": ["py2", "py3"] + "repository": "sagemaker-pytorch" }, "1.1.0": { + "py_versions": [ + "py2", + "py3" + ], "registries": { "ap-east-1": "057415533634", "ap-northeast-1": "520713654638", @@ -302,10 +378,13 @@ "us-west-1": "520713654638", "us-west-2": "520713654638" }, - "repository": "sagemaker-pytorch", - "py_versions": ["py2", "py3"] + "repository": "sagemaker-pytorch" }, "1.2.0": { + "py_versions": [ + "py2", + "py3" + ], "registries": { "ap-east-1": "871362719292", "ap-northeast-1": "763104351884", @@ -330,10 +409,13 @@ "us-west-1": "763104351884", "us-west-2": "763104351884" }, - "repository": "pytorch-inference", - "py_versions": ["py2", "py3"] + "repository": "pytorch-training" }, "1.3.1": { + "py_versions": [ + "py2", + "py3" + ], "registries": { "ap-east-1": "871362719292", "ap-northeast-1": "763104351884", @@ -358,10 +440,13 @@ "us-west-1": "763104351884", "us-west-2": "763104351884" }, - "repository": "pytorch-inference", - "py_versions": ["py2", "py3"] + "repository": "pytorch-training" }, "1.4.0": { + "py_versions": [ + "py2", + "py3" + ], "registries": { "ap-east-1": "871362719292", "ap-northeast-1": "763104351884", @@ -386,10 +471,12 @@ "us-west-1": "763104351884", "us-west-2": "763104351884" }, - "repository": "pytorch-inference", - "py_versions": ["py3"] + "repository": "pytorch-training" }, "1.5.0": { + "py_versions": [ + "py3" + ], "registries": { "ap-east-1": "871362719292", "ap-northeast-1": "763104351884", @@ -414,18 +501,12 @@ "us-west-1": "763104351884", "us-west-2": "763104351884" }, - "repository": "pytorch-inference", - "py_versions": ["py3"] - } - } - }, - "eia": { - "processors": ["cpu"], - "version_aliases": { - "1.3": "1.3.1" - }, - "versions": { - "1.3.1": { + "repository": "pytorch-training" + }, + "1.6.0": { + "py_versions": [ + "py3" + ], "registries": { "ap-east-1": "871362719292", "ap-northeast-1": "763104351884", @@ -450,9 +531,8 @@ "us-west-1": "763104351884", "us-west-2": "763104351884" }, - "repository": "pytorch-inference-eia", - "py_versions": ["py3"] + "repository": "pytorch-training" } } } -} +} \ No newline at end of file diff --git a/tests/integ/test_airflow_config.py b/tests/integ/test_airflow_config.py index 155c03ea66..64a4861a48 100644 --- a/tests/integ/test_airflow_config.py +++ b/tests/integ/test_airflow_config.py @@ -574,15 +574,15 @@ def test_xgboost_airflow_config_uploads_data_source_to_s3( def test_pytorch_airflow_config_uploads_data_source_to_s3_when_inputs_not_provided( sagemaker_session, cpu_instance_type, - pytorch_training_latest_version, - pytorch_training_latest_py_version, + pytorch_inference_latest_version, + pytorch_inference_latest_py_version, ): with timeout(seconds=AIRFLOW_CONFIG_TIMEOUT_IN_SECONDS): estimator = PyTorch( entry_point=PYTORCH_MNIST_SCRIPT, role=ROLE, - framework_version=pytorch_training_latest_version, - py_version=pytorch_training_latest_py_version, + framework_version=pytorch_inference_latest_version, + py_version=pytorch_inference_latest_py_version, instance_count=2, instance_type=cpu_instance_type, hyperparameters={"epochs": 6, "backend": "gloo"}, diff --git a/tests/integ/test_git.py b/tests/integ/test_git.py index e2bcdf13b3..d53183bc27 100644 --- a/tests/integ/test_git.py +++ b/tests/integ/test_git.py @@ -51,7 +51,7 @@ @pytest.mark.local_mode def test_github( - sagemaker_local_session, pytorch_training_latest_version, pytorch_training_latest_py_version + sagemaker_local_session, pytorch_inference_latest_version, pytorch_inference_latest_py_version ): script_path = "mnist.py" git_config = {"repo": GIT_REPO, "branch": BRANCH, "commit": COMMIT} @@ -60,8 +60,8 @@ def test_github( entry_point=script_path, role="SageMakerRole", source_dir="pytorch", - framework_version=pytorch_training_latest_version, - py_version=pytorch_training_latest_py_version, + framework_version=pytorch_inference_latest_version, + py_version=pytorch_inference_latest_py_version, instance_count=1, instance_type="local", sagemaker_session=sagemaker_local_session, diff --git a/tests/integ/test_pytorch.py b/tests/integ/test_pytorch.py index c5ae32677b..0309d6eec6 100644 --- a/tests/integ/test_pytorch.py +++ b/tests/integ/test_pytorch.py @@ -55,11 +55,33 @@ def fixture_training_job( return pytorch.latest_training_job.name +@pytest.fixture(scope="module", name="pytorch_training_job_with_latest_infernce_version") +def fixture_training_job_with_latest_inference_version( + sagemaker_session, + pytorch_inference_latest_version, + pytorch_inference_latest_py_version, + cpu_instance_type, +): + with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES): + pytorch = _get_pytorch_estimator( + sagemaker_session, + pytorch_inference_latest_version, + pytorch_inference_latest_py_version, + cpu_instance_type, + ) + pytorch.fit({"training": _upload_training_data(pytorch)}) + return pytorch.latest_training_job.name + + @pytest.mark.canary_quick -def test_fit_deploy(pytorch_training_job, sagemaker_session, cpu_instance_type): +def test_fit_deploy( + pytorch_training_job_with_latest_infernce_version, sagemaker_session, cpu_instance_type +): endpoint_name = "test-pytorch-sync-fit-attach-deploy{}".format(sagemaker_timestamp()) with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session): - estimator = PyTorch.attach(pytorch_training_job, sagemaker_session=sagemaker_session) + estimator = PyTorch.attach( + pytorch_training_job_with_latest_infernce_version, sagemaker_session=sagemaker_session + ) predictor = estimator.deploy(1, cpu_instance_type, endpoint_name=endpoint_name) data = numpy.zeros(shape=(1, 1, 28, 28), dtype=numpy.float32) predictor.predict(data) @@ -73,13 +95,13 @@ def test_fit_deploy(pytorch_training_job, sagemaker_session, cpu_instance_type): @pytest.mark.local_mode def test_local_fit_deploy( - sagemaker_local_session, pytorch_training_latest_version, pytorch_training_latest_py_version + sagemaker_local_session, pytorch_inference_latest_version, pytorch_inference_latest_py_version ): pytorch = PyTorch( entry_point=MNIST_SCRIPT, role="SageMakerRole", - framework_version=pytorch_training_latest_version, - py_version=pytorch_training_latest_py_version, + framework_version=pytorch_inference_latest_version, + py_version=pytorch_inference_latest_py_version, instance_count=1, instance_type="local", sagemaker_session=sagemaker_local_session, diff --git a/tests/integ/test_tuner.py b/tests/integ/test_tuner.py index 5847061b6a..dc23a199fd 100644 --- a/tests/integ/test_tuner.py +++ b/tests/integ/test_tuner.py @@ -748,8 +748,8 @@ def test_tuning_chainer( def test_attach_tuning_pytorch( sagemaker_session, cpu_instance_type, - pytorch_training_latest_version, - pytorch_training_latest_py_version, + pytorch_inference_latest_version, + pytorch_inference_latest_py_version, ): mnist_dir = os.path.join(DATA_DIR, "pytorch_mnist") mnist_script = os.path.join(mnist_dir, "mnist.py") @@ -758,8 +758,8 @@ def test_attach_tuning_pytorch( entry_point=mnist_script, role="SageMakerRole", instance_count=1, - framework_version=pytorch_training_latest_version, - py_version=pytorch_training_latest_py_version, + framework_version=pytorch_inference_latest_version, + py_version=pytorch_inference_latest_py_version, instance_type=cpu_instance_type, sagemaker_session=sagemaker_session, )