Skip to content

[release/2.12] Pin torchaudio to ROCm/audio release/2.11.0.1#3382

Draft
ethanwee1 wants to merge 8 commits into
release/2.12from
ew/rocm-24803-pin-torchaudio-2.11
Draft

[release/2.12] Pin torchaudio to ROCm/audio release/2.11.0.1#3382
ethanwee1 wants to merge 8 commits into
release/2.12from
ew/rocm-24803-pin-torchaudio-2.11

Conversation

@ethanwee1

@ethanwee1 ethanwee1 commented Jun 30, 2026

Copy link
Copy Markdown

https://amd-hub.atlassian.net/browse/ROCM-24803?focusedCommentId=500051

Paired with torchaudio HIP-port PR: ROCm/audio#17 (HIPIFY in extension.py).

Changes (this PR)

  1. Pin torchaudio in related_commits to ethanwee1/audio ew/rocm-24803-hipify-gpu-ext @ 0c7509ef (Build libtorchaudio GPU extensions on ROCm via HIPIFY (torchvision-style) audio#17). Repoint to merged ROCm/audio release/2.11.0.1 once After discussion in review, disable flake8 on pyHIPIFY for now. #17 lands.
  2. Fix Windows cross-drive HIPIFY failure in torch/utils/cpp_extension.py (CUDAExtension): realpath-normalize build dir and hipified sources before os.path.relpath(). This fix is in PyTorch only — it complements the torchaudio-side hipify in After discussion in review, disable flake8 on pyHIPIFY for now. #17.

Companion PR

Test builds (Windows, gfx110X-all)

Run Approach Result
https://github.com/ROCm/TheRock/actions/runs/28529085509 compat shim (superseded) Passed
https://github.com/ROCm/TheRock/actions/runs/28538325024 HIPIFY v1 (bad guards + includes) Failed
(pending) HIPIFY v2 (0c7509ef) + this PR

@ethanwee1

Copy link
Copy Markdown
Author

TheRock test build (Windows, gfx110X-all) for this torchaudio pin:
https://github.com/ROCm/TheRock/actions/runs/28466063021

Inputs:

  • workflow: Multi-Arch Build Windows PyTorch Wheels
  • pytorch_git_ref: ew/rocm-24803-pin-torchaudio-2.11 (this branch on ROCm/pytorch)
  • amdgpu_families: gfx110X-all
  • python_version: 3.12
  • rocm_version: 7.14.0.dev0+331251018497de4049c7d8447c7b2d1dcdfd012e

Verifies torchaudio resolves from ROCm/audio release/2.11.0.1 (commit b83203e8, version 2.11.0.1) and builds/sanity-checks a wheel.

@rocm-repo-management-api

rocm-repo-management-api Bot commented Jun 30, 2026

Copy link
Copy Markdown

Jenkins build for 397caab617f3b3beb91836468259cc663e1210b9 commit finished as NOT_BUILT
Links: Pipeline Overview / Build artifacts / Test Results

When building HIP extensions (e.g. torchaudio) on Windows where the
source checkout lives on a subst/virtual drive (B:) that aliases a
directory on the real drive (C:), os.path.relpath() raised
"path is on mount 'C:', start on mount 'B:'" because os.getcwd()
reported the alias while the hipified source resolved to the underlying
drive. Normalize both the build dir and the hipified source through
os.path.realpath() before computing the relative path.
@ethanwee1

Copy link
Copy Markdown
Author

This PR now contains two commits:

  1. Pin torchaudio to ROCm/audio release/2.11.0.1 (validated: builds version 2.11.0.1+devrocm...).
  2. Fix Windows cross-drive HIPIFY failure in torch/utils/cpp_extension.py (CUDAExtension), which blocked the torchaudio wheel build on runners where the checkout is on a subst'd B: drive aliasing C: (ValueError: path is on mount 'C:', start on mount 'B:').

New TheRock test build (Windows, gfx110X-all) with both changes:
https://github.com/ROCm/TheRock/actions/runs/28474577213

Previous build (pin only, failed on the cross-drive bug now fixed): https://github.com/ROCm/TheRock/actions/runs/28466063021

@rocm-repo-management-api

rocm-repo-management-api Bot commented Jun 30, 2026

Copy link
Copy Markdown

Jenkins build for 212d846a9952acce94eefcb7b3bcf9a69225e841 commit finished as NOT_BUILT
Links: Pipeline Overview / Build artifacts / Test Results

@ethanwee1

Copy link
Copy Markdown
Author

Build status update

TheRock test build (Windows, gfx110X-all): https://github.com/ROCm/TheRock/actions/runs/28474577213FAILED (in the torchaudio compile), but it got materially further than the prior run.

Changes in this PR (3 commits) and what each achieved:

  1. Pin torchaudio to ROCm/audio release/2.11.0.1 (commit b83203e8) in related_commits — resolves + builds version 2.11.0.1+devrocm... (final release, not the pip-skipped 2.11.0a0 from main). ✅ validated by the build.
  2. Fix Windows cross-drive HIPIFY failure in torch/utils/cpp_extension.py (CUDAExtension) — realpath-normalize the build dir and hipified source before os.path.relpath, so a subst'd B: drive that aliases C: no longer throws ValueError: path is on mount 'C:', start on mount 'B:'. ✅ validated: the new build had zero cross-drive errors and torchaudio actually started compiling (the log even reveals the real path C:\<GUID>\src\pytorch_audio, confirming B: was a subst alias).

Why the build still fails (out of scope for this PR):
torchaudio's rnnt/forced_align GPU extensions on release/2.11.0.1 are CUDA-only and not ported to ROCm. First error:

src/libtorchaudio/cuda_utils.h:3:10: fatal error: 'cuda_runtime_api.h' file not found

This is not a one-line header fix — behind it, rnnt/gpu/gpu_transducer.h and the GPU kernel headers (math.cuh, gpu_kernel_utils.cuh, gpu_kernels.cuh) are entirely wrapped in #ifdef USE_CUDA (empty on ROCm), and macros.h/options.h gate their CUDA includes/device macros on USE_CUDA rather than USE_ROCM, while extension.py still adds the .cu GPU sources for USE_ROCM. Making torchaudio's GPU ops build on ROCm/Windows is a HIP porting effort across many kernel files (and needs GPU testing).

Disposition: the GPU port is being handed to the torchaudio/audio team. This PR stands on its own as (1) the correct torchaudio version pin and (2) a general Windows cross-drive HIPIFY fix, both build-validated up to the torchaudio ROCm GPU-port gap.

Temporarily points torchaudio at the ROCm/audio#16 HIP-port commit
(ethanwee1/audio fork) so TheRock can build/validate it. Repoint to the
merged ROCm/audio release/2.11.0.1 commit once ROCm/audio#16 lands.
@rocm-repo-management-api

rocm-repo-management-api Bot commented Jul 1, 2026

Copy link
Copy Markdown

Jenkins build for 212d846a9952acce94eefcb7b3bcf9a69225e841 commit finished as FAILURE
Links: Pipeline Overview / Build artifacts / Test Results

@rocm-repo-management-api

rocm-repo-management-api Bot commented Jul 1, 2026

Copy link
Copy Markdown

Jenkins build for 74bce3687d4eacf122f181b438885d907a49c1cb commit finished as NOT_BUILT
Links: Pipeline Overview / Build artifacts / Test Results

jithunnair-amd pushed a commit that referenced this pull request Jul 1, 2026
https://amd-hub.atlassian.net/browse/ROCM-24803?focusedCommentId=500051

Interim unblock: pins torchaudio to the stable release/2.11 (2.11.0),
which already builds and publishes on Windows, replacing the floating
pytorch/audio main (2.11.0a0) pin.

The torchaudio 2.11.0.1 ROCm GPU port is tracked separately in
#3382 and ROCm/audio#16.
@ethanwee1

Copy link
Copy Markdown
Author

Reworked to the HIPIFY-based torchaudio port (ROCm/audio#17, mirrors torchvision) instead of the manual compat shim. New build: https://github.com/ROCm/TheRock/actions/runs/28538325024

@rocm-repo-management-api

rocm-repo-management-api Bot commented Jul 1, 2026

Copy link
Copy Markdown

Jenkins build for 74bce3687d4eacf122f181b438885d907a49c1cb commit finished as FAILURE
Links: Pipeline Overview / Build artifacts / Test Results

…io#16)

Revert the temporary HIPIFY-based pin (ROCm/audio#17) back to the
compat-shim port commit that passed TheRock Windows validation
(28529085509). The HIPIFY setup.py approach still leaves CUDA headers
unconverted; the cuda_compat.h port in ROCm/audio#16 is the validated path.

The Windows cross-drive HIPIFY fix remains in torch/utils/cpp_extension.py
(this PR); it is unrelated to the audio-side port strategy.
@ethanwee1

Copy link
Copy Markdown
Author

Repointed related_commits back to the validated compat-shim port (ROCm/audio#16 @ a890448a on ew/rocm-24803-hip-port-gpu-ext). Closed ROCm/audio#17 (HIPIFY setup.py experiment).

Where the HIPIFY fixes live:

Prior passing TheRock run with this pin combo: https://github.com/ROCm/TheRock/actions/runs/28529085509

ethanwee1 added a commit to ethanwee1/audio that referenced this pull request Jul 6, 2026
…yle)

Mirror torchvision's setup.py approach: run hipify_python.hipify() over
libtorchaudio CUDA sources and headers, then compile the generated .hip
outputs.

Fixes vs the first HIPIFY attempt (TheRock 28538325024):

1. Do not widen `#ifdef USE_CUDA` to `USE_ROCM` in headers — that pulled
   `cuda_fp16.h` into CPU `.cpp` compiles because PyTorch defines USE_ROCM
   globally on ROCm extension builds. Keep upstream USE_CUDA guards; pass
   `-DUSE_CUDA` on hipcc/nvcc only for GPU translation units.
2. Hipify with `os.path.realpath()` paths and depth-aware include globs so
   headers like `cuda_utils.h` are rewritten on the same inode Windows runners
   use when B: is a subst alias of the C: checkout (otherwise the compiler
   reads un-hipified headers from the underlying path).
3. Include `cuctc/` in the hipify scope.

Reference: https://github.com/ROCm/vision/blob/release/0.27/setup.py

Paired with ROCm/pytorch#3382 (torchaudio pin + Windows cross-drive HIPIFY fix
in torch/utils/cpp_extension.py — that fix is in PyTorch, not here).
Update ethanwee1/audio ew/rocm-24803-hipify-gpu-ext to 0c7509ef with:
- realpath-based hipify (Windows B:/C: alias)
- reverted USE_ROCM header guard widening
- -DUSE_CUDA on hipcc for GPU units only
@ethanwee1

Copy link
Copy Markdown
Author

Pin updated to audio HIPIFY v2 0c7509ef. Windows cross-drive fix remains in this PR's cpp_extension.py; torchaudio GPU port is HIPIFY-only in ROCm/audio#17.

@rocm-repo-management-api

rocm-repo-management-api Bot commented Jul 6, 2026

Copy link
Copy Markdown

Jenkins build for 20ed9fc17d7e46e02019b8f652ca8037fcac073e commit finished as FAILURE
Links: Pipeline Overview / Build artifacts / Test Results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant