Skip to content

Commit 487bacc

Browse files
committed
Re-add nvidia-cudnn-cu12 9.1.0.70 to the mirrored cudnn index
Add a RETAINED_WHEELS mechanism that re-injects wheels we still host but the upstream simple index has stopped publishing, and use it for nvidia-cudnn-cu12 9.1.0.70 on the nightly, test and prod channel roots. Injection is limited to the channel roots: manage_v2.py copies a root package index down into every accepted subdirectory for packages in its PACKAGE_LINKS_ALLOW_LIST, which includes nvidia-cudnn-cu12, so the CUDA targets inherit the link without their conserved indexes being re-mirrored.
1 parent a339e80 commit 487bacc

1 file changed

Lines changed: 65 additions & 1 deletion

File tree

s3_management/update_dependencies.py

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import re
33
import time
4-
from typing import Dict, List
4+
from typing import Dict, List, NamedTuple
55
from urllib.parse import urljoin
66

77
import boto3 # type: ignore[import-untyped]
@@ -919,6 +919,37 @@
919919
}
920920

921921

922+
class RetainedWheel(NamedTuple):
923+
filename: str
924+
url: str
925+
sha256: str
926+
927+
928+
# Wheels that download.pytorch.org still hosts but the upstream simple index has
929+
# stopped publishing, so mirroring alone drops them and pinned installs stop
930+
# resolving. Keyed by normalised package name.
931+
#
932+
# Only the channel root is injected: manage_v2.py copies a root package index
933+
# down into every accepted subdirectory for packages in its
934+
# PACKAGE_LINKS_ALLOW_LIST, so the CUDA targets inherit these links without
935+
# their conserved indexes being re-mirrored from upstream.
936+
RETAINED_WHEEL_PREFIXES = {"whl/nightly", "whl/test", "whl"}
937+
RETAINED_WHEELS: Dict[str, List[RetainedWheel]] = {
938+
"nvidia_cudnn_cu12": [
939+
# Pinned by every torch 2.4.0-2.6.0 build; removed from pypi.nvidia.com
940+
# around 2026-08-12. See pytorch/pytorch#193491.
941+
RetainedWheel(
942+
filename="nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl",
943+
url=(
944+
"https://download.pytorch.org/whl/cu124/"
945+
"nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl"
946+
),
947+
sha256="165764f44ef8c61fcdfdfdbe769d687e06374059fbb388b6c89ecb0e28793a6f",
948+
),
949+
],
950+
}
951+
952+
922953
def is_nvidia_package(pkg_name: str) -> bool:
923954
"""Check if a package is from NVIDIA and is therefore CUDA-target only"""
924955
return pkg_name.startswith("nvidia-") or pkg_name.startswith("cuda-")
@@ -1136,6 +1167,36 @@ def append_preview_numpy_wheels(html: str, pkg_name: str, prefix: str) -> str:
11361167
return f"{html}\n{block}\n"
11371168

11381169

1170+
def append_retained_wheels(html: str, pkg_name: str, prefix: str) -> str:
1171+
"""Merge :data:`RETAINED_WHEELS` links for *pkg_name* into *html*.
1172+
1173+
Limited to the channel roots in :data:`RETAINED_WHEEL_PREFIXES`. Wheels the
1174+
upstream index still lists are skipped, so this becomes a no-op if a version
1175+
is ever restored upstream.
1176+
"""
1177+
entries = RETAINED_WHEELS.get(normalize_pkg_name(pkg_name))
1178+
if not entries or prefix not in RETAINED_WHEEL_PREFIXES:
1179+
return html
1180+
1181+
additions = [
1182+
f' <a href="{entry.url}#sha256={entry.sha256}">{entry.filename}</a><br/>'
1183+
for entry in entries
1184+
if entry.filename not in html
1185+
]
1186+
1187+
if not additions:
1188+
return html
1189+
1190+
print(
1191+
f"INFO: Merging {len(additions)} retained wheel link(s) "
1192+
f"for {pkg_name} under {prefix}"
1193+
)
1194+
block = "\n".join(additions)
1195+
if "</body>" in html:
1196+
return html.replace("</body>", f"{block}\n </body>", 1)
1197+
return f"{html}\n{block}\n"
1198+
1199+
11391200
def upload_package_using_simple_index(
11401201
pkg_name: str,
11411202
prefix: str,
@@ -1168,6 +1229,9 @@ def upload_package_using_simple_index(
11681229
# published on the scientific-python nightly wheelhouse so pip can resolve them.
11691230
raw_html = append_preview_numpy_wheels(raw_html, pkg_name, prefix)
11701231

1232+
# Re-add wheels we still host that upstream has stopped publishing.
1233+
raw_html = append_retained_wheels(raw_html, pkg_name, prefix)
1234+
11711235
# Upload modified index.html with absolute links
11721236
upload_index_html(pkg_name, prefix, raw_html, source_url, dry_run=dry_run)
11731237

0 commit comments

Comments
 (0)