oneapi-src / oneDNN

oneAPI Deep Neural Network Library (oneDNN)
https://uxlfoundation.org
Apache License 2.0
3.64k stars 1.01k forks source link

failed to compile with gcc 11 #1091

Closed Neutron3529 closed 3 years ago

Neutron3529 commented 3 years ago

Summary

failed to compile with gcc 11

I tried to submit a PR(#1090), but that PR is blocked by clang-format. I tried the clang-format, but the error keeps. I don't know what to do next.

/me/incubator-mxnet/3rdparty/onednn/src/common/primitive_cache.cpp: In member function 'virtual void dnnl::impl::lru_primitive_cache_t::update_entry(const key_t&, const dnnl::impl::primitive_desc_t*)':
/me/incubator-mxnet/3rdparty/onednn/src/common/primitive_cache.cpp:155:60: error: no match for 'operator!=' (operand types are 'const std:thread:id' and 'const std:thread:id')
  155 |     if (it == cache_mapper_.end() || it->first.thread_id() != key.thread_id())
      |                                      ~~~~~~~~~~~~~~~~~~~~~ ^~ ~~~~~~~~~~~~~~~
      |                                                         |                  |
      |                                                         |                  const std:thread:id
      |                                                         const std:thread:id

Version

even the newest version have the same issue.

Environment

Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   39 bits physical, 48 bits virtual
CPU(s):                          12
On-line CPU(s) list:             0-11
Thread(s) per core:              2
Core(s) per socket:              6
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           158
Model name:                      Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Stepping:                        10
CPU MHz:                         2200.000
CPU max MHz:                     4100.0000
CPU min MHz:                     800.0000
BogoMIPS:                        4401.32
Virtualization:                  VT-x
L1d cache:                       192 KiB
L1i cache:                       192 KiB
L2 cache:                        1.5 MiB
L3 cache:                        9 MiB
NUMA node0 CPU(s):               0-11
Vulnerability Itlb multihit:     KVM: Mitigation: VMX disabled
Vulnerability L1tf:              Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling
Vulnerability Srbds:             Mitigation; Microcode
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm p
                                 be syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aper
                                 fmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe 
                                 popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd
                                  ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mp
                                 x rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_w
                                 indow hwp_epp md_clear flush_l1d
Linux Neutron 5.12.2-1-MANJARO #1 SMP PREEMPT Fri May 7 17:53:15 UTC 2021 x86_64 GNU/Linux
cmake version 3.20.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Steps to reproduce

compile with gcc 11

Observed behavior

do not compile

Expected behavior

igorsafo commented 3 years ago

Hi @Neutron3529 , Thank you for your sighting. Could you please clarify what oneDNN version do you use? We have GCC11 in our validation and there are no compilation issues, some time ago we promoted the changes which fixed the issues with GCC11.

Regarding clang-format issues: The changes in the PR you mention contain not only the changes in thread_id comparison, but also change style of source code. oneDNN have contribution guidelines, which all oneDNN developers should use to keep code base consistent. In your case you need to run clang-format tool on the source code file you changes and clang-format will make it consistent with the rest of code base and once it is done CI should be good. Please review Coding Style section of coding standards.

Regards, Igor Safonov

vpirogov commented 3 years ago

This looks like a duplicate for https://github.com/oneapi-src/oneDNN/issues/1075.

vpirogov commented 3 years ago

@Neutron3529, could you please try oneDNN v2.2.4?

Neutron3529 commented 3 years ago

This looks like a duplicate for #1075.

That should be what I met here.

Hi @Neutron3529 , Thank you for your sighting. Could you please clarify what oneDNN version do you use? We have GCC11 in our validation and there are no compilation issues, some time ago we promoted the changes which fixed the issues with GCC11.

Regarding clang-format issues: The changes in the PR you mention contain not only the changes in thread_id comparison, but also change style of source code. oneDNN have contribution guidelines, which all oneDNN developers should use to keep code base consistent. In your case you need to run clang-format tool on the source code file you changes and clang-format will make it consistent with the rest of code base and once it is done CI should be good. Please review Coding Style section of coding standards.

Regards, Igor Safonov

The version I use is the version in incubator-mxnet, which generate the error. (that has been fixed yesterday.) and I just check the code and say "even the newest version have the same issue."

problem should be solved by add a header file.