Skip to content

Conversation

GregoryComer
Copy link
Member

@GregoryComer GregoryComer commented Aug 26, 2025

Run unit test CI on Windows. I've disabled a few jobs (mainly pending tokenizers being available on Windows), but most everything is working out of box.

I did also make a few additional fixes:

  • Shorten names for a few external project targets in CMake, in order to work around max path length limitations.
  • Update load code for kernel libraries in python. The binary names do not start with lib by default on Windows. This could be solved in the build, but it seems easier to just extend the glob.
  • Fix an issue blocking iterative builds for XNNPACK - we need to cause the schema move command to overwrite the existing artifact in the build directory.
  • Disable tokenizer install on Windows for now. Pending enablement in the tokenizers repo.
  • Fix paths in setup.py for Windows builds.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@GregoryComer
Copy link
Member Author

GregoryComer commented Aug 26, 2025

Copy link

pytorch-bot bot commented Aug 26, 2025

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 5 New Failures, 4 Unrelated Failures

As of commit fbde97d with merge base 6c1ef96 (image):

NEW FAILURES - The following jobs have failed:

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.

GregoryComer added a commit that referenced this pull request Aug 26, 2025
ghstack-source-id: a5ae4bd
ghstack-comment-id: 3226055310
Pull-Request: #13716
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 26, 2025
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 27, 2025
ghstack-source-id: 82b1993
ghstack-comment-id: 3226055310
Pull-Request: #13716
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 27, 2025
ghstack-source-id: eeddb89
ghstack-comment-id: 3226055310
Pull-Request: #13716
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 27, 2025
ghstack-source-id: b29e46d
ghstack-comment-id: 3226055310
Pull-Request: #13716
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 27, 2025
ghstack-source-id: 166e708
ghstack-comment-id: 3226055310
Pull-Request: #13716
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 27, 2025
ghstack-source-id: 91433dd
ghstack-comment-id: 3226055310
Pull-Request: #13716
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 27, 2025
ghstack-source-id: 1daa38d
ghstack-comment-id: 3226055310
Pull-Request: #13716
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 27, 2025
ghstack-source-id: 3e1d63d
ghstack-comment-id: 3226055310
Pull-Request: #13716
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 27, 2025
ghstack-source-id: b07023b
ghstack-comment-id: 3226055310
Pull-Request: #13716
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 27, 2025
ghstack-source-id: 036019b
ghstack-comment-id: 3226055310
Pull-Request: #13716
[ghstack-poisoned]
# Similar to flatbuffers, we want to build flatcc for the host. See inline comments
# in the flatbuffers ExternalProject_Add for more details.
ExternalProject_Add(
flatcc_external_project
Copy link
Member Author

Choose a reason for hiding this comment

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

This is to resolve path length issues.

Copy link
Contributor

@mergennachin mergennachin left a comment

Choose a reason for hiding this comment

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

See inline

Comment on lines 31 to 32
# pytest -n auto --cov=./ --cov-report=xml
pytest --continue-on-collection-errors -v --full-trace -c pytest-windows.ini -n auto
Copy link
Contributor

Choose a reason for hiding this comment

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

why --continue-on-collection-errors?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. This is a holdover from progressive enablement and should not be necessary any more. I've removed it.

flatbuffers_external_project
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/flatbuffers_external_project
flatbuffers_ep
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/flatc_proj
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't it flatbuffers_ep?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was intentional, though I can rename it if desired. Flatbuffers builds flatc (distinct from flatcc). The path limitations are pretty tight in CI so I squeezed out a few more characters.

@@ -0,0 +1,115 @@
# NOTE: This file is a copy of pytest.ini, but with additional tests disabled for Windows. This
# is intended to be a short-term solution to allow for incrementally enabling tests on Windows.
# This file is intended to be deleted once the enablement is complete.
Copy link
Contributor

Choose a reason for hiding this comment

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

create an issue to track deletion of this file please

Copy link
Member Author

Choose a reason for hiding this comment

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

Filed as #13883.

[ghstack-poisoned]
@GregoryComer
Copy link
Member Author

After rebasing, I do see one test failure on the Windows job that looks like a flake. I'm going to investigate.

To see why this happens see 'Known limitations' in documentation for pytest-xdist
=========================== short test summary info ===========================
ERROR devtools/etrecord/tests/etrecord_test.py - torch._dynamo.exc.InternalTorchDynamoError: PermissionError: [WinError 32] The process cannot access the file because it is being used by another process

Copy link
Contributor

@mergennachin mergennachin left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

[ghstack-poisoned]
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Sep 3, 2025
ghstack-source-id: 65f1ac6
ghstack-comment-id: 3226055310
Pull-Request: #13716
[ghstack-poisoned]
[ghstack-poisoned]
@GregoryComer
Copy link
Member Author

There appears to be a race condition with the inductor code cache when performing strict mode export from multiple processes on Windows. It's causing occasional test failures on ET, so I'm disabling parallel execution on the Windows unit test jobs for now. I'll see if I can put together a nicer repro and file a bug against PyTorch.

If not having parallel execution is prohibitive, we might be able work around it by not exporting on import in the devtools path, which is what consistently repros the issue during test collection. The race condition will still exist, but the rate at which we hit it might be acceptably low.

[ghstack-poisoned]
Copy link
Contributor

@jackzhxng jackzhxng left a comment

Choose a reason for hiding this comment

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

Btw - can you add a release notes: windows and add this to it?

@GregoryComer
Copy link
Member Author

I've verified that the remaining CI failures are pre-existing (arm tests, core ML model tests, and NXP tests).

@GregoryComer GregoryComer merged commit d7fd78b into main Sep 3, 2025
243 of 252 checks passed
@GregoryComer GregoryComer deleted the gh/GregoryComer/146/head branch September 3, 2025 19:06
from pathlib import Path

libs = list(Path(__file__).parent.resolve().glob("**/libquantized_ops_aot_lib.*"))
libs = list(Path(__file__).parent.resolve().glob("**/*quantized_ops_aot_lib.*"))
Copy link
Contributor

Choose a reason for hiding this comment

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

why this change? is lib name something different on windows?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it's named quantized_ops_aot_lib.dll (no lib prefix). We could maybe force the dll to have the lib prefix in the filename in cmake, but it seemed more idiomatic to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: none Do not include this in the release notes release notes: windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants