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

cpu: aarch64: fix jit_brgemm warnings #2118

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

taoye9
Copy link

@taoye9 taoye9 commented Sep 24, 2024

Description

this change is to fix aarch64 compile warning so that we can enable Werror for aarch64 in the ci.

So far, we've fix t warnings inside oneDNN/src/cpu/aarch64/ folder.

Now only one warning remains, which info is as following.
The warning can be reproduced in ci [macOS (gcc-14, g++-14, Release, 0)]

In file included from /Users/runner/work/oneDNN/oneDNN/oneDNN/src/common/memory_desc_wrapper.hpp:27,
                 from /Users/runner/work/oneDNN/oneDNN/oneDNN/src/common/memory.hpp:26,
                 from /Users/runner/work/oneDNN/oneDNN/oneDNN/src/common/engine.hpp:26,
                 from /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/cpu_engine.hpp:26,
                 from /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/cpu_deconvolution_list.cpp:19:
In function 'void dnnl::impl::copy_c_op_desc(op_desc_t*, const op_desc_t*)',
    inlined from 'dnnl::impl::primitive_desc_iterator_t::primitive_desc_iterator_t(dnnl::impl::engine_t*, const dnnl::impl::op_desc_t*, const dnnl::impl::primitive_attr_t*, const dnnl::impl::primitive_desc_t*, int)' at /Users/runner/work/oneDNN/oneDNN/oneDNN/src/common/primitive_desc_iterator.hpp:50:23,
    inlined from 'dnnl::impl::status_t dnnl::impl::cpu::ref_deconvolution_bwd_data_t::pd_t::init_convolution(dnnl::impl::engine_t*)' at /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/ref_deconvolution.hpp:338:[66](https://github.com/oneapi-src/oneDNN/actions/runs/11017022556/job/30593938494?pr=2118#step:9:67):
/Users/runner/work/oneDNN/oneDNN/oneDNN/src/common/type_helpers.hpp:1225:23: warning: array subscript 'const dnnl::impl::op_desc_t[0]' is partly outside array bounds of 'dnnl::impl::convolution_desc_t [1]' [-Warray-bounds=]
 1225 |     switch ((int)src->kind) {
      |                  ~~~~~^~~~
In file included from /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/cpu_deconvolution_list.cpp:21:
/Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/ref_deconvolution.hpp: In member function 'dnnl::impl::status_t dnnl::impl::cpu::ref_deconvolution_bwd_data_t::pd_t::init_convolution(dnnl::impl::engine_t*)':
/Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/ref_deconvolution.hpp:331:32: note: object 'cd' of size 5720
  331 |             convolution_desc_t cd;
      |                                ^~
In function 'void dnnl::impl::copy_c_op_desc(op_desc_t*, const op_desc_t*)',
    inlined from 'dnnl::impl::primitive_desc_iterator_t::primitive_desc_iterator_t(dnnl::impl::engine_t*, const dnnl::impl::op_desc_t*, const dnnl::impl::primitive_attr_t*, const dnnl::impl::primitive_desc_t*, int)' at /Users/runner/work/oneDNN/oneDNN/oneDNN/src/common/primitive_desc_iterator.hpp:50:23,
    inlined from 'dnnl::impl::status_t dnnl::impl::cpu::ref_deconvolution_bwd_data_t::pd_t::init_convolution(dnnl::impl::engine_t*)' at /Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/ref_deconvolution.hpp:338:66:
/Users/runner/work/oneDNN/oneDNN/oneDNN/src/common/type_helpers.hpp:1223:44: warning: array subscript 'const dnnl::impl::op_desc_t[0]' is partly outside array bounds of 'dnnl::impl::convolution_desc_t [1]' [-Warray-bounds=]
 1223 |     case primitive_kind::pkind: dst->pkind = src->pkind; break;
      |                                            ^
/Users/runner/work/oneDNN/oneDNN/oneDNN/src/common/type_helpers.hpp:1242:9: note: in expansion of macro 'CASE_OP_DESC'
 1242 |         CASE_OP_DESC(sdpa);
      |         ^~~~~~~~~~~~
/Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/ref_deconvolution.hpp: In member function 'dnnl::impl::status_t dnnl::impl::cpu::ref_deconvolution_bwd_data_t::pd_t::init_convolution(dnnl::impl::engine_t*)':
/Users/runner/work/oneDNN/oneDNN/oneDNN/src/cpu/ref_deconvolution.hpp:331:32: note: object 'cd' of size 5720
  331 |             convolution_desc_t cd;

Checklist

General

  • Do all unit and benchdnn tests (make test and make test_benchdnn_*) pass locally for each commit?
  • Have you formatted the code using clang-format?

Signed-off-by: yetao01 <ye.tao@arm.com>
@taoye9 taoye9 requested a review from a team as a code owner September 24, 2024 15:29
@taoye9 taoye9 changed the title fix jit_brgemm warnings cpu: aarch64: fix jit_brgemm warnings Sep 24, 2024
@theComputeKid theComputeKid added the platform:cpu-aarch64 Codeowner: @oneapi-src/onednn-cpu-aarch64 label Sep 24, 2024
@theComputeKid
Copy link
Contributor

Thanks for this, which compiler is that warning from? Does this mean we can turn on werror for one of the compilers now?

@taoye9
Copy link
Author

taoye9 commented Sep 24, 2024

ci: macOS (gcc-14, g++-14, Release, 0)]

Copy link
Contributor

@theComputeKid theComputeKid left a comment

Choose a reason for hiding this comment

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

Thanks. Action is now on me to tighten Werror for ci.

@theComputeKid
Copy link
Contributor

@vpirogov and @mgouicem , can you please help with the last remaining warning, we do not know what to do with it, as it originates outside of the aarch64 codebase. This is the last issue stopping us from enabling Werror. You can see it in the ci for gcc, release.

@dzarukin
Copy link
Contributor

@vpirogov and @mgouicem , can you please help with the last remaining warning, we do not know what to do with it, as it originates outside of the aarch64 codebase. This is the last issue stopping us from enabling Werror. You can see it in the ci for gcc, release.

If you are referring to out-of-bound access to kind, this is worked around by #include "common/compiler_workarounds.hpp" in correspondent .cpp file. It's important it's .cpp, not .hpp.
If there's something else I'm missing, please let me know. Thanks.

@theComputeKid
Copy link
Contributor

@taoye9 can you please try @dzarukin's suggestion. If this works, please include it in this patch. If not, we can submit what we have, and take a look later.

If the suggestion works, then if it is okay with other reviewers, please add an additional seperate commit to this PR to immediately enable Werror in our ci, and let's never worry about warnings again.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants