Skip to content

[CI] Fix windows-arm64-build-test by porting #179024 fixes to .ps1 script - #182647

Closed
ezyang wants to merge 8 commits into
gh/ezyang/3311/basefrom
gh/ezyang/3311/head
Closed

ezyang wants to merge 8 commits into
gh/ezyang/3311/basefrom
gh/ezyang/3311/head

Conversation

@ezyang

@ezyang ezyang commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

The windows-arm64-build-test job has been persistently red on trunk
because the per-commit build script (.ps1) was missed when #179024
fixed the nightly build script (.bat).

Set INSTALL_TEST=0 so aoti_custom_ops.dll (test-only) is not installed
into the wheel -- on Windows, LoadLibraryExW eagerly resolves all DLL
dependencies, so loading this test DLL at import-torch time fails.

Fix the libuv copy path from lib\Release\uv.dll to bin\uv.dll to match
where cmake actually installs it.

Explicitly initialize AutogradState bit fields in the constructor to
work around an MSVC bug where default member initializers for bit
fields are silently ignored.

Authored by Claude.

[ghstack-poisoned]
@ezyang
ezyang requested a review from a team as a code owner May 6, 2026 14:09
@pytorch-bot

pytorch-bot Bot commented May 6, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ No Failures

As of commit 563210d with merge base 8dac83d (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 commented May 6, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@ezyang ezyang added mergedog mergedog is watching this PR ciflow/win-arm64 Trigger Windows Arm64 CI Workflows topic: not user facing topic category labels May 6, 2026
@ezyang

ezyang commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 6, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Failing job: windows-arm64-build-test / test
Error:
  RuntimeError: Platform tag mismatch in
  torch-2.13.0a0+git6f3db69-cp312-cp312-win_arm64.whl: got 'win_arm64',
  expected pattern matching '^win_amd64$' for TARGET_OS=win32

The build now succeeds and produces a win_arm64 wheel, but
check_wheel_tags.py only had entries for win32/windows expecting
win_amd64. Added a windows-arm64 entry mirroring the linux-aarch64
override that detects the arch via platform.machine() when TARGET_OS
is unset/win32.

Authored by Claude.

[ghstack-poisoned]
ezyang added a commit that referenced this pull request May 6, 2026
…ript

The windows-arm64-build-test job has been persistently red on trunk
because the per-commit build script (.ps1) was missed when #179024
fixed the nightly build script (.bat).

Set INSTALL_TEST=0 so aoti_custom_ops.dll (test-only) is not installed
into the wheel -- on Windows, LoadLibraryExW eagerly resolves all DLL
dependencies, so loading this test DLL at import-torch time fails.

Fix the libuv copy path from lib\Release\uv.dll to bin\uv.dll to match
where cmake actually installs it.

Authored by Claude.

ghstack-source-id: d7126ab
Pull-Request: #182647
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: New commits were pushed while merging. Please rerun the merge command.

Details for Dev Infra team Raised by workflow job

@ezyang ezyang left a comment

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.

.

@ezyang

ezyang commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: HTTP Error 504: Gateway Timeout

Details for Dev Infra team Raised by workflow job

@ezyang ezyang added mergedog mergedog is watching this PR and removed mergedog mergedog is watching this PR labels May 6, 2026
@ezyang ezyang added mergedog mergedog is watching this PR and removed mergedog mergedog is watching this PR labels May 6, 2026
… Win ARM64

Failing job: windows-arm64-build-test / test
Errors:
  test_autograd.py::TestAutogradDeviceTypeCPU::test_strided_leaf_grad_layout_cpu
    AssertionError: Scalars are not equal! Expected 60 but got 0.
  test_autograd.py::TestAutogradMultipleDispatchCPU::test_is_retain_graph_cpu
    RuntimeError: unsupported operation: more than one element of the
    written-to tensor refers to a single memory location.

These two tests fail only on the Windows ARM64 build-test job (Dr. CI
flagged it as flaky/disabled by #181228, but per the strategy of
adding narrow skips for Win ARM64, gate them off explicitly). Imported
IS_ARM64 from common_utils and added unittest.skipIf(IS_WINDOWS and
IS_ARM64, ...) decorators specific to that combination so other
platforms continue to exercise the tests.

Authored by Claude.

[ghstack-poisoned]
ezyang added a commit that referenced this pull request May 6, 2026
…ript

The windows-arm64-build-test job has been persistently red on trunk
because the per-commit build script (.ps1) was missed when #179024
fixed the nightly build script (.bat).

Set INSTALL_TEST=0 so aoti_custom_ops.dll (test-only) is not installed
into the wheel -- on Windows, LoadLibraryExW eagerly resolves all DLL
dependencies, so loading this test DLL at import-torch time fails.

Fix the libuv copy path from lib\Release\uv.dll to bin\uv.dll to match
where cmake actually installs it.

Explicitly initialize AutogradState bit fields in the constructor to
work around an MSVC bug where default member initializers for bit
fields are silently ignored.

Authored by Claude.

ghstack-source-id: e47c3fd
Pull-Request: #182647
…RM64')

Failing job: test (windows-arm64-build-test)
Failures:
  test_autograd.py::TestAutogradDeviceTypeCPU::test_strided_leaf_grad_layout_cpu
    AssertionError: Scalars are not equal! Expected 60 but got 0.
  test_autograd.py::TestAutogradMultipleDispatchCPU::test_is_retain_graph_cpu
    RuntimeError: unsupported operation: more than one element of the
    written-to tensor refers to a single memory location.

Both tests already have @unittest.skipIf(IS_WINDOWS and IS_ARM64, ...)
decorators referencing issue #181228, but the skips never fire on the
windows-arm64-build-test runner because Python on Windows ARM64 reports
platform.machine() == 'ARM64' (uppercase), while IS_ARM64 only checks
the lowercase 'arm64'/'aarch64'. Add 'ARM64' to the tuple so the
existing Windows-ARM64-specific skips actually take effect.

Authored by Claude.

[ghstack-poisoned]
ezyang added a commit that referenced this pull request May 6, 2026
…ript

The windows-arm64-build-test job has been persistently red on trunk
because the per-commit build script (.ps1) was missed when #179024
fixed the nightly build script (.bat).

Set INSTALL_TEST=0 so aoti_custom_ops.dll (test-only) is not installed
into the wheel -- on Windows, LoadLibraryExW eagerly resolves all DLL
dependencies, so loading this test DLL at import-torch time fails.

Fix the libuv copy path from lib\Release\uv.dll to bin\uv.dll to match
where cmake actually installs it.

Explicitly initialize AutogradState bit fields in the constructor to
work around an MSVC bug where default member initializers for bit
fields are silently ignored.

Authored by Claude.

ghstack-source-id: d1baf93
Pull-Request: #182647
@ezyang ezyang added mergedog mergedog is watching this PR and removed mergedog mergedog is watching this PR labels May 6, 2026
Failing job: windows-arm64-build-test / test
Error:
  test_nn.py::TestNN::test_upsampling_bfloat16 - Unexpected success

The test is decorated with @xfailIf(IS_ARM64 and IS_CPU_EXT_SVE_SUPPORTED
and not IS_CPU_CAPABILITY_SVE256), and on the Windows ARM64 runner the
xfail condition triggers but the test actually passes, producing an
"Unexpected success" failure. Skip the test specifically on the Windows
ARM64 combination so the existing xfail logic continues to apply on
other ARM64 platforms.

Authored by Claude.

[ghstack-poisoned]
ezyang added a commit that referenced this pull request May 6, 2026
…ript

The windows-arm64-build-test job has been persistently red on trunk
because the per-commit build script (.ps1) was missed when #179024
fixed the nightly build script (.bat).

Set INSTALL_TEST=0 so aoti_custom_ops.dll (test-only) is not installed
into the wheel -- on Windows, LoadLibraryExW eagerly resolves all DLL
dependencies, so loading this test DLL at import-torch time fails.

Fix the libuv copy path from lib\Release\uv.dll to bin\uv.dll to match
where cmake actually installs it.

Explicitly initialize AutogradState bit fields in the constructor to
work around an MSVC bug where default member initializers for bit
fields are silently ignored.

Authored by Claude.

ghstack-source-id: 61f9e3c
Pull-Request: #182647
Comment thread test/test_autograd.py

@unittest.skipIf(
IS_WINDOWS and IS_ARM64, "Fails on Windows ARM64; see issue #181228"
)

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.

Dang, it really was this simple 🤣

@ezyang

ezyang commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@ezyang

ezyang commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

mergedog handoff

All CI is green (or skipped). Ready for human review and @pytorchbot merge.

During shepherding, claude was invoked 1 time. If any CI shows red, claude judged that failure unrelated to this PR's changes — please verify below before merging.

Session 1 — fix-CI (2026-05-06T23:27:15+00:00)

  • Before: c4b9a1b3512b
  • After: f06e69e00040
  • Verdict: pushed fix commit f06e69e00040 — failing jobs: test, Link checks / lint-urls / lint
claude transcript
claude session 2a8cf68d
claude → Bash: grep -n "test_upsampling_bfloat16\|def test_upsampling_bfloat16" ./test/test_nn.py | head -20
claude → Read: ./test/test_nn.py
claude → Bash: grep -n "IS_CPU_EXT_SVE_SUPPORTED\|IS_CPU_CAPABILITY_SVE256\|IS_ARM64\b" ./torch/testing/_internal/common_utils.py | head -30
claude → Bash: grep -n "IS_WINDOWS\b" ./torch/testing/_internal/common_utils.py | head -10
claude → Bash: grep -n "IS_WINDOWS\|IS_ARM64\|xfailIf\|^from torch.testing._internal.common_utils\|skipIf" ./test/test_nn.py | head -30
claude → Edit: ./test/test_nn.py
claude → Bash: git add test/test_nn.py && git -c commit.gpgsign=false commit -m "$(cat <<'EOF'
               [MERGEDOG] Skip test_upsampling_bfloat16 on Windows ARM64
               
               Failing job: windows-arm64-build-test / test
               Error:
                 test_nn.py::TestNN::test_upsampling_bfloat16 - Unexpected success
               
               The test is decorated with @xfailIf(IS_ARM64 and IS_CPU_EXT_SVE_SUPPORTED
               and not IS_CPU_CAPABILITY_SVE256), and on the Windows ARM64 runner the
               xfail condition triggers but the test actually passes, producing an
               "Unexpected success" failure. Skip the test specifically on the Windows
               ARM64 combination so the existing xfail logic continues to apply on
               other ARM64 platforms.
               
               Authored by Claude.
               EOF
               )"
claude: Skipped `test_upsampling_bfloat16` on the Windows ARM64 combination. The Link checks failure (HTTP 503 from S3 during `lintrunner init`) is infrastructure flakiness, left untouched.
claude finished: success (cost $0.7180)

@ezyang ezyang removed the mergedog mergedog is watching this PR label May 7, 2026
Alokksinha00 pushed a commit to Alokksinha00/pytorch that referenced this pull request May 15, 2026
….ps1 script (pytorch#182647)

The windows-arm64-build-test job has been persistently red on trunk
because the per-commit build script (.ps1) was missed when pytorch#179024
fixed the nightly build script (.bat).

Set INSTALL_TEST=0 so aoti_custom_ops.dll (test-only) is not installed
into the wheel -- on Windows, LoadLibraryExW eagerly resolves all DLL
dependencies, so loading this test DLL at import-torch time fails.

Fix the libuv copy path from lib\Release\uv.dll to bin\uv.dll to match
where cmake actually installs it.

Explicitly initialize AutogradState bit fields in the constructor to
work around an MSVC bug where default member initializers for bit
fields are silently ignored.

Authored by Claude.
Pull Request resolved: pytorch#182647
Approved by: https://github.com/atalman, https://github.com/Skylion007
@github-actions
github-actions Bot deleted the gh/ezyang/3311/head branch June 7, 2026 02:29
pytorchmergebot pushed a commit that referenced this pull request Jun 11, 2026
…#182123)

In #179024 (and later #182647) it was surfaced that test artifacts like `aoti_custom_ops.dll` should not be installed in Windows wheel building because the way that symbol resolution is done eagerly on that platform means that the resulting wheels would not be functional.

But if these shared libraries are not installed, we also don't need to build them, hence this PR proposes to not do that.

Disable test building and default to Release mode in the Windows CI setup script for both libtorch and pytorch build paths.

Co-Generated with [Claude Code](https://claude.com/claude-code)

Replaces #180246
Pull Request resolved: #182123
Approved by: https://github.com/atalman
jemitche1 pushed a commit to jemitche1/pytorch that referenced this pull request Jun 13, 2026
…pytorch#182123)

In pytorch#179024 (and later pytorch#182647) it was surfaced that test artifacts like `aoti_custom_ops.dll` should not be installed in Windows wheel building because the way that symbol resolution is done eagerly on that platform means that the resulting wheels would not be functional.

But if these shared libraries are not installed, we also don't need to build them, hence this PR proposes to not do that.

Disable test building and default to Release mode in the Windows CI setup script for both libtorch and pytorch build paths.

Co-Generated with [Claude Code](https://claude.com/claude-code)

Replaces pytorch#180246
Pull Request resolved: pytorch#182123
Approved by: https://github.com/atalman
aperson30 pushed a commit to aperson30/pytorch that referenced this pull request Jun 20, 2026
….ps1 script (pytorch#182647)

The windows-arm64-build-test job has been persistently red on trunk
because the per-commit build script (.ps1) was missed when pytorch#179024
fixed the nightly build script (.bat).

Set INSTALL_TEST=0 so aoti_custom_ops.dll (test-only) is not installed
into the wheel -- on Windows, LoadLibraryExW eagerly resolves all DLL
dependencies, so loading this test DLL at import-torch time fails.

Fix the libuv copy path from lib\Release\uv.dll to bin\uv.dll to match
where cmake actually installs it.

Explicitly initialize AutogradState bit fields in the constructor to
work around an MSVC bug where default member initializers for bit
fields are silently ignored.

Authored by Claude.
Pull Request resolved: pytorch#182647
Approved by: https://github.com/atalman, https://github.com/Skylion007
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
….ps1 script (pytorch#182647)

The windows-arm64-build-test job has been persistently red on trunk
because the per-commit build script (.ps1) was missed when pytorch#179024
fixed the nightly build script (.bat).

Set INSTALL_TEST=0 so aoti_custom_ops.dll (test-only) is not installed
into the wheel -- on Windows, LoadLibraryExW eagerly resolves all DLL
dependencies, so loading this test DLL at import-torch time fails.

Fix the libuv copy path from lib\Release\uv.dll to bin\uv.dll to match
where cmake actually installs it.

Explicitly initialize AutogradState bit fields in the constructor to
work around an MSVC bug where default member initializers for bit
fields are silently ignored.

Authored by Claude.
Pull Request resolved: pytorch#182647
Approved by: https://github.com/atalman, https://github.com/Skylion007
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…pytorch#182123)

In pytorch#179024 (and later pytorch#182647) it was surfaced that test artifacts like `aoti_custom_ops.dll` should not be installed in Windows wheel building because the way that symbol resolution is done eagerly on that platform means that the resulting wheels would not be functional.

But if these shared libraries are not installed, we also don't need to build them, hence this PR proposes to not do that.

Disable test building and default to Release mode in the Windows CI setup script for both libtorch and pytorch build paths.

Co-Generated with [Claude Code](https://claude.com/claude-code)

Replaces pytorch#180246
Pull Request resolved: pytorch#182123
Approved by: https://github.com/atalman
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
….ps1 script (pytorch#182647)

The windows-arm64-build-test job has been persistently red on trunk
because the per-commit build script (.ps1) was missed when pytorch#179024
fixed the nightly build script (.bat).

Set INSTALL_TEST=0 so aoti_custom_ops.dll (test-only) is not installed
into the wheel -- on Windows, LoadLibraryExW eagerly resolves all DLL
dependencies, so loading this test DLL at import-torch time fails.

Fix the libuv copy path from lib\Release\uv.dll to bin\uv.dll to match
where cmake actually installs it.

Explicitly initialize AutogradState bit fields in the constructor to
work around an MSVC bug where default member initializers for bit
fields are silently ignored.

Authored by Claude.
Pull Request resolved: pytorch#182647
Approved by: https://github.com/atalman, https://github.com/Skylion007
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…pytorch#182123)

In pytorch#179024 (and later pytorch#182647) it was surfaced that test artifacts like `aoti_custom_ops.dll` should not be installed in Windows wheel building because the way that symbol resolution is done eagerly on that platform means that the resulting wheels would not be functional.

But if these shared libraries are not installed, we also don't need to build them, hence this PR proposes to not do that.

Disable test building and default to Release mode in the Windows CI setup script for both libtorch and pytorch build paths.

Co-Generated with [Claude Code](https://claude.com/claude-code)

Replaces pytorch#180246
Pull Request resolved: pytorch#182123
Approved by: https://github.com/atalman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request ciflow/win-arm64 Trigger Windows Arm64 CI Workflows Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants