Skip to content
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

Release mode build issue with gcc-14.2.0 #2167

Open
theComputeKid opened this issue Oct 15, 2024 · 5 comments · May be fixed by #2222
Open

Release mode build issue with gcc-14.2.0 #2167

theComputeKid opened this issue Oct 15, 2024 · 5 comments · May be fixed by #2222
Labels
platform:cpu-aarch64 Codeowner: @oneapi-src/onednn-cpu-aarch64 sighting Suspicious library behavior. Should be promoted to a bug when confirmed

Comments

@theComputeKid
Copy link
Contributor

theComputeKid commented Oct 15, 2024

The MacOS release-mode gcc-14 aarch64 CI started failing after this commit: 55b52c6

The log can be seen here:

[ 31%] Building CXX object src/cpu/CMakeFiles/dnnl_cpu.dir/reorder/cpu_reorder_regular_f32_f16.cpp.o
In file included from /Users/runner/work/oneDNN/oneDNN/oneDNN/src/common/dnnl_thread.hpp:24,
                 from /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/reorder/simple_reorder.hpp:25,
                 from /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/reorder/cpu_reorder.hpp:24,
                 from /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/reorder/cpu_reorder_regular_f32_bf16.cpp:18:
In function 'void dnnl::impl::utils::array_copy(T*, const T*, size_t) [with T = long long int]',
    inlined from 'dnnl::impl::dim_t dnnl::impl::cpu::{anonymous}::get_quant_off(const dnnl_dim_t (&)[12], int, int, dnnl::impl::dim_t, dnnl::impl::dim_t, const dnnl::impl::memory_desc_t&)' at /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/reorder/simple_reorder.hpp:198:22,
    inlined from 'dnnl::impl::cpu::simple_reorder_impl<dnnl_f32, dnnl_format_tag_any, dnnl_bf16, dnnl_format_tag_any, true, dnnl::impl::cpu::spec::reference>::execute(const dnnl::impl::cpu::cpu_reorder_pd_t*, const dnnl::impl::exec_ctx_t&)::<lambda(dnnl::impl::dim_t)>' at /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/reorder/simple_reorder.hpp:2617:59:
/Users/runner/work/oneDNN/oneDNN/oneDNN/src/common/utils.hpp:215:16: error: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' specified bound between 18446744056529682432 and 18446744073709551608 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
  215 |         dst[i] = src[i];
      |         ~~~~~~~^~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [src/cpu/CMakeFiles/dnnl_cpu.dir/reorder/cpu_reorder_regular_f32_bf16.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /Users/runner/work/oneDNN/oneDNN/oneDNN/src/common/dnnl_thread.hpp:24,
                 from /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/reorder/simple_reorder.hpp:25,
                 from /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/reorder/cpu_reorder.hpp:24,
                 from /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/reorder/cpu_reorder_regular_f32_f16.cpp:17:
In function 'void dnnl::impl::utils::array_copy(T*, const T*, size_t) [with T = long long int]',
    inlined from 'dnnl::impl::dim_t dnnl::impl::cpu::{anonymous}::get_quant_off(const dnnl_dim_t (&)[12], int, int, dnnl::impl::dim_t, dnnl::impl::dim_t, const dnnl::impl::memory_desc_t&)' at /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/reorder/simple_reorder.hpp:198:22,
    inlined from 'dnnl::impl::cpu::simple_reorder_impl<dnnl_f32, dnnl_format_tag_any, dnnl_f16, dnnl_format_tag_any, true, dnnl::impl::cpu::spec::reference>::execute(const dnnl::impl::cpu::cpu_reorder_pd_t*, const dnnl::impl::exec_ctx_t&)::<lambda(dnnl::impl::dim_t)>' at /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/reorder/simple_reorder.hpp:2617:59:
/Users/runner/work/oneDNN/oneDNN/oneDNN/src/common/utils.hpp:215:16: error: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' specified bound between 18446744056529682432 and 18446744073709551608 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
  215 |         dst[i] = src[i];
      |         ~~~~~~~^~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [src/cpu/CMakeFiles/dnnl_cpu.dir/reorder/cpu_reorder_regular_f32_f16.cpp.o] Error 1

We suspect this is a compiler bug and attempts to reproduce it on godbolt did not work, though I was able to reproduce on a local Mac machine. @mgouicem also tried to fix it in #2161, but it did not work. As a solution, we downgraded from gcc-14(.2.0) to gcc-13 in #2160.

Leaving this here for future reference and debugging assistance, when the time comes to upgrade to gcc-14.

@theComputeKid theComputeKid added sighting Suspicious library behavior. Should be promoted to a bug when confirmed platform:cpu-aarch64 Codeowner: @oneapi-src/onednn-cpu-aarch64 labels Oct 15, 2024
@mgouicem
Copy link
Contributor

Hi @theComputeKid. As you were able to reproduce it locally, does the issue also reproduce with the small reproducer I shared on godbolt?
If so it might be worth submitting this issue to gcc bugzilla.

@theComputeKid
Copy link
Contributor Author

@mgouicem Unfortunately, it did not reproduce with your snippet. But when I next get time, I'll try isolating a repro myself on my machine.

@theComputeKid theComputeKid changed the title MacOS ci release mode build issue with gcc-14 Release mode build issue with gcc-14 Nov 19, 2024
@theComputeKid theComputeKid changed the title Release mode build issue with gcc-14 Release mode build issue with gcc-14.2.0 Nov 19, 2024
@theComputeKid
Copy link
Contributor Author

@mgouicem and @vpirogov : just found out that the issue is also present on linux with gcc-14.2 (and not just mac). Are there any changes that can be made to the commit that caused this so that we can compile again?

@dzarukin
Copy link
Contributor

Hi @theComputeKid, we are looking into it. Likely the solution is going to be warning suppression because all the solutions found involve code shuffling which is rather adapting for compiler issue than making the code better itself.

@vpirogov
Copy link
Member

+1
It also would be prudent to submit a defect against GCC if it's not a known bug.

@theComputeKid theComputeKid linked a pull request Nov 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:cpu-aarch64 Codeowner: @oneapi-src/onednn-cpu-aarch64 sighting Suspicious library behavior. Should be promoted to a bug when confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants