[CD] Add statically linked windows libraries to exclude list (#163768)

Fixes: https://github.com/pytorch/pytorch/issues/159514

Seeing following in the Wheel build logs:
```
Linking CXX static library lib\kineto.lib
Linking CXX static library lib\dnnl.lib
....
```

These files are around 800MB uncompressed and 109MB compressed, hence provide ~50% size reduction for Windows CPU builds.

Test Plan: Build Pytorch Windows binary. Build vision, audio and torchcodec with this binary. Smoke test.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/163768
Approved by: https://github.com/albanD, https://github.com/malfet
This commit is contained in:
atalman
2025-09-25 14:03:14 +00:00
committed by PyTorch MergeBot
parent 00059db034
commit 98c4e35f14

View File

@ -1704,7 +1704,18 @@ def main() -> None:
package_data = {
"torch": torch_package_data,
}
exclude_package_data = {}
# some win libraries are excluded
# these are statically linked
exclude_windows_libs = [
"lib/dnnl.lib",
"lib/kineto.lib",
"lib/libprotobuf-lite.lib",
"lib/libprotobuf.lib",
"lib/libprotoc.lib",
]
exclude_package_data = {
"torch": exclude_windows_libs,
}
if not BUILD_LIBTORCH_WHL:
package_data["torchgen"] = torchgen_package_data