Skip to content

Commit 63960b4

Browse files
pytorch: add PyTorch 2.12.1 DLC images (CUDA + CPU, EC2 + SageMaker) (#6322)
* pytorch: add PyTorch 2.12.1 DLC images (CUDA + CPU, EC2 + SageMaker) Add the 2.12 minor version alongside 2.11: - docker/pytorch/2.12/: Dockerfiles + pyproject/uv.lock for cuda and cpu - 4 image configs (ec2/sagemaker x cuda/cpu) - 4 caller workflows (PR cuda/cpu, autorelease ec2/sagemaker) - register both autorelease workflows in release-schedule.yml Version pins: torch 2.12.1, torchvision 0.27.1. torchaudio stays at 2.11.0 (its final release — no 2.12 exists upstream); it has no torch pin and resolves cleanly against torch 2.12.1. CUDA index unchanged (cu130); remaining GPU pins mirror 2.11. Autorelease crons use free Mon/Wed slots (22:00 ec2, 23:00 sagemaker). * pytorch: consolidate per-version Dockerfiles into one shared file per device The CUDA and CPU Dockerfiles were byte-identical across PyTorch minor versions except for ARG defaults (TORCH_VERSION, FRAMEWORK_SHORT_VERSION) that CI always overrides. Every version-specific input is already located via context-root-relative COPY of docker/pytorch/${FRAMEWORK_SHORT_VERSION}/..., and FRAMEWORK_SHORT_VERSION is derived at build time by the pytorch_runtime pre_build hook — so the Dockerfile path no longer needs to encode the version. - Move 2.12 Dockerfiles to docker/pytorch/Dockerfile.{cuda,cpu}; delete the 2.11 copies (byte-identical aside from ARG defaults) - Repoint all 8 image configs' build.dockerfile at the shared files - Repoint the 2.11 + 2.12 PR path filters at the shared files - Per-version pin dirs (2.x/{cuda,cpu}/{pyproject.toml,uv.lock}) unchanged — they remain the per-version source of truth Verified: a build with context=. and -f the shared Dockerfile, differing only by --build-arg FRAMEWORK_SHORT_VERSION, resolves the correct version's pyproject (2.11 -> torch 2.11.0, 2.12 -> torch 2.12.1). A change to the shared Dockerfile now triggers PR builds for every live version.
1 parent baa1cdc commit 63960b4

21 files changed

Lines changed: 7839 additions & 19 deletions

.github/config/image/pytorch/2.11-ec2-cpu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ metadata:
1313
prod_image: "pytorch:2.11-cpu-amzn2023"
1414

1515
build:
16-
dockerfile: "docker/pytorch/2.11/Dockerfile.cpu"
16+
dockerfile: "docker/pytorch/Dockerfile.cpu"
1717
target: "runtime"
1818
python_version: "3.12"
1919
torch_version: "2.11.0"

.github/config/image/pytorch/2.11-ec2-cuda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ metadata:
1313
prod_image: "pytorch:2.11-cu130-amzn2023"
1414

1515
build:
16-
dockerfile: "docker/pytorch/2.11/Dockerfile.cuda"
16+
dockerfile: "docker/pytorch/Dockerfile.cuda"
1717
target: "runtime"
1818
python_version: "3.12"
1919
cuda_version: "13.0.2"

.github/config/image/pytorch/2.11-sagemaker-cpu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ metadata:
1414
prod_image: "pytorch:2.11-cpu-amzn2023-sagemaker"
1515

1616
build:
17-
dockerfile: "docker/pytorch/2.11/Dockerfile.cpu"
17+
dockerfile: "docker/pytorch/Dockerfile.cpu"
1818
target: "sagemaker"
1919
python_version: "3.12"
2020
torch_version: "2.11.0"

.github/config/image/pytorch/2.11-sagemaker-cuda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ metadata:
1414
prod_image: "pytorch:2.11-cu130-amzn2023-sagemaker"
1515

1616
build:
17-
dockerfile: "docker/pytorch/2.11/Dockerfile.cuda"
17+
dockerfile: "docker/pytorch/Dockerfile.cuda"
1818
target: "sagemaker"
1919
python_version: "3.12"
2020
cuda_version: "13.0.2"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
image:
2+
name: "pytorch-2.12-ec2-cpu"
3+
description: "PyTorch 2.12 CPU training for EC2 instances"
4+
5+
metadata:
6+
framework: "pytorch_runtime"
7+
framework_version: "2.12.1"
8+
os_version: "amzn2023"
9+
customer_type: "ec2"
10+
arch_type: "x86"
11+
device_type: "cpu"
12+
job_type: "training"
13+
prod_image: "pytorch:2.12-cpu-amzn2023"
14+
15+
build:
16+
dockerfile: "docker/pytorch/Dockerfile.cpu"
17+
target: "runtime"
18+
python_version: "3.12"
19+
torch_version: "2.12.1"
20+
torchvision_version: "0.27.1"
21+
torchaudio_version: "2.11.0"
22+
max_jobs: "8"
23+
dlc_major_version: "1"
24+
dlc_minor_version: "0"
25+
26+
release:
27+
release: true
28+
force_release: false
29+
public_registry: true
30+
private_registry: true
31+
enable_soci: true
32+
environment: "production"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
image:
2+
name: "pytorch-2.12-ec2-cuda"
3+
description: "PyTorch 2.12 CUDA training for EC2 instances"
4+
5+
metadata:
6+
framework: "pytorch_runtime"
7+
framework_version: "2.12.1"
8+
os_version: "amzn2023"
9+
customer_type: "ec2"
10+
arch_type: "x86"
11+
device_type: "gpu"
12+
job_type: "training"
13+
prod_image: "pytorch:2.12-cu130-amzn2023"
14+
15+
build:
16+
dockerfile: "docker/pytorch/Dockerfile.cuda"
17+
target: "runtime"
18+
python_version: "3.12"
19+
cuda_version: "13.0.2"
20+
torch_version: "2.12.1"
21+
torchvision_version: "0.27.1"
22+
torchaudio_version: "2.11.0"
23+
flash_attn_version: "2.8.3"
24+
deepspeed_version: "0.18.8"
25+
transformer_engine_version: "2.12.0"
26+
nccl_version: "2.26.2"
27+
efa_version: "1.47.0"
28+
gdrcopy_version: "2.4.4"
29+
max_jobs: "8"
30+
dlc_major_version: "1"
31+
dlc_minor_version: "0"
32+
33+
release:
34+
release: true
35+
force_release: false
36+
public_registry: true
37+
private_registry: true
38+
enable_soci: true
39+
environment: "production"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
image:
2+
name: "pytorch-2.12-sagemaker-cpu"
3+
description: "PyTorch 2.12 CPU training for SageMaker"
4+
5+
metadata:
6+
framework: "pytorch_runtime"
7+
framework_version: "2.12.1"
8+
os_version: "amzn2023"
9+
customer_type: "sagemaker"
10+
platform: "sagemaker"
11+
arch_type: "x86"
12+
device_type: "cpu"
13+
job_type: "training"
14+
prod_image: "pytorch:2.12-cpu-amzn2023-sagemaker"
15+
16+
build:
17+
dockerfile: "docker/pytorch/Dockerfile.cpu"
18+
target: "sagemaker"
19+
python_version: "3.12"
20+
torch_version: "2.12.1"
21+
torchvision_version: "0.27.1"
22+
torchaudio_version: "2.11.0"
23+
max_jobs: "8"
24+
dlc_major_version: "1"
25+
dlc_minor_version: "0"
26+
27+
release:
28+
release: true
29+
force_release: false
30+
public_registry: true
31+
private_registry: true
32+
enable_soci: true
33+
environment: "production"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
image:
2+
name: "pytorch-2.12-sagemaker-cuda"
3+
description: "PyTorch 2.12 CUDA training for SageMaker"
4+
5+
metadata:
6+
framework: "pytorch_runtime"
7+
framework_version: "2.12.1"
8+
os_version: "amzn2023"
9+
customer_type: "sagemaker"
10+
platform: "sagemaker"
11+
arch_type: "x86"
12+
device_type: "gpu"
13+
job_type: "training"
14+
prod_image: "pytorch:2.12-cu130-amzn2023-sagemaker"
15+
16+
build:
17+
dockerfile: "docker/pytorch/Dockerfile.cuda"
18+
target: "sagemaker"
19+
python_version: "3.12"
20+
cuda_version: "13.0.2"
21+
torch_version: "2.12.1"
22+
torchvision_version: "0.27.1"
23+
torchaudio_version: "2.11.0"
24+
flash_attn_version: "2.8.3"
25+
deepspeed_version: "0.18.8"
26+
transformer_engine_version: "2.12.0"
27+
nccl_version: "2.26.2"
28+
efa_version: "1.47.0"
29+
gdrcopy_version: "2.4.4"
30+
max_jobs: "8"
31+
dlc_major_version: "1"
32+
dlc_minor_version: "0"
33+
34+
release:
35+
release: true
36+
force_release: false
37+
public_registry: true
38+
private_registry: true
39+
enable_soci: true
40+
environment: "production"

.github/release-schedule.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,18 @@ schedules:
3737
workflow: vllm.autorelease-sagemaker-ubuntu.yml
3838
gpu: heavy
3939

40+
- cron: "00 22 * * 1,3"
41+
workflow: pytorch.autorelease-2.12-ec2.yml
42+
gpu: light
43+
4044
- cron: "30 22 * * 1,3"
4145
workflow: base.autorelease-cu130.yml
4246
gpu: minimal
4347

48+
- cron: "00 23 * * 1,3"
49+
workflow: pytorch.autorelease-2.12-sagemaker.yml
50+
gpu: light
51+
4452
# Tuesday / Thursday
4553
- cron: "00 16 * * 2,4"
4654
workflow: sglang.autorelease-ec2-amzn2023.yml
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "Auto Release - PyTorch 2.12 EC2"
2+
3+
on:
4+
schedule:
5+
- cron: '00 22 * * 1,3'
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}
10+
cancel-in-progress: false
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
discover:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
configs: ${{ steps.discover.outputs.configs }}
20+
steps:
21+
- uses: actions/checkout@v6
22+
- id: discover
23+
uses: ./.github/actions/discover-configs
24+
with:
25+
pattern: ".github/config/image/pytorch/2.12-ec2-*.yml"
26+
27+
pipeline:
28+
needs: [discover]
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
include: ${{ fromJson(needs.discover.outputs.configs) }}
33+
uses: ./.github/workflows/pytorch.pipeline.yml
34+
with:
35+
config-file: ${{ matrix.config_file }}
36+
tag-suffix: ${{ github.run_id }}
37+
run-multi-gpu-test: false
38+
run-multi-node-test: false
39+
release: true
40+
secrets: inherit

0 commit comments

Comments
 (0)