Skip to content

Conversation

@Silv3S
Copy link
Contributor

@Silv3S Silv3S commented Nov 25, 2025

  • Conditionally remove isystem flags, as they don't silence any warnings and also throw extra warnings per each kernel:
c++: warning: /opt/intel/oneapi/compiler/2025.3/include/sycl: linker input file unused because linking not done
  • Fix no-reorder warning

Copilot AI review requested due to automatic review settings November 25, 2025 13:42
Copy link
Contributor

Copilot AI left a 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 -isystem flag workaround for SYCL headers which was causing linker warnings
  • Adds explicit warning suppressions for -Wno-attributes and -Wno-reorder to reduce build log noise

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@dvrogozh dvrogozh left a 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!

@Silv3S
Copy link
Contributor Author

Silv3S commented Nov 25, 2025

@dvrogozh thanks for review. I removed -isystem as it doesn't silence any SYCL warnings. Also it floods build logs with this warning, repeated for each kernel:

# 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.o

Regarding warnings which I wanted to silence - they are visible with and without -isystem. For example in some unrelated CI Linux build https://github.com/intel/torch-xpu-ops/actions/runs/19564034097/job/56030166103#step:6:13194

/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) {

@dvrogozh
Copy link
Contributor

Regarding warnings which I wanted to silence - they are visible with and without -isystem

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 -isystem workaround. Earlier versions of the compiler, i.e. oneapi 2025.2, 2025.1 and below, has an issue that it flooded output with warnings on SYCL headers themselves which are unrelated to our sycl code. The workaround to fix that is to add -isystem.

If you are using 2025.3, then I suggest that we should protect adding -isystem with the oneapi version check and avoid adding it for 2025.3+.

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.

@Silv3S
Copy link
Contributor Author

Silv3S commented Nov 26, 2025

Yes, I used 2025.3 for tests, that's why I didn't observe any difference. As you proposed I kept isystem flag guarded by oneAPI check to keep this workaround for older compiler versions.

@Silv3S Silv3S changed the title Silence build warnings Reduce build warnings by removing w/a for older compilers Nov 26, 2025
@dvrogozh
Copy link
Contributor

@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?

@Silv3S Silv3S changed the title Reduce build warnings by removing w/a for older compilers Reduce build warnings: fix field reordering and conditionally drop isystem w/a Nov 26, 2025
Copy link
Contributor

@dvrogozh dvrogozh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Silv3S
Copy link
Contributor Author

Silv3S commented Nov 28, 2025

@guangyey could you please merge?

@guangyey guangyey added this pull request to the merge queue Nov 28, 2025
Merged via the queue into intel:main with commit 256dc00 Nov 28, 2025
49 of 50 checks passed
@guangyey
Copy link
Contributor

OK, why not.

@Silv3S Silv3S deleted the dev/ssiwek/silence_warnings branch November 28, 2025 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants