Update torch pin to 2.11 release candidate#18287
Conversation
Fix parakeet/voxtral realtime export using PyTorch release. In both `export_parakeet_tdt.py` and `export_voxtral_rt.py`, replaced the manual decomposition dictionary with `torch.export.default_decompositions()` and added the custom `_linear_bias_decomposition` for `torch.ops.aten.linear.default`.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18287
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Awaiting Approval, 1 New Failure, 9 Cancelled Jobs, 3 Unrelated FailuresAs of commit af00588 with merge base b1373e8 ( NEW FAILURE - The following job has failed:
CANCELLED JOBS - The following jobs were cancelled. Please retry:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
There was a problem hiding this comment.
Pull request overview
Updates the repository’s PyTorch integration toward the 2.11 release/RC line, adjusts dependency installation sources, and incorporates a ROCm-specific complex math workaround alongside export decomposition fixes for Metal-related flows.
Changes:
- Switch PyTorch install flows to use the PyTorch “test” wheel index and pin torch/vision/audio versions for that path.
- Update model export scripts (parakeet/voxtral realtime) to use
torch.export.default_decompositions()plus a custom linear-bias decomposition. - Add a HIP-specific
complex<float>powimplementation intended to mitigate a ROCm 7.2 numerical regression.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| torch_pin.py | Adjusts torch pin metadata (nightly pin no longer a live Python constant). |
| runtime/core/portable_type/c10/c10/util/complex_math.h | Adds HIP-specific pow specialization for complex<float> using FMA-based multiplication. |
| install_requirements.py | Moves install base URL to PyTorch “test” index and hardcodes torch/vision/audio versions for the “nightly” path. |
| exir/sym_util.py | Uses guarding_hint_or_throw when available, falling back to deprecated size_hint. |
| examples/models/voxtral_realtime/export_voxtral_rt.py | Uses default decompositions table with a custom linear decomposition override. |
| examples/models/parakeet/export_parakeet_tdt.py | Uses default decompositions table with a custom linear decomposition override. |
| .ci/scripts/utils.sh | Pins torchaudio/torchvision to release branches instead of commit-pin files. |
| .ci/scripts/test_wheel_package_qnn.sh | Switches torch install to PyTorch “test” index and removes NIGHTLY_VERSION usage. |
| .ci/docker/common/install_pytorch.sh | Pins torchaudio/torchvision to release branches in Docker build. |
| .ci/docker/ci_commit_pins/pytorch.txt | Changes PyTorch pin from a commit SHA to release/2.11. |
Comments suppressed due to low confidence (1)
install_requirements.py:28
- install_requirements.py still describes "nightly" behavior and references NIGHTLY_VERSION/hud.pytorch.org nightly pins, but the script now installs from the /whl/test index and no longer uses NIGHTLY_VERSION. Please update these top-of-file notes to match the new release/RC/test-index workflow so users don’t follow stale instructions.
# The pip repository that hosts nightly torch packages.
# This will be dynamically set based on CUDA availability and CUDA backend enabled/disabled.
TORCH_URL_BASE = "https://download.pytorch.org/whl/test"
# Since ExecuTorch often uses main-branch features of pytorch, only the nightly
# pip versions will have the required features.
#
# NOTE: If a newly-fetched version of the executorch repo changes the value of
# NIGHTLY_VERSION, you should re-run this script to install the necessary
# package versions.
#
# NOTE: If you're changing, make the corresponding change in .ci/docker/ci_commit_pins/pytorch.txt
# by picking the hash from the same date in
# https://hud.pytorch.org/hud/pytorch/pytorch/nightly/ @lint-ignore
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR temporarily shifts ExecuTorch’s PyTorch dependency strategy from a date-stamped nightly pin to a PyTorch 2.11 release-candidate/stable track (motivated by missing/broken nightly CUDA wheels), and updates a ROCm-specific complex math implementation to avoid a ROCm 7.2 regression.
Changes:
- Switch installation logic to use the PyTorch
whl/testindex and pintorch/torchvision/torchaudioto 2.11/0.26 versions. - Update CI/docker scripts to use
release/*refs for PyTorch domain libraries and set the PyTorch pin file torelease/2.11. - Add a HIP-specific
pow(complex<float>, complex<float>)specialization using an FMA-preserving multiply to mitigate ROCm 7.2 numerical regression.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
torch_pin.py |
Comments out NIGHTLY_VERSION to reflect temporary non-nightly pin. |
runtime/core/portable_type/c10/c10/util/complex_math.h |
Adds HIP specialization for complex pow to address ROCm regression. |
install_requirements.py |
Points installs at whl/test and hard-pins torch/domain versions. |
exir/sym_util.py |
Uses guarding_hint_or_throw when available, with fallback to deprecated size_hint. |
examples/models/voxtral_realtime/export_voxtral_rt.py |
Uses default_decompositions() table and overrides linear decomposition. |
examples/models/parakeet/export_parakeet_tdt.py |
Same decomposition-table approach for Metal export. |
.ci/scripts/utils.sh |
Pins audio/vision to release/* refs instead of commit pins. |
.ci/scripts/test_wheel_package_qnn.sh |
Stops composing nightly torch version; installs torch==${TORCH_VERSION} from whl/test (extra index). |
.ci/docker/common/install_pytorch.sh |
Pins audio/vision to release/* refs in Docker build. |
.ci/docker/ci_commit_pins/pytorch.txt |
Changes PyTorch pin from a SHA to release/2.11. |
Comments suppressed due to low confidence (1)
install_requirements.py:69
torch_urlis derived from the PyTorch wheel index (CPU/CUDA viadetermine_torch_url), but it’s passed via--extra-index-url. Now thattorch==2.11.0exists on PyPI, pip may prefer the PyPI (CPU) wheel over the CUDA wheel fromdownload.pytorch.org, and it also won’t reliably select a release-candidate from thewhl/testindex. To ensure the intended wheel is installed, prefer makingtorch_urlthe primary index (--index-url) for the torch/vision/audio installs (and keep PyPI as an extra index for other deps).
torch_url = determine_torch_url(TORCH_URL_BASE)
# pip packages needed by exir.
TORCH_PACKAGE = [
# Setting use_pytorch_nightly to false to test the pinned PyTorch commit. Note
# that we don't need to set any version number there because they have already
# been installed on CI before this step, so pip won't reinstall them
("torch==2.11.0" if use_pytorch_nightly else "torch"),
]
# Install the requirements for core ExecuTorch package.
# `--extra-index-url` tells pip to look for package
# versions on the provided URL if they aren't available on the default URL.
subprocess.run(
[
sys.executable,
"-m",
"pip",
"install",
"-r",
"requirements-dev.txt",
*TORCH_PACKAGE,
"--extra-index-url",
torch_url,
],
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| # The pip repository that hosts nightly torch packages. | ||
| # This will be dynamically set based on CUDA availability and CUDA backend enabled/disabled. | ||
| TORCH_NIGHTLY_URL_BASE = "https://download.pytorch.org/whl/nightly" | ||
| TORCH_URL_BASE = "https://download.pytorch.org/whl/test" | ||
|
|
||
| # Since ExecuTorch often uses main-branch features of pytorch, only the nightly | ||
| # pip versions will have the required features. |
| echo "=== [$LABEL] Install torch==${TORCH_VERSION} ===" | ||
|
|
||
| # Install torch based on the pinned PyTorch version, preferring the PyTorch test index | ||
| "$PIPBIN" install torch=="${TORCH_VERSION}" --extra-index-url "https://download.pytorch.org/whl/test" |
| @@ -1,2 +1,2 @@ | |||
| TORCH_VERSION = "2.11.0" | |||
| NIGHTLY_VERSION = "dev20260215" | |||
| # NIGHTLY_VERSION = "dev20260318" Temporarily pinning to stable release candidate. Revert https://github.com/pytorch/executorch/pull/18287 | |||
| @@ -1,2 +1,2 @@ | |||
| TORCH_VERSION = "2.11.0" | |||
| NIGHTLY_VERSION = "dev20260215" | |||
| # NIGHTLY_VERSION = "dev20260318" Temporarily pinning to stable release candidate. Revert https://github.com/pytorch/executorch/pull/18287 | |||
| @@ -1 +1 @@ | |||
| 659af3c353e49b35c191cdd2dba3b3c79d0e6822 | |||
| release/2.11 No newline at end of file | |||
| TORCHAUDIO_VERSION=release/2.11 | ||
| export TORCHAUDIO_VERSION | ||
| TORCHVISION_VERSION=$(cat .github/ci_commit_pins/vision.txt) | ||
| TORCHVISION_VERSION=release/0.26 | ||
| export TORCHVISION_VERSION |
| TORCHAUDIO_VERSION=release/2.11 | ||
| export TORCHAUDIO_VERSION | ||
| TORCHVISION_VERSION=$(cat .github/ci_commit_pins/vision.txt) | ||
| TORCHVISION_VERSION=release/0.26 | ||
| export TORCHVISION_VERSION |
| @@ -114,20 +108,12 @@ def install_requirements(use_pytorch_nightly): | |||
|
|
|||
| def install_optional_example_requirements(use_pytorch_nightly): | |||
| # Determine the appropriate PyTorch URL based on CUDA delegate status | |||
| torch_url = determine_torch_url(TORCH_NIGHTLY_URL_BASE) | |||
| torch_url = determine_torch_url(TORCH_URL_BASE) | |||
|
|
|||
| print("Installing torch domain libraries") | |||
| DOMAIN_LIBRARIES = [ | |||
| ( | |||
| f"torchvision==0.26.0.{NIGHTLY_VERSION}" | |||
| if use_pytorch_nightly | |||
| else "torchvision" | |||
| ), | |||
| ( | |||
| f"torchaudio==2.11.0.{NIGHTLY_VERSION}" | |||
| if use_pytorch_nightly | |||
| else "torchaudio" | |||
| ), | |||
| ("torchvision==0.26.0" if use_pytorch_nightly else "torchvision"), | |||
| ("torchaudio==2.11.0" if use_pytorch_nightly else "torchaudio"), | |||
| ] | |||
Trying to pin to nightly 3.18 but the some linux cuda wheels weren't successfully built last night.
#18187
Need to pin to stable release candidate due to time criticality.
Will need to revert this PR and pin normally to torch nightlies