Skip to content

Commit 312c3b2

Browse files
authored
[torch] Enable torchvision in Windows releases. (#1190)
Progress on #910. Tested at https://github.com/ROCm/TheRock/actions/runs/16728414496/job/47354811134. I'm still having trouble building locally though.
1 parent 6677e3d commit 312c3b2

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.github/workflows/build_windows_pytorch_wheels.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ jobs:
105105
python ./external-builds/pytorch/pytorch_audio_repo.py checkout \
106106
--repo ${{ env.CHECKOUT_ROOT }}/audio \
107107
--repo-hashtag main
108-
# TODO(#910): Support torchvision on Windows
109-
# python ./external-builds/pytorch/pytorch_vision_repo.py checkout
108+
python ./external-builds/pytorch/pytorch_vision_repo.py checkout \
109+
--repo ${{ env.CHECKOUT_ROOT }}/vision \
110+
--repo-hashtag main
110111
111112
- name: Determine optional arguments passed to `build_prod_wheels.py`
112113
if: ${{ inputs.rocm_version }}
@@ -128,6 +129,7 @@ jobs:
128129
--index-url "${{ inputs.cloudfront_url }}/${{ inputs.amdgpu_family }}/" ^
129130
--pytorch-dir ${{ env.CHECKOUT_ROOT }}/torch ^
130131
--pytorch-audio-dir ${{ env.CHECKOUT_ROOT }}/audio ^
132+
--pytorch-vision-dir ${{ env.CHECKOUT_ROOT }}/vision ^
131133
--clean ^
132134
--output-dir ${{ env.PACKAGE_DIST_DIR }} ^
133135
${{ env.optional_build_prod_arguments }}

external-builds/pytorch/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ patches locally until they can be upstreamed. See the
2525
| ------------------------ | ------------- | --------------------------------------------------------------------- |
2626
| PyTorch | ✅ Supported | ✅ Supported |
2727
| torchaudio | ✅ Supported | ✅ Supported |
28-
| torchvision | ✅ Supported | 🟡 In progress ([#910](https://github.com/ROCm/TheRock/issues/910)) |
28+
| torchvision | ✅ Supported | ✅ Supported |
2929
| Flash attention (Triton) | ✅ Supported | 🟡 In progress ([#1040](https://github.com/ROCm/TheRock/issues/1040)) |
3030

3131
## Build instructions
@@ -79,7 +79,7 @@ Now checkout repositories:
7979
```bash
8080
python pytorch_torch_repo.py checkout --repo C:/b/pytorch --repo-hashtag main
8181
python pytorch_audio_repo.py checkout --repo C:/b/audio --repo-hashtag main
82-
# TODO(#910): Support torchvision on Windows
82+
python pytorch_vision_repo.py checkout --repo C:/b/vision --repo-hashtag main
8383
```
8484

8585
Now note the gfx target you want to build for and then...
@@ -107,6 +107,7 @@ mix/match build steps.
107107
--install-rocm --index-url https://d2awnip2yjpvqn.cloudfront.net/v2/gfx110X-dgpu/ \
108108
--pytorch-dir C:/b/pytorch \
109109
--pytorch-audio-dir C:/b/audio \
110+
--pytorch-vision-dir C:/b/vision \
110111
--output-dir %HOME%/tmp/pyout
111112
```
112113

external-builds/pytorch/build_prod_wheels.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,13 @@ def do_build_pytorch_vision(
710710
}
711711
)
712712

713+
if is_windows:
714+
env.update(
715+
{
716+
"DISTUTILS_USE_SDK": "1",
717+
}
718+
)
719+
713720
remove_dir_if_exists(pytorch_vision_dir / "dist")
714721
if args.clean:
715722
remove_dir_if_exists(pytorch_vision_dir / "build")

0 commit comments

Comments
 (0)