Skip to content

[ROCm] Begin introducing Windows CI/dev build scripts - #160776

Closed
ScottTodd wants to merge 1 commit into
pytorch:mainfrom
ScottTodd:rocm-windows-scripts-4
Closed

ScottTodd wants to merge 1 commit into
pytorch:mainfrom
ScottTodd:rocm-windows-scripts-4

Conversation

@ScottTodd

@ScottTodd ScottTodd commented Aug 15, 2025 •

Copy link
Copy Markdown
Contributor

Progress on #159520.

This begins to set up build scripts and documentation for building PyTorch with ROCm support on Windows, using the (preview) ROCm Python packages published by https://github.com/ROCm/TheRock. The scripts have been adapted from existing downstream scripts at https://github.com/ROCm/TheRock/tree/main/external-builds/pytorch which have been producing torch wheels for about 1 month.

Notes:

  • .ci/pytorch/rocm_sdk-build.sh and .ci/pytorch/win-build.sh
  • tools/amd_build/build_windows.sh
    • I added this script to have a way to test something close to what a CI runner would do. I can't run build_pytorch.bat locally (without deeper changes) since it references hardcoded paths on Windows AMI runners.
  • tools/amd_build/write_rocm_init.py

I've tested the build scripts locally and sanity checked the wheels produced by a build. I have not tested them on any CI/CD runners yet. I expect I may want to fork an existing workflow and maybe extend .github/actions/setup-win/action.yml or .github/actions/setup-rocm/action.yml to handle installing the ROCm Python wheels. If new workflows will use AMD-provided build/test runners, I'll also need to figure out how to handle any differences in installed software and credentials (e.g. permissions for using cache servers, etc.).

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo @hongxiayang @naromero77amd

@ScottTodd
ScottTodd requested review from a team, jeffdaily and jithunnair-amd as code owners August 15, 2025 19:53
@pytorch-bot

pytorch-bot Bot commented Aug 15, 2025 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/160776

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 3b21411 with merge base 3650989 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot Bot added the module: rocm AMD GPU support for Pytorch label Aug 15, 2025
@ScottTodd

Copy link
Copy Markdown
Contributor Author

@pytorchbot label "topic: not user facing"

(yet!)

@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Aug 15, 2025
@zou3519 zou3519 added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Aug 19, 2025
Comment on lines +10 to +11
# TODO: add rocm[libraries]==ROCM_SDK_VERSION to PYTORCH_EXTRA_INSTALL_REQUIREMENTS?
# (perhaps with ~= or some other looser pin)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From https://github.com/ROCm/TheRock/blob/main/docs/packaging/python_packaging.md#configuring-your-python-project-dependencies, the recommended code pattern for this is

export PYTORCH_EXTRA_INSTALL_REQUIREMENTS="rocm[libraries]=={$(rocm-sdk version)}"

I'm not quite sure what we'll want for building/testing/releasing in this repository though. Downstream in https://github.com/ROCm/TheRock we host our own package index for each GPU family including rocm, torch, and torch's dependencies:

We don't yet include the rocm packages on PyTorch's index pages or PyPI. We could try with --extra-index-url in the short term for CI. Longer term I think we'll need to solve how to make the different GPU architecture families accessible without needing to manually specify a different index URL for each, perhaps with https://wheelnext.dev/.

Comment on lines +41 to +42
# TODO: enable GLOO somehow
export USE_GLOO=0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may be able to flip this option once pytorch/gloo#461 goes in.

@github-actions

Copy link
Copy Markdown
Contributor

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions Bot added the Stale label Oct 20, 2025
@ScottTodd
ScottTodd marked this pull request as draft November 3, 2025 23:01
@ScottTodd

Copy link
Copy Markdown
Contributor Author

Converting to a draft PR. This will still be useful in some form but I'll need to re-evaluate the approach a bit and then pick the work back up.

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

Labels

module: rocm AMD GPU support for Pytorch open source Stale topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants