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

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

taoye9
Copy link
Contributor

@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 and the following out-of-bound warning

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?

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

theComputeKid commented Sep 24, 2024

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

@taoye9
Copy link
Contributor Author

taoye9 commented Sep 25, 2024

@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 following @dzarukin suggestion, i add a "#include "common/compiler_workarounds.hpp" in src/cpu/cpu_deconvolution_list.cpp and the warning is gone.

@theComputeKid
Copy link
Contributor

theComputeKid commented Sep 25, 2024

Great news! Let's submit this and then another PR to turn on werror.

@taoye9 taoye9 requested a review from a team as a code owner September 25, 2024 11:35
Copy link
Contributor

@mgouicem mgouicem left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes.
Could you please reword your first commit message according to guideline. Something like aarch64: fix jit_brgemm warnings should do.

@taoye9
Copy link
Contributor Author

taoye9 commented Sep 25, 2024

Thanks for the fixes. Could you please reword your first commit message according to guideline. Something like aarch64: fix jit_brgemm warnings should do.

done.

@vpirogov vpirogov merged commit 98a6bdf into oneapi-src:main Sep 25, 2024
15 checks passed
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.

5 participants