[ML] Build setup instructions and tweaks for Torch on Windows #1677
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
way Windows imports DLLs using import libraries, and the
extra dependencies of the PyTorch DLLs on Windows.
This needs another iteration before the feature branch is merged to master. The outstanding issues relate to the commands and flags used within the PyTorch build:
torch_cpu.dll
is 78MB. It's crazy for us to ship that when most of it is debug symbols and our customers aren't going to be doing debugging. So we need to find a way to use /Zi even if there is some drawback to it, or if /Zi is completely out-of-the-question then turn off debug symbol generation altogether for this library.cl : Command line warning D9025 : overriding '/O2' with '/Od'
- we need to find which ones and confirm it makes sense.Performing Test COMPILER_SUPPORTS_NO_AVX256_SPLIT - Failed
suggests that the build system is making decisions about which CPU instructions to use based on the capabilities of the build machine. Great for someone who's going to build and run on their own laptop, but not great for a controlled redistribution as part of a product. This ties in with the point below about exactly which compiler options are used during the build, as this will reveal flags that may be limiting which runtime machines will work.So there's still lots to do, but the changes of this PR prove that it's possible for us to build a Windows program that uses PyTorch.