Skip to content

Commit 0cd5e78

Browse files
authored
Release 2.11 promotion script changes (#7868)
Release 2.11 promotion and validation script changes. 1. Advance release version to 2.11 2. Make CUDA 13.0 as stable 3. Modify r2 promotion step to promote file by file rather then download all and upload all.
1 parent da76fad commit 0cd5e78

12 files changed

Lines changed: 374 additions & 338 deletions

release/promote/common_utils.sh

Lines changed: 66 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -124,55 +124,84 @@ r2_promote() {
124124
tmp_dir=$(mktemp -d)
125125
trap "rm -rf ${tmp_dir}" RETURN
126126

127-
# Download matching files from S3 (using current OIDC credentials)
128-
echo "+ Downloading matching files from S3..."
129-
(
130-
set -x
131-
${AWS} s3 cp \
132-
--recursive \
133-
--exclude '*' \
134-
--include "*${package_name}-${pytorch_version}${PACKAGE_INCLUDE_SUFFIX:-*}" \
135-
"${PYTORCH_S3_FROM/\/$//}" \
136-
"${tmp_dir}/"
137-
)
138-
139-
# Switch to R2 credentials
140-
export AWS_ACCESS_KEY_ID="${R2_ACCESS_KEY_ID}"
141-
export AWS_SECRET_ACCESS_KEY="${R2_SECRET_ACCESS_KEY}"
142-
unset AWS_SESSION_TOKEN
143-
export AWS_DEFAULT_REGION="auto"
127+
# List matching files from S3 first (using current OIDC credentials)
128+
echo "+ Listing matching files from S3..."
129+
local s3_from_path="${PYTORCH_S3_FROM/\/$//}"
130+
local file_list="${tmp_dir}/file_list.txt"
131+
${AWS} s3 ls "${s3_from_path}/" --recursive \
132+
| grep "${package_name}-${pytorch_version}${PACKAGE_INCLUDE_SUFFIX:-}" \
133+
| awk '{print $NF}' > "${file_list}" || true
134+
135+
local total_files
136+
total_files=$(wc -l < "${file_list}")
137+
echo "+ Found ${total_files} files to promote to R2"
138+
139+
if [[ ${total_files} -eq 0 ]]; then
140+
echo "+ No matching files found, skipping R2 promotion"
141+
return 0
142+
fi
144143

145-
# Upload each file to R2 with sha256 metadata
146-
echo "+ Uploading files to R2..."
147-
local file_count=0
148-
for pkg in "${tmp_dir}"/*; do
149-
if [[ ! -f "${pkg}" ]]; then
150-
continue
144+
# Helper to restore S3 credentials
145+
_restore_s3_creds() {
146+
export AWS_ACCESS_KEY_ID="${saved_aws_access_key_id}"
147+
export AWS_SECRET_ACCESS_KEY="${saved_aws_secret_access_key}"
148+
if [[ -n "${saved_aws_session_token}" ]]; then
149+
export AWS_SESSION_TOKEN="${saved_aws_session_token}"
150+
else
151+
unset AWS_SESSION_TOKEN 2>/dev/null || true
151152
fi
153+
if [[ -n "${saved_aws_default_region}" ]]; then
154+
export AWS_DEFAULT_REGION="${saved_aws_default_region}"
155+
else
156+
unset AWS_DEFAULT_REGION 2>/dev/null || true
157+
fi
158+
}
159+
160+
# Helper to switch to R2 credentials
161+
_set_r2_creds() {
162+
export AWS_ACCESS_KEY_ID="${R2_ACCESS_KEY_ID}"
163+
export AWS_SECRET_ACCESS_KEY="${R2_SECRET_ACCESS_KEY}"
164+
unset AWS_SESSION_TOKEN 2>/dev/null || true
165+
export AWS_DEFAULT_REGION="auto"
166+
}
167+
168+
# Download and upload files one at a time to avoid running out of disk space
169+
echo "+ Downloading and uploading files to R2 one by one..."
170+
local file_count=0
171+
while IFS= read -r s3_key; do
152172
local filename
153-
filename=$(basename "${pkg}")
173+
filename=$(basename "${s3_key}")
174+
local local_file="${tmp_dir}/${filename}"
175+
176+
# Download single file from S3 (using S3 credentials)
177+
_restore_s3_creds
178+
(
179+
set -x
180+
${AWS} s3 cp "${PYTORCH_S3_BUCKET}/${s3_key}" "${local_file}"
181+
)
182+
183+
# Compute sha256 checksum
154184
local sha256
155-
sha256=$(sha256sum "${pkg}" | awk '{print $1}')
185+
sha256=$(sha256sum "${local_file}" | awk '{print $1}')
186+
187+
# Upload to R2
188+
_set_r2_creds
156189
(
157190
set -x
158-
${AWS} s3 cp "${pkg}" "${r2_dest/\/$//}/${filename}" \
191+
${AWS} s3 cp "${local_file}" "${r2_dest/\/$//}/${filename}" \
159192
--metadata "checksum-sha256=${sha256}" \
160193
--endpoint-url "${R2_ENDPOINT_URL}"
161194
)
195+
196+
# Remove local file to free disk space
197+
rm -f "${local_file}"
198+
162199
file_count=$((file_count + 1))
163-
done
200+
echo "+ Progress: ${file_count}/${total_files} files uploaded"
201+
done < "${file_list}"
164202

165203
echo "+ Uploaded ${file_count} files to R2"
166204

167205
# Restore original AWS credentials
168-
export AWS_ACCESS_KEY_ID="${saved_aws_access_key_id}"
169-
export AWS_SECRET_ACCESS_KEY="${saved_aws_secret_access_key}"
170-
if [[ -n "${saved_aws_session_token}" ]]; then
171-
export AWS_SESSION_TOKEN="${saved_aws_session_token}"
172-
fi
173-
if [[ -n "${saved_aws_default_region}" ]]; then
174-
export AWS_DEFAULT_REGION="${saved_aws_default_region}"
175-
else
176-
unset AWS_DEFAULT_REGION
177-
fi
206+
_restore_s3_creds
178207
}

release/promote/s3_to_s3.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ PYTORCH_S3_FROM=${PYTORCH_S3_FROM:-${PYTORCH_S3_BUCKET}/${PACKAGE_TYPE}/${FROM}}
1616
TO=${TO:-}
1717
PYTORCH_S3_TO=${PYTORCH_S3_TO:-${PYTORCH_S3_BUCKET}/${PACKAGE_TYPE}/${TO}}
1818

19-
aws_promote "${PACKAGE_NAME}"
19+
# R2_ONLY: set to "true" to skip S3-to-S3 copy and only promote to R2
20+
R2_ONLY=${R2_ONLY:-false}
21+
22+
if [[ "${R2_ONLY}" != "true" ]]; then
23+
aws_promote "${PACKAGE_NAME}"
24+
else
25+
echo "+ R2_ONLY=true, skipping S3-to-S3 promotion"
26+
fi
2027

2128
# Also promote to R2 (Cloudflare) if credentials are available
2229
r2_promote "${PACKAGE_NAME}"

release/pypi/promote_pypi_to_staging.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ upload_pypi_to_staging() {
2121
}
2222

2323
# Uncomment these to promote to pypi
24-
LINUX_VERSION_SUFFIX="%2Bcu126"
24+
LINUX_VERSION_SUFFIX="%2Bcu130"
2525
CPU_VERSION_SUFFIX="%2Bcpu"
2626
MACOS_ARM64="macosx_.*_arm64"
2727

28-
PLATFORM="manylinux_2_28_x86_64" VERSION_SUFFIX="${LINUX_VERSION_SUFFIX}" ARCH="cu126" upload_pypi_to_staging torch "${PYTORCH_VERSION}"
29-
PLATFORM="manylinux_2_28_aarch64" VERSION_SUFFIX="${CPU_VERSION_SUFFIX}" upload_pypi_to_staging torch "${PYTORCH_VERSION}"
28+
PLATFORM="manylinux_2_28_x86_64" VERSION_SUFFIX="${LINUX_VERSION_SUFFIX}" ARCH="cu130" upload_pypi_to_staging torch "${PYTORCH_VERSION}"
29+
PLATFORM="manylinux_2_28_aarch64" VERSION_SUFFIX="${LINUX_VERSION_SUFFIX}" ARCH="cu130" upload_pypi_to_staging torch "${PYTORCH_VERSION}"
3030
PLATFORM="win_amd64" VERSION_SUFFIX="${CPU_VERSION_SUFFIX}" upload_pypi_to_staging torch "${PYTORCH_VERSION}"
3131
PLATFORM="${MACOS_ARM64}" VERSION_SUFFIX="" upload_pypi_to_staging torch "${PYTORCH_VERSION}"
3232

33-
PLATFORM="manylinux_2_28_x86_64" VERSION_SUFFIX="${LINUX_VERSION_SUFFIX}" ARCH="cu126" upload_pypi_to_staging torchvision "${TORCHVISION_VERSION}"
34-
PLATFORM="manylinux_2_28_aarch64" VERSION_SUFFIX="" upload_pypi_to_staging torchvision "${TORCHVISION_VERSION}"
33+
PLATFORM="manylinux_2_28_x86_64" VERSION_SUFFIX="${LINUX_VERSION_SUFFIX}" ARCH="cu130" upload_pypi_to_staging torchvision "${TORCHVISION_VERSION}"
34+
PLATFORM="manylinux_2_28_aarch64" VERSION_SUFFIX="${LINUX_VERSION_SUFFIX}" ARCH="cu130" upload_pypi_to_staging torchvision "${TORCHVISION_VERSION}"
3535
PLATFORM="win_amd64" VERSION_SUFFIX="${CPU_VERSION_SUFFIX}" upload_pypi_to_staging torchvision "${TORCHVISION_VERSION}"
3636
PLATFORM="${MACOS_ARM64}" VERSION_SUFFIX="" upload_pypi_to_staging torchvision "${TORCHVISION_VERSION}"
3737

38-
PLATFORM="manylinux_2_28_x86_64" VERSION_SUFFIX="${LINUX_VERSION_SUFFIX}" ARCH="cu126" upload_pypi_to_staging torchaudio "${TORCHAUDIO_VERSION}"
39-
PLATFORM="manylinux_2_28_aarch64" VERSION_SUFFIX="" upload_pypi_to_staging torchaudio "${TORCHAUDIO_VERSION}"
38+
PLATFORM="manylinux_2_28_x86_64" VERSION_SUFFIX="${LINUX_VERSION_SUFFIX}" ARCH="cu130" upload_pypi_to_staging torchaudio "${TORCHAUDIO_VERSION}"
39+
PLATFORM="manylinux_2_28_aarch64" VERSION_SUFFIX="${LINUX_VERSION_SUFFIX}" ARCH="cu130" upload_pypi_to_staging torchaudio "${TORCHAUDIO_VERSION}"
4040
PLATFORM="win_amd64" VERSION_SUFFIX="${CPU_VERSION_SUFFIX}" upload_pypi_to_staging torchaudio "${TORCHAUDIO_VERSION}"
4141
PLATFORM="${MACOS_ARM64}" VERSION_SUFFIX="" upload_pypi_to_staging torchaudio "${TORCHAUDIO_VERSION}"
4242

release/release_versions.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env bash
22

33
# Make sure to update these versions when doing a release first
4-
PYTORCH_VERSION=${PYTORCH_VERSION:-2.7.0}
5-
TORCHVISION_VERSION=${TORCHVISION_VERSION:-0.24.0}
6-
TORCHAUDIO_VERSION=${TORCHAUDIO_VERSION:-2.9.0}
4+
PYTORCH_VERSION=${PYTORCH_VERSION:-2.11.0}
5+
TORCHVISION_VERSION=${TORCHVISION_VERSION:-0.26.0}
6+
TORCHAUDIO_VERSION=${TORCHAUDIO_VERSION:-2.11.0}
77
TORCHCODEC_VERSION=${TORCHCODEC_VERSION:-0.11.0}
88
TORCHCOMMS_VERSION=${TORCHCOMMS_VERSION:-0.1.0}
99
TRITON_VERSION=${TRITON_VERSION:-3.3.0}

tools/scripts/generate_binary_build_matrix.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
ROCM_ARCHES_DICT = {
4444
"nightly": ["7.1", "7.2"],
4545
"test": ["7.1", "7.2"],
46-
"release": ["7.0", "7.1"],
46+
"release": ["7.1", "7.2"],
4747
}
4848

4949
CUDA_CUDNN_VERSIONS = {
@@ -56,7 +56,7 @@
5656
STABLE_CUDA_VERSIONS = {
5757
"nightly": "13.0",
5858
"test": "13.0",
59-
"release": "12.8",
59+
"release": "13.0",
6060
}
6161

6262
CUDA_AARCH64_ARCHES = ["12.6-aarch64", "12.8-aarch64", "13.0-aarch64"]
@@ -86,7 +86,7 @@
8686

8787
CURRENT_NIGHTLY_VERSION = "2.12.0"
8888
CURRENT_CANDIDATE_VERSION = "2.11.0"
89-
CURRENT_STABLE_VERSION = "2.10.0"
89+
CURRENT_STABLE_VERSION = "2.11.0"
9090
CURRENT_VERSION = CURRENT_STABLE_VERSION
9191

9292
# By default use Nightly for CUDA arches

0 commit comments

Comments
 (0)