Skip to content

Conversation

GregoryComer
Copy link
Member

@GregoryComer GregoryComer commented Aug 20, 2025

Add mman_windows.cpp to the CMake sources. With this change, the pybind preset works and we can re-enable it in CI.

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Aug 20, 2025

🔗 Helpful Links

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

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

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

@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 20, 2025
GregoryComer added a commit that referenced this pull request Aug 20, 2025
ghstack-source-id: b7302f8
ghstack-comment-id: 3208323478
Pull-Request: #13564
@GregoryComer GregoryComer marked this pull request as draft August 20, 2025 23:09
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 20, 2025
ghstack-source-id: a739b22
ghstack-comment-id: 3208323478
Pull-Request: #13564
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 21, 2025
ghstack-source-id: 9189f29
ghstack-comment-id: 3208323478
Pull-Request: #13564
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 21, 2025
ghstack-source-id: a07137b
ghstack-comment-id: 3208323478
Pull-Request: #13564
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 21, 2025
ghstack-source-id: 5fa8caa
ghstack-comment-id: 3208323478
Pull-Request: #13564
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 21, 2025
ghstack-source-id: 8596a36
ghstack-comment-id: 3208323478
Pull-Request: #13564
[ghstack-poisoned]
@GregoryComer GregoryComer changed the title Update optimized lib to build on Windows Fix data loader build on Windows, re-enable pybind job Aug 21, 2025
[ghstack-poisoned]
@GregoryComer GregoryComer marked this pull request as ready for review August 21, 2025 04:01
[ghstack-poisoned]
@GregoryComer
Copy link
Member Author

Note that CI failures are pre-existing.

[ghstack-poisoned]
)
endif()

# These XNNPACK options don't currently build on Windows with Clang.
Copy link
Contributor

@JacobSzwejbka JacobSzwejbka Aug 25, 2025

Choose a reason for hiding this comment

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

Where do these magic incantations come from

Copy link
Member Author

Choose a reason for hiding this comment

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

These are 4 optional XNNPACK features (exposed by XNNPACK's CMakeLists) that clang-cl has issues with due to the /vlen compiler argument.

These disable a small subset of the available kernels, though they are relatively niche and should have minimal perf impact. It should be fixed or gated upstream in XNNPACK itself. I intend to file an issue there and maybe just fix it myself. They have some gating logic already (https://github.com/google/XNNPACK/blob/923253023555f75c38d96511aa7fa59b9ef9c25c/CMakeLists.txt#L176)

I could also move these into the XNNPACK backend CMakeLists, rather than the presets, as they are functionally an internal detail, and it would also ensure that they are always disabled 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.

Thinking through it more, I think I will move these into the XNNPACK backend CMakeLists, rather than the preset.

@@ -24,6 +24,11 @@ if(NOT ET_HAVE_SYS_MMAN_H AND NOT WIN32)
"extension/data_loader/mmap_data_loader.cpp"
)
endif()
if(WIN32)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this necessary? I thought scott already selectively included this source file in build whatever.bzl

Copy link
Contributor

Choose a reason for hiding this comment

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

Apparently not. I might be thinking of selectively removing the header from the public include if not on windows or something

Copy link
Member Author

@GregoryComer GregoryComer Aug 25, 2025

Choose a reason for hiding this comment

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

Yeah, I chatted with Scott briefly on this. His recommendation was to manage it locally. The main build variables list has to be mechanically parsable from both CMake and Buck, so it can't include more complex conditional logic.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Base automatically changed from gh/GregoryComer/118/head to gh/GregoryComer/141/head August 26, 2025 00:12
@GregoryComer GregoryComer merged commit 488289b into gh/GregoryComer/141/head Aug 26, 2025
@GregoryComer GregoryComer deleted the gh/GregoryComer/136/head branch August 26, 2025 00:12
@GregoryComer
Copy link
Member Author

I'm not sure, why ghstack merged this when re-ordering PRs. I'll re-open as a new PR.

GregoryComer added a commit that referenced this pull request Aug 27, 2025
…t build CI job (#13702)

**Note: This is a cherry-pick of
#13564 and
#13259. I inadvertently broke
the ghstack when attempting to re-order the stack, leading to the old PR
being merged by ghstack into the ghstack-created branch (not main).**

Add mman_windows.cpp to the CMake sources. Fix a few build-blocking
issues with XNNPACK on Windows. Enable XNNPACK on the Windows preset.
This also gives CI coverage.

I've disabled 4 microkernel families that don't build currently. These
likely need to be gated or fixed upstream, but I'm disabling them
locally for now to unblock usage. They are relatively niche and should
have little to no perf impact on the average user.

With this change, the pybind preset works and we can re-enable it in CI.
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants