-
Notifications
You must be signed in to change notification settings - Fork 61
Reduce build warnings: fix field reordering and conditionally drop isystem w/a #2407
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR silences build warnings by removing workaround code for SYCL header warnings and explicitly disabling specific warning categories that flood build logs.
- Removes the
-isystemflag workaround for SYCL headers which was causing linker warnings - Adds explicit warning suppressions for
-Wno-attributesand-Wno-reorderto reduce build log noise
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dvrogozh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, help to CC people who made the initial change for review and feedback. Use git-blame to find.
-isystem did work for us. It has silenced warnings for the code in SYCL headers and exposed actual warning for our kernels. The plan was and is to further fix remainder warnings. The warnings you observe, are they against SYCL headers code or against our own kernel we host in this project? If the former - something had stopped working for -isystem trick and we need to find root cause. If the later - warnings for our own kernels needs to be fixed, not silenced!
|
@dvrogozh thanks for review. I removed # With patch
[7178/8426] Building SYCL (Device) object torch-xpu-ops-sycl-ActivationLeakyReluKernels_gen_ActivationLeakyReluKernels.cpp.o
c++: warning: /opt/intel/oneapi/compiler/2025.3/include/sycl: linker input file unused because linking not done
[7179/8426] Building SYCL (Device) object torch-xpu-ops-sycl-ActivationHardsigmoidKernels_gen_ActivationHardsigmoidKernels.cpp.o
c++: warning: /opt/intel/oneapi/compiler/2025.3/include/sycl: linker input file unused because linking not done
[7180/8426] Building SYCL (Device) object torch-xpu-ops-sycl-ActivationLogSigmoidKernels_gen_ActivationLogSigmoidKernels.cpp.o
c++: warning: /opt/intel/oneapi/compiler/2025.3/include/sycl: linker input file unused because linking not done
# With patch removed
[7178/8426] Building SYCL (Device) object torch-xpu-ops-sycl-ActivationLeakyReluKernels_gen_ActivationLeakyReluKernels.cpp.o
[7179/8426] Building SYCL (Device) object torch-xpu-ops-sycl-ActivationSoftplusKernels_gen_ActivationSoftplusKernels.cpp.o
[7180/8426] Building SYCL (Device) object torch-xpu-ops-sycl-ActivationGeluKernel_gen_ActivationGeluKernel.cpp.oRegarding warnings which I wanted to silence - they are visible with and without /home/jenkins/actions-runner/_work/torch-xpu-ops/torch-xpu-ops/pytorch/third_party/torch-xpu-ops/src/ATen/native/xpu/sycl/SortingKernels.h:19:30: warning: ‘sycl::reqd_sub_group_size’ scoped attribute directive ignored [-Wattributes]
19 | sycl::nd_item<1> item) const {
| ^~~~~
/home/jenkins/actions-runner/_work/torch-xpu-ops/torch-xpu-ops/pytorch/third_party/torch-xpu-ops/src/ATen/native/xpu/sycl/SortingKernels.h:100:30: warning: ‘sycl::reqd_sub_group_size’ scoped attribute directive ignored [-Wattributes]
100 | sycl::nd_item<1> item) const {and /tmp/icx-582c2a1559/FusedSgdKernels-header-93eb53.h:122:40: warning: ‘visibility’ attribute ignored [-Wattributes]
122 | static constexpr const char* getName() { return "_ZTSN2at6native3xpu29MultiTensorApplyKernelFunctorIPNS1_16TLMetaForAddressILi2EEEPNS1_11TLMetaForWGENS1_12_GLOBAL__N_119FusedSgdMathFunctorIdLi2EEEJddPKfddbbbSC_SC_EEE"; }
| ^
/tmp/icx-582c2a1559/FusedSgdKernels-header-93eb53.h:124:42: warning: ‘visibility’ attribute ignored [-Wattributes]
124 | static constexpr unsigned getNumParams() { return 6; }
| ^
/tmp/icx-582c2a1559/FusedSgdKernels-header-93eb53.h:126:70: warning: ‘visibility’ attribute ignored [-Wattributes]
126 | static constexpr const kernel_param_desc_t& getParamDesc(unsigned i) { |
Are you using oneapi 2025.3? If yes, then the behavior you observe is expected as this is the first version which does not need the If you are using 2025.3, then I suggest that we should protect adding As for the warning examples you've posted, I believe these are legitimate warnings for our code in this repository and such warnings needs to be fixed rather than silenced. If we can't fix them for whatever reason we first need to raise issue with oneapi team and only then consider silencing them. |
|
Yes, I used 2025.3 for tests, that's why I didn't observe any difference. As you proposed I kept |
|
@Silv3S , thank you for update. Last comment from my side, I think PR title "Reduce build warnings by removing w/a for older compilers" went out of sync with actual content as PR now fixes reordering warnings in one kernel and updates wa. Can you, please, align the PR title? |
dvrogozh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Yu, Guangye <[email protected]>
|
@guangyey could you please merge? |
|
OK, why not. |
isystemflags, as they don't silence any warnings and also throw extra warnings per each kernel: