From 2730b5107f7644deaa071a23951e503e77a7d74a Mon Sep 17 00:00:00 2001 From: Yadan Wei Date: Fri, 28 Aug 2026 17:51:14 +0000 Subject: [PATCH 1/4] change: add image_uri_config for DLC serving frameworks Add image_uri_config entries for the AWS Deep Learning Containers serving frameworks, using the whole-tag (channel / amzn2023) pattern so image_uris.retrieve() returns the image tag verbatim. Channel configs expose each major tag and its latest minor (no patch), with a latest alias: - vllm-server (vllm repo): server-sagemaker-cuda v1, v1.4, v2, v2.4 - vllm-omni (vllm repo): omni-sagemaker-cuda v1, v1.6 - sglang-server (sglang repo): server-sagemaker-cuda v1, v1.3 - llama-cpp: server-sagemaker-cuda v1, v1.0 - llama-cpp-arm64: server-sagemaker-cpu v1, v1.0 - ray-serve (ray repo): serve-ml-sagemaker-cuda v1, v1.4 - whisperx: 3.8-cu128-amzn2023-sagemaker Adds tests/unit/image_uris/test_dlc_serving_frameworks.py. --- .../image_uri_config/llama-cpp-arm64.json | 98 +++++++++ .../core/image_uri_config/llama-cpp.json | 98 +++++++++ .../core/image_uri_config/ray-serve.json | 98 +++++++++ .../core/image_uri_config/sglang-server.json | 98 +++++++++ .../core/image_uri_config/vllm-omni.json | 98 +++++++++ .../core/image_uri_config/vllm-server.json | 186 ++++++++++++++++++ .../core/image_uri_config/whisperx.json | 54 +++++ .../image_uris/test_dlc_serving_frameworks.py | 73 +++++++ 8 files changed, 803 insertions(+) create mode 100644 sagemaker-core/src/sagemaker/core/image_uri_config/llama-cpp-arm64.json create mode 100644 sagemaker-core/src/sagemaker/core/image_uri_config/llama-cpp.json create mode 100644 sagemaker-core/src/sagemaker/core/image_uri_config/ray-serve.json create mode 100644 sagemaker-core/src/sagemaker/core/image_uri_config/sglang-server.json create mode 100644 sagemaker-core/src/sagemaker/core/image_uri_config/vllm-omni.json create mode 100644 sagemaker-core/src/sagemaker/core/image_uri_config/vllm-server.json create mode 100644 sagemaker-core/src/sagemaker/core/image_uri_config/whisperx.json create mode 100644 sagemaker-core/tests/unit/image_uris/test_dlc_serving_frameworks.py diff --git a/sagemaker-core/src/sagemaker/core/image_uri_config/llama-cpp-arm64.json b/sagemaker-core/src/sagemaker/core/image_uri_config/llama-cpp-arm64.json new file mode 100644 index 0000000000..d1d3d314ca --- /dev/null +++ b/sagemaker-core/src/sagemaker/core/image_uri_config/llama-cpp-arm64.json @@ -0,0 +1,98 @@ +{ + "scope": [ + "inference" + ], + "version_aliases": { + "latest": "1" + }, + "versions": { + "1": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "llama-cpp-arm64", + "tag_prefix": "server-sagemaker-cpu-v1" + }, + "1.0": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "llama-cpp-arm64", + "tag_prefix": "server-sagemaker-cpu-v1.0" + } + } +} diff --git a/sagemaker-core/src/sagemaker/core/image_uri_config/llama-cpp.json b/sagemaker-core/src/sagemaker/core/image_uri_config/llama-cpp.json new file mode 100644 index 0000000000..dd0e5241ef --- /dev/null +++ b/sagemaker-core/src/sagemaker/core/image_uri_config/llama-cpp.json @@ -0,0 +1,98 @@ +{ + "scope": [ + "inference" + ], + "version_aliases": { + "latest": "1" + }, + "versions": { + "1": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "llama-cpp", + "tag_prefix": "server-sagemaker-cuda-v1" + }, + "1.0": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "llama-cpp", + "tag_prefix": "server-sagemaker-cuda-v1.0" + } + } +} diff --git a/sagemaker-core/src/sagemaker/core/image_uri_config/ray-serve.json b/sagemaker-core/src/sagemaker/core/image_uri_config/ray-serve.json new file mode 100644 index 0000000000..6fa72b8cb3 --- /dev/null +++ b/sagemaker-core/src/sagemaker/core/image_uri_config/ray-serve.json @@ -0,0 +1,98 @@ +{ + "scope": [ + "inference" + ], + "version_aliases": { + "latest": "1" + }, + "versions": { + "1": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "ray", + "tag_prefix": "serve-ml-sagemaker-cuda-v1" + }, + "1.4": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "ray", + "tag_prefix": "serve-ml-sagemaker-cuda-v1.4" + } + } +} diff --git a/sagemaker-core/src/sagemaker/core/image_uri_config/sglang-server.json b/sagemaker-core/src/sagemaker/core/image_uri_config/sglang-server.json new file mode 100644 index 0000000000..6e006a07a9 --- /dev/null +++ b/sagemaker-core/src/sagemaker/core/image_uri_config/sglang-server.json @@ -0,0 +1,98 @@ +{ + "scope": [ + "inference" + ], + "version_aliases": { + "latest": "1" + }, + "versions": { + "1": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "sglang", + "tag_prefix": "server-sagemaker-cuda-v1" + }, + "1.3": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "sglang", + "tag_prefix": "server-sagemaker-cuda-v1.3" + } + } +} diff --git a/sagemaker-core/src/sagemaker/core/image_uri_config/vllm-omni.json b/sagemaker-core/src/sagemaker/core/image_uri_config/vllm-omni.json new file mode 100644 index 0000000000..2d5f913f15 --- /dev/null +++ b/sagemaker-core/src/sagemaker/core/image_uri_config/vllm-omni.json @@ -0,0 +1,98 @@ +{ + "scope": [ + "inference" + ], + "version_aliases": { + "latest": "1" + }, + "versions": { + "1": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "vllm", + "tag_prefix": "omni-sagemaker-cuda-v1" + }, + "1.6": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "vllm", + "tag_prefix": "omni-sagemaker-cuda-v1.6" + } + } +} diff --git a/sagemaker-core/src/sagemaker/core/image_uri_config/vllm-server.json b/sagemaker-core/src/sagemaker/core/image_uri_config/vllm-server.json new file mode 100644 index 0000000000..27dbb79eb4 --- /dev/null +++ b/sagemaker-core/src/sagemaker/core/image_uri_config/vllm-server.json @@ -0,0 +1,186 @@ +{ + "scope": [ + "inference" + ], + "version_aliases": { + "latest": "2" + }, + "versions": { + "1": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "vllm", + "tag_prefix": "server-sagemaker-cuda-v1" + }, + "1.4": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "vllm", + "tag_prefix": "server-sagemaker-cuda-v1.4" + }, + "2": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "vllm", + "tag_prefix": "server-sagemaker-cuda-v2" + }, + "2.4": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "vllm", + "tag_prefix": "server-sagemaker-cuda-v2.4" + } + } +} diff --git a/sagemaker-core/src/sagemaker/core/image_uri_config/whisperx.json b/sagemaker-core/src/sagemaker/core/image_uri_config/whisperx.json new file mode 100644 index 0000000000..62ea0640af --- /dev/null +++ b/sagemaker-core/src/sagemaker/core/image_uri_config/whisperx.json @@ -0,0 +1,54 @@ +{ + "scope": [ + "inference" + ], + "version_aliases": { + "latest": "3.8" + }, + "versions": { + "3.8": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "whisperx", + "tag_prefix": "3.8-cu128-amzn2023-sagemaker" + } + } +} diff --git a/sagemaker-core/tests/unit/image_uris/test_dlc_serving_frameworks.py b/sagemaker-core/tests/unit/image_uris/test_dlc_serving_frameworks.py new file mode 100644 index 0000000000..9f9909bec7 --- /dev/null +++ b/sagemaker-core/tests/unit/image_uris/test_dlc_serving_frameworks.py @@ -0,0 +1,73 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +from __future__ import absolute_import + +import pytest + +from sagemaker.core import image_uris + +# GPU instance; these configs omit "processors", so the processor slot is dropped +# and the whole tag is taken verbatim from tag_prefix (instance type is ignored). +INSTANCE_TYPE = "ml.g5.2xlarge" + +# DLC serving-framework configs that use the whole-tag (djl-lmi style) pattern: +# each version's tag_prefix is the full image tag (channel or amzn2023), with no +# processor/py/container_version tokens appended. +SERVING_CONFIG_FILES = [ + "vllm-server.json", + "vllm-omni.json", + "sglang-server.json", + "llama-cpp.json", + "llama-cpp-arm64.json", + "ray-serve.json", + "whisperx.json", +] + + +@pytest.mark.parametrize("load_config_and_file_name", SERVING_CONFIG_FILES, indirect=True) +def test_serving_framework_uris(load_config_and_file_name): + """Every (version, region) resolves to the expected repo:tag verbatim.""" + config, file_name = load_config_and_file_name + framework = file_name[: -len(".json")] + for version, version_config in config["versions"].items(): + repo = version_config["repository"] + tag = version_config["tag_prefix"] + for region, account in version_config["registries"].items(): + uri = image_uris.retrieve( + framework=framework, + region=region, + version=version, + image_scope="inference", + instance_type=INSTANCE_TYPE, + ) + # account (registry), region, repository and tag are config-controlled; + # the domain suffix is resolved by botocore. + assert uri.startswith(f"{account}.dkr.ecr.{region}."), uri + assert uri.endswith(f"/{repo}:{tag}"), uri + + +@pytest.mark.parametrize("load_config_and_file_name", SERVING_CONFIG_FILES, indirect=True) +def test_serving_framework_latest_alias(load_config_and_file_name): + """The 'latest' alias resolves to its target version's tag.""" + config, file_name = load_config_and_file_name + framework = file_name[: -len(".json")] + target = config["version_aliases"]["latest"] + expected = config["versions"][target] + uri = image_uris.retrieve( + framework=framework, + region="us-west-2", + version="latest", + image_scope="inference", + instance_type=INSTANCE_TYPE, + ) + assert uri.endswith(f"/{expected['repository']}:{expected['tag_prefix']}"), uri From 9bb3dd306723df2678a0a2743e3df4b32090dfef Mon Sep 17 00:00:00 2001 From: Yadan Wei Date: Fri, 28 Aug 2026 17:51:14 +0000 Subject: [PATCH 2/4] change: add amzn2023 unified pytorch repo to training image_uri_config Add PyTorch 2.11/2.12/2.13 training entries for the amzn2023 unified `pytorch` ECR repo (distinct from pytorch-training/pytorch-inference). Their tags encode CUDA directly, e.g. 2.13-cu133-amzn2023-sagemaker, with no "gpu" token, so a new optional version-config key "processor_in_tag" (default true, backward compatible) lets retrieve() drop the cpu/gpu processor token while still using the processor to select container_version. Both resolve: 2.13 + gpu instance -> pytorch:2.13-cu133-amzn2023-sagemaker 2.13 + cpu instance -> pytorch:2.13-cpu-amzn2023-sagemaker - image_uris.py: honor "processor_in_tag": false - pytorch.json: add 2.11/2.12/2.13 training versions (repository "pytorch") - test_pytorch_al2023.py: cpu/gpu coverage + regression that existing pytorch-training tags are unchanged --- .../core/image_uri_config/pytorch.json | 144 ++++++++++++++++++ .../src/sagemaker/core/image_uris.py | 9 ++ .../unit/image_uris/test_pytorch_al2023.py | 80 ++++++++++ 3 files changed, 233 insertions(+) create mode 100644 sagemaker-core/tests/unit/image_uris/test_pytorch_al2023.py diff --git a/sagemaker-core/src/sagemaker/core/image_uri_config/pytorch.json b/sagemaker-core/src/sagemaker/core/image_uri_config/pytorch.json index 8e55cbded3..197fdf4180 100644 --- a/sagemaker-core/src/sagemaker/core/image_uri_config/pytorch.json +++ b/sagemaker-core/src/sagemaker/core/image_uri_config/pytorch.json @@ -3095,6 +3095,150 @@ "us-west-2": "763104351884" }, "repository": "pytorch-training" + }, + "2.11": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "pytorch", + "container_version": { + "cpu": "cpu-amzn2023-sagemaker", + "gpu": "cu130-amzn2023-sagemaker" + }, + "processor_in_tag": false + }, + "2.12": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "pytorch", + "container_version": { + "cpu": "cpu-amzn2023-sagemaker", + "gpu": "cu130-amzn2023-sagemaker" + }, + "processor_in_tag": false + }, + "2.13": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "pytorch", + "container_version": { + "cpu": "cpu-amzn2023-sagemaker", + "gpu": "cu133-amzn2023-sagemaker" + }, + "processor_in_tag": false } } } diff --git a/sagemaker-core/src/sagemaker/core/image_uris.py b/sagemaker-core/src/sagemaker/core/image_uris.py index 2f3ee0add5..2b9bfdcc02 100644 --- a/sagemaker-core/src/sagemaker/core/image_uris.py +++ b/sagemaker-core/src/sagemaker/core/image_uris.py @@ -279,6 +279,15 @@ def retrieve( if repo == f"{framework}-inference-graviton": container_version = f"{container_version}-sagemaker" + + # Some images encode the accelerator directly in the tag (e.g. the amzn2023 + # "-cu133-amzn2023-sagemaker" tag has no "gpu" token), so the standard + # cpu/gpu processor token must not be appended. The processor is still used + # above to select the container_version; drop it from the tag when the version + # config opts out via "processor_in_tag": false. + if not version_config.get("processor_in_tag", True): + processor = None + _validate_instance_deprecation(framework, instance_type, version) tag = _get_image_tag( diff --git a/sagemaker-core/tests/unit/image_uris/test_pytorch_al2023.py b/sagemaker-core/tests/unit/image_uris/test_pytorch_al2023.py new file mode 100644 index 0000000000..7ee504223d --- /dev/null +++ b/sagemaker-core/tests/unit/image_uris/test_pytorch_al2023.py @@ -0,0 +1,80 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +from __future__ import absolute_import + +import pytest + +from sagemaker.core import image_uris +from sagemaker.core.common_utils import ALTERNATE_DOMAINS + +GPU_INSTANCE = "ml.g5.2xlarge" +CPU_INSTANCE = "ml.m5.xlarge" +DEFAULT_DOMAIN = "amazonaws.com" + +# amzn2023 unified `pytorch` repo training versions. Their GPU tag encodes the +# CUDA version directly (e.g. 2.13-cu133-amzn2023-sagemaker) with no "gpu" token, +# so these versions set "processor_in_tag": false and bake the accelerator into +# container_version. +AL2023_VERSIONS = ["2.11", "2.12", "2.13"] + + +@pytest.mark.parametrize("load_config", ["pytorch.json"], indirect=True) +def test_pytorch_al2023_training_uris(load_config): + """The amzn2023 `pytorch` repo versions resolve for both cpu and gpu, and the + gpu tag carries the cuNNN token rather than a literal "gpu".""" + training = load_config["training"] + for version in AL2023_VERSIONS: + version_config = training["versions"][version] + assert version_config["repository"] == "pytorch" + assert version_config["processor_in_tag"] is False + container_version = version_config["container_version"] + for region, account in version_config["registries"].items(): + domain = ALTERNATE_DOMAINS.get(region, DEFAULT_DOMAIN) + + gpu_uri = image_uris.retrieve( + framework="pytorch", + region=region, + version=version, + image_scope="training", + instance_type=GPU_INSTANCE, + ) + assert gpu_uri == ( + f"{account}.dkr.ecr.{region}.{domain}" + f"/pytorch:{version}-{container_version['gpu']}" + ) + assert "-gpu-" not in gpu_uri + + cpu_uri = image_uris.retrieve( + framework="pytorch", + region=region, + version=version, + image_scope="training", + instance_type=CPU_INSTANCE, + ) + assert cpu_uri == ( + f"{account}.dkr.ecr.{region}.{domain}" + f"/pytorch:{version}-{container_version['cpu']}" + ) + + +def test_existing_pytorch_training_unaffected_by_processor_in_tag(): + """Regression: Ubuntu pytorch-training still appends the processor + py tokens + (processor_in_tag defaults to True when the key is absent).""" + uri = image_uris.retrieve( + framework="pytorch", + region="us-west-2", + version="2.8.0", + image_scope="training", + instance_type=GPU_INSTANCE, + ) + assert uri.endswith("/pytorch-training:2.8.0-gpu-py312") From 1a8808df30e0c01ab7871076076ec6a20e36d3c1 Mon Sep 17 00:00:00 2001 From: Yadan Wei Date: Fri, 28 Aug 2026 19:39:29 +0000 Subject: [PATCH 3/4] change: drop vllm-server v1 from image_uri_config (keep v2, v2.4) --- .../core/image_uri_config/vllm-server.json | 88 ------------------- 1 file changed, 88 deletions(-) diff --git a/sagemaker-core/src/sagemaker/core/image_uri_config/vllm-server.json b/sagemaker-core/src/sagemaker/core/image_uri_config/vllm-server.json index 27dbb79eb4..54a10f604b 100644 --- a/sagemaker-core/src/sagemaker/core/image_uri_config/vllm-server.json +++ b/sagemaker-core/src/sagemaker/core/image_uri_config/vllm-server.json @@ -6,94 +6,6 @@ "latest": "2" }, "versions": { - "1": { - "registries": { - "af-south-1": "626614931356", - "ap-east-1": "871362719292", - "ap-east-2": "975050140332", - "ap-northeast-1": "763104351884", - "ap-northeast-2": "763104351884", - "ap-northeast-3": "364406365360", - "ap-south-1": "763104351884", - "ap-south-2": "772153158452", - "ap-southeast-1": "763104351884", - "ap-southeast-2": "763104351884", - "ap-southeast-3": "907027046896", - "ap-southeast-4": "457447274322", - "ap-southeast-5": "550225433462", - "ap-southeast-6": "633930458069", - "ap-southeast-7": "590183813437", - "ca-central-1": "763104351884", - "ca-west-1": "204538143572", - "cn-north-1": "727897471807", - "cn-northwest-1": "727897471807", - "eu-central-1": "763104351884", - "eu-central-2": "380420809688", - "eu-north-1": "763104351884", - "eu-south-1": "692866216735", - "eu-south-2": "503227376785", - "eu-west-1": "763104351884", - "eu-west-2": "763104351884", - "eu-west-3": "763104351884", - "il-central-1": "780543022126", - "me-central-1": "914824155844", - "me-south-1": "217643126080", - "mx-central-1": "637423239942", - "sa-east-1": "763104351884", - "us-east-1": "763104351884", - "us-east-2": "763104351884", - "us-gov-east-1": "446045086412", - "us-gov-west-1": "442386744353", - "us-west-1": "763104351884", - "us-west-2": "763104351884" - }, - "repository": "vllm", - "tag_prefix": "server-sagemaker-cuda-v1" - }, - "1.4": { - "registries": { - "af-south-1": "626614931356", - "ap-east-1": "871362719292", - "ap-east-2": "975050140332", - "ap-northeast-1": "763104351884", - "ap-northeast-2": "763104351884", - "ap-northeast-3": "364406365360", - "ap-south-1": "763104351884", - "ap-south-2": "772153158452", - "ap-southeast-1": "763104351884", - "ap-southeast-2": "763104351884", - "ap-southeast-3": "907027046896", - "ap-southeast-4": "457447274322", - "ap-southeast-5": "550225433462", - "ap-southeast-6": "633930458069", - "ap-southeast-7": "590183813437", - "ca-central-1": "763104351884", - "ca-west-1": "204538143572", - "cn-north-1": "727897471807", - "cn-northwest-1": "727897471807", - "eu-central-1": "763104351884", - "eu-central-2": "380420809688", - "eu-north-1": "763104351884", - "eu-south-1": "692866216735", - "eu-south-2": "503227376785", - "eu-west-1": "763104351884", - "eu-west-2": "763104351884", - "eu-west-3": "763104351884", - "il-central-1": "780543022126", - "me-central-1": "914824155844", - "me-south-1": "217643126080", - "mx-central-1": "637423239942", - "sa-east-1": "763104351884", - "us-east-1": "763104351884", - "us-east-2": "763104351884", - "us-gov-east-1": "446045086412", - "us-gov-west-1": "442386744353", - "us-west-1": "763104351884", - "us-west-2": "763104351884" - }, - "repository": "vllm", - "tag_prefix": "server-sagemaker-cuda-v1.4" - }, "2": { "registries": { "af-south-1": "626614931356", From 67187e67b594b1515d840ae81b076d94ef6bce75 Mon Sep 17 00:00:00 2001 From: Yadan Wei Date: Fri, 28 Aug 2026 20:02:59 +0000 Subject: [PATCH 4/4] change: split amzn2023 pytorch into pytorch-amzn2023; add Ubuntu 2.9/2.10 Move the amzn2023 unified `pytorch` repo out of pytorch.json into its own framework `pytorch-amzn2023` (pytorch-amzn2023.json, training, 2.11/2.12/2.13, cpu+gpu via processor_in_tag). This keeps the existing `pytorch` (Ubuntu pytorch-training) no-version default on pytorch-training instead of shifting it onto the amzn2023 repo. Also add Ubuntu pytorch-training 2.9.0 (py312) and 2.10.0 (py313) to pytorch.json training. Replaces test_pytorch_al2023.py with test_pytorch_amzn2023.py (cpu/gpu coverage + a regression that the pytorch training default stays on pytorch-training). --- .../image_uri_config/pytorch-amzn2023.json | 157 ++++++++++++++++++ .../core/image_uri_config/pytorch.json | 76 ++------- ...rch_al2023.py => test_pytorch_amzn2023.py} | 43 +++-- 3 files changed, 198 insertions(+), 78 deletions(-) create mode 100644 sagemaker-core/src/sagemaker/core/image_uri_config/pytorch-amzn2023.json rename sagemaker-core/tests/unit/image_uris/{test_pytorch_al2023.py => test_pytorch_amzn2023.py} (61%) diff --git a/sagemaker-core/src/sagemaker/core/image_uri_config/pytorch-amzn2023.json b/sagemaker-core/src/sagemaker/core/image_uri_config/pytorch-amzn2023.json new file mode 100644 index 0000000000..11c9402773 --- /dev/null +++ b/sagemaker-core/src/sagemaker/core/image_uri_config/pytorch-amzn2023.json @@ -0,0 +1,157 @@ +{ + "training": { + "processors": [ + "cpu", + "gpu" + ], + "version_aliases": { + "latest": "2.13" + }, + "versions": { + "2.11": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "pytorch", + "container_version": { + "cpu": "cpu-amzn2023-sagemaker", + "gpu": "cu130-amzn2023-sagemaker" + }, + "processor_in_tag": false + }, + "2.12": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "pytorch", + "container_version": { + "cpu": "cpu-amzn2023-sagemaker", + "gpu": "cu130-amzn2023-sagemaker" + }, + "processor_in_tag": false + }, + "2.13": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-east-2": "975050140332", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ap-southeast-5": "550225433462", + "ap-southeast-6": "633930458069", + "ap-southeast-7": "590183813437", + "ca-central-1": "763104351884", + "ca-west-1": "204538143572", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "il-central-1": "780543022126", + "me-central-1": "914824155844", + "me-south-1": "217643126080", + "mx-central-1": "637423239942", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "pytorch", + "container_version": { + "cpu": "cpu-amzn2023-sagemaker", + "gpu": "cu133-amzn2023-sagemaker" + }, + "processor_in_tag": false + } + } + } +} diff --git a/sagemaker-core/src/sagemaker/core/image_uri_config/pytorch.json b/sagemaker-core/src/sagemaker/core/image_uri_config/pytorch.json index 197fdf4180..127c183d4b 100644 --- a/sagemaker-core/src/sagemaker/core/image_uri_config/pytorch.json +++ b/sagemaker-core/src/sagemaker/core/image_uri_config/pytorch.json @@ -1738,7 +1738,9 @@ "2.5": "2.5.1", "2.6": "2.6.0", "2.7": "2.7.1", - "2.8": "2.8.0" + "2.8": "2.8.0", + "2.9": "2.9.0", + "2.10": "2.10.0" }, "versions": { "0.4.0": { @@ -3096,55 +3098,10 @@ }, "repository": "pytorch-training" }, - "2.11": { - "registries": { - "af-south-1": "626614931356", - "ap-east-1": "871362719292", - "ap-east-2": "975050140332", - "ap-northeast-1": "763104351884", - "ap-northeast-2": "763104351884", - "ap-northeast-3": "364406365360", - "ap-south-1": "763104351884", - "ap-south-2": "772153158452", - "ap-southeast-1": "763104351884", - "ap-southeast-2": "763104351884", - "ap-southeast-3": "907027046896", - "ap-southeast-4": "457447274322", - "ap-southeast-5": "550225433462", - "ap-southeast-6": "633930458069", - "ap-southeast-7": "590183813437", - "ca-central-1": "763104351884", - "ca-west-1": "204538143572", - "cn-north-1": "727897471807", - "cn-northwest-1": "727897471807", - "eu-central-1": "763104351884", - "eu-central-2": "380420809688", - "eu-north-1": "763104351884", - "eu-south-1": "692866216735", - "eu-south-2": "503227376785", - "eu-west-1": "763104351884", - "eu-west-2": "763104351884", - "eu-west-3": "763104351884", - "il-central-1": "780543022126", - "me-central-1": "914824155844", - "me-south-1": "217643126080", - "mx-central-1": "637423239942", - "sa-east-1": "763104351884", - "us-east-1": "763104351884", - "us-east-2": "763104351884", - "us-gov-east-1": "446045086412", - "us-gov-west-1": "442386744353", - "us-west-1": "763104351884", - "us-west-2": "763104351884" - }, - "repository": "pytorch", - "container_version": { - "cpu": "cpu-amzn2023-sagemaker", - "gpu": "cu130-amzn2023-sagemaker" - }, - "processor_in_tag": false - }, - "2.12": { + "2.9.0": { + "py_versions": [ + "py312" + ], "registries": { "af-south-1": "626614931356", "ap-east-1": "871362719292", @@ -3185,14 +3142,12 @@ "us-west-1": "763104351884", "us-west-2": "763104351884" }, - "repository": "pytorch", - "container_version": { - "cpu": "cpu-amzn2023-sagemaker", - "gpu": "cu130-amzn2023-sagemaker" - }, - "processor_in_tag": false + "repository": "pytorch-training" }, - "2.13": { + "2.10.0": { + "py_versions": [ + "py313" + ], "registries": { "af-south-1": "626614931356", "ap-east-1": "871362719292", @@ -3233,12 +3188,7 @@ "us-west-1": "763104351884", "us-west-2": "763104351884" }, - "repository": "pytorch", - "container_version": { - "cpu": "cpu-amzn2023-sagemaker", - "gpu": "cu133-amzn2023-sagemaker" - }, - "processor_in_tag": false + "repository": "pytorch-training" } } } diff --git a/sagemaker-core/tests/unit/image_uris/test_pytorch_al2023.py b/sagemaker-core/tests/unit/image_uris/test_pytorch_amzn2023.py similarity index 61% rename from sagemaker-core/tests/unit/image_uris/test_pytorch_al2023.py rename to sagemaker-core/tests/unit/image_uris/test_pytorch_amzn2023.py index 7ee504223d..328cf84880 100644 --- a/sagemaker-core/tests/unit/image_uris/test_pytorch_al2023.py +++ b/sagemaker-core/tests/unit/image_uris/test_pytorch_amzn2023.py @@ -21,19 +21,19 @@ CPU_INSTANCE = "ml.m5.xlarge" DEFAULT_DOMAIN = "amazonaws.com" -# amzn2023 unified `pytorch` repo training versions. Their GPU tag encodes the -# CUDA version directly (e.g. 2.13-cu133-amzn2023-sagemaker) with no "gpu" token, +# The amzn2023 unified `pytorch` repo (framework "pytorch-amzn2023"). Its GPU tag +# encodes CUDA directly (e.g. 2.13-cu133-amzn2023-sagemaker) with no "gpu" token, # so these versions set "processor_in_tag": false and bake the accelerator into # container_version. -AL2023_VERSIONS = ["2.11", "2.12", "2.13"] +AMZN2023_VERSIONS = ["2.11", "2.12", "2.13"] -@pytest.mark.parametrize("load_config", ["pytorch.json"], indirect=True) -def test_pytorch_al2023_training_uris(load_config): - """The amzn2023 `pytorch` repo versions resolve for both cpu and gpu, and the - gpu tag carries the cuNNN token rather than a literal "gpu".""" +@pytest.mark.parametrize("load_config", ["pytorch-amzn2023.json"], indirect=True) +def test_pytorch_amzn2023_training_uris(load_config): + """pytorch-amzn2023 resolves both cpu and gpu; the gpu tag carries cuNNN, not "gpu".""" training = load_config["training"] - for version in AL2023_VERSIONS: + assert sorted(training["versions"]) == sorted(AMZN2023_VERSIONS) + for version in AMZN2023_VERSIONS: version_config = training["versions"][version] assert version_config["repository"] == "pytorch" assert version_config["processor_in_tag"] is False @@ -42,7 +42,7 @@ def test_pytorch_al2023_training_uris(load_config): domain = ALTERNATE_DOMAINS.get(region, DEFAULT_DOMAIN) gpu_uri = image_uris.retrieve( - framework="pytorch", + framework="pytorch-amzn2023", region=region, version=version, image_scope="training", @@ -55,7 +55,7 @@ def test_pytorch_al2023_training_uris(load_config): assert "-gpu-" not in gpu_uri cpu_uri = image_uris.retrieve( - framework="pytorch", + framework="pytorch-amzn2023", region=region, version=version, image_scope="training", @@ -67,14 +67,27 @@ def test_pytorch_al2023_training_uris(load_config): ) -def test_existing_pytorch_training_unaffected_by_processor_in_tag(): - """Regression: Ubuntu pytorch-training still appends the processor + py tokens - (processor_in_tag defaults to True when the key is absent).""" +def test_pytorch_training_default_stays_ubuntu(): + """The `pytorch` (Ubuntu) training default must NOT move onto the amzn2023 repo: + with no version, retrieve() resolves to a pytorch-training image, not `pytorch`.""" uri = image_uris.retrieve( framework="pytorch", region="us-west-2", - version="2.8.0", image_scope="training", instance_type=GPU_INSTANCE, ) - assert uri.endswith("/pytorch-training:2.8.0-gpu-py312") + assert "/pytorch-training:" in uri + assert "-amzn2023-" not in uri + + +def test_pytorch_training_new_ubuntu_versions(): + """The newly added Ubuntu training versions resolve on pytorch-training.""" + for version, py in [("2.8.0", "py312"), ("2.9.0", "py312"), ("2.10.0", "py313")]: + uri = image_uris.retrieve( + framework="pytorch", + region="us-west-2", + version=version, + image_scope="training", + instance_type=GPU_INSTANCE, + ) + assert uri.endswith(f"/pytorch-training:{version}-gpu-{py}")