@@ -63,12 +63,14 @@ jobs:
6363 chmod +x "${RUNNER_TEMP}/bin/bazel"
6464 export PATH="${RUNNER_TEMP}/bin:${PATH}"
6565
66- # ExecuTorch's CUDA wheels live only on the PyTorch nightly index, so the channel is
67- # needed. No --pre: a specifier naming a prerelease admits prereleases by itself, and
68- # --pre would apply to every other requirement in the same command too. The version
69- # comes from the requirement file so a bump changes no file in this directory.
66+ # ExecuTorch's CUDA wheels live only on the PyTorch indexes: a development build on the
67+ # nightly one, a release on the test one. No --pre: a specifier naming a prerelease admits
68+ # prereleases by itself, and --pre would apply to every other requirement in the same
69+ # command too. The version comes from the requirement file so a bump changes no file in
70+ # this directory.
7071 python -m pip install pyyaml "wheel>=0.40" \
7172 --extra-index-url "https://download.pytorch.org/whl/nightly/${CU_VERSION}" \
73+ --extra-index-url "https://download.pytorch.org/whl/test/${CU_VERSION}" \
7274 -r packaging/executorch_pin.txt
7375
7476 # The shared artifact carries the matching core and companion wheels.
@@ -108,31 +110,42 @@ jobs:
108110 # Resolve the user-facing range without reusing the build's installed pin.
109111 python -m venv "${RUNNER_TEMP}/range-check-venv"
110112 # pin-check: range-ok
111- "${RUNNER_TEMP}/range-check-venv/bin/python" -m pip install --no-deps --extra-index-url "https://download.pytorch.org/whl/nightly/${CU_VERSION}" -r packaging/executorch_range.txt
113+ "${RUNNER_TEMP}/range-check-venv/bin/python" -m pip install --no-deps --extra-index-url "https://download.pytorch.org/whl/nightly/${CU_VERSION}" --extra-index-url "https://download.pytorch.org/whl/test/${CU_VERSION}" - r packaging/executorch_range.txt
112114
113115 # pip does not fail when an extra cannot be satisfied; it quietly picks an older
114- # torch-tensorrt. So check here that the main wheel's executorch extra requires exactly the
115- # companion built beside it, and that pip resolves that extra for the version just built.
116+ # torch-tensorrt. So check here that the executorch extra requires exactly the companion
117+ # built beside it when this run's channel also carries the ExecuTorch build that companion
118+ # pins (nightly for a development build, test for a release), that it requires none
119+ # otherwise, and that pip resolves that extra for the version just built.
116120 python - <<'PY'
117121 import importlib.metadata as metadata
122+ import os
118123 import sys
119124
120125 from packaging.requirements import Requirement
121126
122127 companion = metadata.version("torch-tensorrt-executorch-runtime")
128+ (executorch,) = [
129+ r
130+ for r in map(Requirement, metadata.requires("torch-tensorrt-executorch-runtime") or [])
131+ if r.name == "executorch"
132+ ]
133+ executorch_channel = "nightly" if ".dev" in str(executorch.specifier) else "test"
123134 pins = [
124135 r
125136 for r in map(Requirement, metadata.requires("torch-tensorrt") or [])
126137 if r.name == "torch-tensorrt-executorch-runtime"
127138 and r.marker is not None
128139 and r.marker.evaluate({"extra": "executorch"})
129140 ]
130- if [str(r.specifier) for r in pins] != [f"=={companion}"]:
131- sys.exit(f"the executorch extra requires {pins}, not the companion built beside it ({companion})")
141+ expected = [f"=={companion}"] if os.environ["CHANNEL"] == executorch_channel else []
142+ if [str(r.specifier) for r in pins] != expected:
143+ sys.exit(f"the executorch extra requires {pins}, not {expected} (companion {companion}, channel {os.environ['CHANNEL']}, {executorch})")
132144 PY
133145 built="$(python -c 'import importlib.metadata as m; print(m.version("torch-tensorrt"))')"
134146 python -m pip install --pre --dry-run --find-links /opt/torch-tensorrt-builds \
135147 --extra-index-url "https://download.pytorch.org/whl/nightly/${CU_VERSION}" \
148+ --extra-index-url "https://download.pytorch.org/whl/test/${CU_VERSION}" \
136149 --extra-index-url https://pypi.nvidia.com \
137150 "torch-tensorrt[executorch]==${built}"
138151
0 commit comments