-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[ROCm][Windows] Run hipcc with compatibility flags. #153986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This avoid warning spam while compiling. Co-authored-by: Aaryaman Vasishta <jem456.vasishta@gmail.com> Co-authored-by: Scott Todd <scott.todd0@gmail.com>
The committers listed above are authorized under a signed CLA. |
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/153986
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New FailuresAs of commit ff16532 with merge base e8f8baf ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "topic: not user facing" |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: Apply lint suggestions Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -f "unrelated CI failures" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…159790) This is a similar change to #153986, this time adding flags to the hipcc command under `cpp_extension.py`. The `-Wno-ignored-attributes` flag in particular avoids about 200MB of warning spam when building torchvision, like these: ``` In file included from D:\b\vision_main\torchvision\csrc\ops\hip\deform_conv2d_kernel.hip:72: In file included from D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\ATen/ATen.h:13: In file included from D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\ATen/Functions.h:386: In file included from D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\ATen/ops/_sparse_softmax.h:21: D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\ATen/ops/_sparse_softmax_ops.h:18:8: warning: __declspec attribute 'dllimport' is not supported [-Wignored-attributes] 18 | struct TORCH_API _sparse_softmax_int { | ^~~~~~~~~ D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\torch/headeronly/macros/Export.h:100:19: note: expanded from macro 'TORCH_API' 100 | #define TORCH_API C10_IMPORT | ^~~~~~~~~~ D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\torch/headeronly/macros/Export.h:53:31: note: expanded from macro 'C10_IMPORT' 53 | #define C10_IMPORT __declspec(dllimport) | ^~~~~~~~~ ``` The `-fms-extensions` flag just seems beneficial to include: https://clang.llvm.org/docs/MSVCCompatibility.html. See also this downstream issue where these changes were tested: ROCm/TheRock#910. Pull Request resolved: #159790 Approved by: https://github.com/jeffdaily
…ytorch#159790) This is a similar change to pytorch#153986, this time adding flags to the hipcc command under `cpp_extension.py`. The `-Wno-ignored-attributes` flag in particular avoids about 200MB of warning spam when building torchvision, like these: ``` In file included from D:\b\vision_main\torchvision\csrc\ops\hip\deform_conv2d_kernel.hip:72: In file included from D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\ATen/ATen.h:13: In file included from D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\ATen/Functions.h:386: In file included from D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\ATen/ops/_sparse_softmax.h:21: D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\ATen/ops/_sparse_softmax_ops.h:18:8: warning: __declspec attribute 'dllimport' is not supported [-Wignored-attributes] 18 | struct TORCH_API _sparse_softmax_int { | ^~~~~~~~~ D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\torch/headeronly/macros/Export.h:100:19: note: expanded from macro 'TORCH_API' 100 | #define TORCH_API C10_IMPORT | ^~~~~~~~~~ D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\torch/headeronly/macros/Export.h:53:31: note: expanded from macro 'C10_IMPORT' 53 | #define C10_IMPORT __declspec(dllimport) | ^~~~~~~~~ ``` The `-fms-extensions` flag just seems beneficial to include: https://clang.llvm.org/docs/MSVCCompatibility.html. See also this downstream issue where these changes were tested: ROCm/TheRock#910. Pull Request resolved: pytorch#159790 Approved by: https://github.com/jeffdaily
# Motivation Refer to pytorch/pytorch#153986, suppressing the dllexport warning on XPU Windows builds, which will reduce the number of lines in the build log. ```bash 2025-08-27T16:24:34.6542666Z C:\actions-runner\_work\pytorch\pytorch\pytorch\c10\util\Exception.h(475,8): warning: 'dllimport' attribute ignored on inline function [-Wignored-attributes] 2025-08-27T16:24:34.6544084Z 475 | inline C10_API const char* torchCheckMsgImpl(const char* msg) { ``` With this PR, the line of build log will reduce from 2830,000+ to 17,000+. Before: <img width="1460" height="262" alt="image" src="https://github.com/user-attachments/assets/ca32cd91-1cfc-4490-afc4-b295369e5399" /> After: <img width="792" height="196" alt="image" src="https://github.com/user-attachments/assets/a3d64038-df3e-4e36-b8af-859f0810737f" />
…ytorch#159790) This is a similar change to pytorch#153986, this time adding flags to the hipcc command under `cpp_extension.py`. The `-Wno-ignored-attributes` flag in particular avoids about 200MB of warning spam when building torchvision, like these: ``` In file included from D:\b\vision_main\torchvision\csrc\ops\hip\deform_conv2d_kernel.hip:72: In file included from D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\ATen/ATen.h:13: In file included from D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\ATen/Functions.h:386: In file included from D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\ATen/ops/_sparse_softmax.h:21: D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\ATen/ops/_sparse_softmax_ops.h:18:8: warning: __declspec attribute 'dllimport' is not supported [-Wignored-attributes] 18 | struct TORCH_API _sparse_softmax_int { | ^~~~~~~~~ D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\torch/headeronly/macros/Export.h:100:19: note: expanded from macro 'TORCH_API' 100 | #define TORCH_API C10_IMPORT | ^~~~~~~~~~ D:\projects\TheRock\external-builds\pytorch\.venv\Lib\site-packages\torch\include\torch/headeronly/macros/Export.h:53:31: note: expanded from macro 'C10_IMPORT' 53 | #define C10_IMPORT __declspec(dllimport) | ^~~~~~~~~ ``` The `-fms-extensions` flag just seems beneficial to include: https://clang.llvm.org/docs/MSVCCompatibility.html. See also this downstream issue where these changes were tested: ROCm/TheRock#910. Pull Request resolved: pytorch#159790 Approved by: https://github.com/jeffdaily
See also ROCm/TheRock#590. Including the
-Wno-ignored-attributesflag here avoids 700MB of log warning spam while compiling and the-fms-extensionsseems beneficial to include: https://clang.llvm.org/docs/MSVCCompatibility.html.Co-authored-by: Aaryaman Vasishta jem456.vasishta@gmail.com
Co-authored-by: Scott Todd scott.todd0@gmail.com
cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo @hongxiayang @naromero77amd