[release/2.11] Fix missing native header includes causing DLL export#3160
Merged
jeffdaily merged 1 commit intorelease/2.11from Apr 27, 2026
Merged
Conversation
|
Jenkins build for 126f37ade01350b6def2ebcb4d1c4493b87f87f9 commit finished as FAILURE Detected error during Pytorch building: |
pytorch#179138) Three operations — `torch._int_mm`,` torch._grouped_mm`, and `torch._scaled_mm_v2` — crash immediately on Windows ROCm builds with an access violation. The problem comes down to how Windows DLLs handle function visibility. Windows requires functions to be explicitly marked for export. In PyTorch, this happens through a somewhat indirect mechanism: when a source file includes a function's _native.h header, the compiler sees the TORCH_API declaration, recognizes it's defining that function locally, and automatically exports it. Three source files were missing their corresponding headers: - Blas.cpp was missing _int_mm_native.h - GroupedBlas.cpp was missing _grouped_mm_native.h - ScaledBlas.cpp was missing _scaled_mm_v2_native.h Without these includes, the functions were compiled as internal symbols and never exported. Meanwhile, the auto-generated dispatch code tried to call them through import thunks that couldn't resolve — resulting in a jump to address zero and an immediate crash. Fixes: - ROCm/TheRock#4086 - ROCm/rocm-libraries#5205 - ROCm/TheRock#4079 The fix was tested on all reproduction examples mentioned in the issues above, and all of them are passing now. Pull Request resolved: pytorch#179138 Approved by: https://github.com/jithunnair-amd, https://github.com/slayton58, https://github.com/jeffdaily
Author
|
It seems that there is the same Jenkins error as on #3161. It is unrelated to the PR changes. |
jeffdaily
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cherry pick of pytorch#179138
Fixes:
ROCm/TheRock#4086
ROCm/rocm-libraries#5205
ROCm/TheRock#4079