Error building on Intel KNL

Issue #167 resolved
khuck@cs.uoregon.edu created an issue

I am getting this error when building with Blaze headers on Intel KNL, with gcc 7.1 using the -march=knl flag:

/home/buildbot/slaves/phylanx/knl-gcc7-release/build/tools/buildbot/src/blaze-head/blaze/math/simd/Equality.h: In function ‘bool blaze::equal(const blaze::SIMDfloat&, const blaze::SIMDfloat&)’:
/home/buildbot/slaves/phylanx/knl-gcc7-release/build/tools/buildbot/src/blaze-head/blaze/math/simd/Equality.h:523:14: error: there are no arguments to ‘_mm512_cmple_ps_mask’ that depend on a template parameter, so a declaration of ‘_mm512_cmple_ps_mask’ must be available [-fpermissive]
       return _mm512_cmple_ps_mask( xmm1, xmm2 ) == 0xffff;
              ^~~~~~~~~~~~~~~~~~~~

Comments (12)

  1. Klaus Iglberger

    Hi!

    Thanks a lot for creating this issue. Unfortunately we didn't encounter this issue before during our testing of KNL since for these tests we are usually using the Intel compiler. We apologize for the inconvenience!

    According to the Intel Intrinsics Guide the _mm512_cmple_ps_mask function must be available for KNL when using the AVX512F mode. Therefore it looks like GCC is missing this particular function and it seems to be an issue of the GCC compiler. Still, we will try to circumvent the problem within Blaze.

    Thanks again for creating this issue,

    Best regards,

    Klaus!

  2. khuck@cs.uoregon.edu reporter

    Thanks! Let us know when you think you have a workaround. This is for use with HPX/Phylanx, and unfortunately the Intel C++ compiler can't handle some of the syntax that the HPX team throws at it, so that's why we are using GNU. :(

  3. Klaus Iglberger

    Commit bb84d3e implements a fix to mitigate the compilation issue. The fix is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.4.

  4. khuck@cs.uoregon.edu reporter

    @eagle42 I am now getting errors like this:

    /home/buildbot/slaves/phylanx/knl-gcc7-release/build/tools/buildbot/src/blaze-head/blaze/math/simd/Equality.h:405:41: error: ‘const struct blaze::SIMDint64’ has no member named ‘eval’
        return _mm512_cmpeq_epi64_mask( (~a).eval().value, (~b).eval().value ) == 0xff;
                                        ~~~~~^~~~
    /home/buildbot/slaves/phylanx/knl-gcc7-release/build/tools/buildbot/src/blaze-head/blaze/math/simd/Equality.h:405:60: error: ‘const struct blaze::SIMDint64’ has no member named ‘eval’
        return _mm512_cmpeq_epi64_mask( (~a).eval().value, (~b).eval().value ) == 0xff;
                                                           ~~~~~^~~~
    

    and:

    /home/buildbot/slaves/phylanx/knl-gcc7-release/build/tools/buildbot/src/blaze-head/blaze/math/simd/Stream.h:278:23: error: cannot convert ‘long int*’ to ‘__m512i* {aka __vector(8) long long int*}’ for argument ‘1’ to ‘void _mm512_stream_si512(__m512i*, __m512i)’
        _mm512_stream_si512( address, (~value).value );
        ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
    

    Thanks!

  5. Klaus Iglberger

    Hi!

    We have pushed commit 05f6070, which takes care of all remaining compilation issues. We apologize for this oversight!

    Best regards,

    Klaus!

  6. khuck@cs.uoregon.edu reporter

    Almost there! Got one more:

    /home/buildbot/slaves/phylanx/knl-gcc7-release/build/tools/buildbot/src/blaze-head/blaze/math/simd/Abs.h:244:24: error: cannot convert ‘const IntrinsicType {aka const __vector(8) double}’ to ‘__m512 {aka __vector(16) float}’ for argument ‘1’ to ‘__m512d _mm512_abs_pd(__m512)’
        return _mm512_abs_pd( (~a).eval().value );
               ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
    
  7. Klaus Iglberger

    Hi!

    We also encountered this compilation issue, but identified it as another serious bug in GCC. The function signature as shown by the compiler (__m512d _mm512_abs_pd(__m512) indicates that GCC is using the wrong argument type (it should be __m512d instead of __m512).

    This is the kind of problem that we don't want to fix within Blaze, but that must be fixed within the compiler. Does the problem occur even if you are not using the abs() function? Would it be an option to use Clang instead of GCC? If no, which version of GCC are you using?

    Best regards,

    Klaus!

  8. khuck@cs.uoregon.edu reporter

    Klaus -

    I am using GCC 7.1. I can check with the Phylanx team, but I think we want to stick with GCC on this platform for now (although we already switched from Intel compilers). I m building with 7.1 - is this something that is fixed in 8.1? I can try that, too.

    Thanks - Kevin

  9. Klaus Iglberger

    Hi Kevin!

    Thanks for the quick feedback. Then it looks like Blaze has to fix the issue nevertheless. Commit 5aa4175 resolves the issue by disabling the AVX512 abs() overload for double. You will be able to compile and to use abs(), but the operation will not be vectorized. In other words, we treat the _mm512_abs_pd() intrinsic as non-existent. Hopefully this resolves the last issue.

    Thanks a lot for your input,

    Best regards,

    Klaus!

  10. khuck@cs.uoregon.edu reporter

    Klaus -

    Looks like the build is successful. I guess we'll just have to deal with poor performance from abs() on the KNL for now. Thanks!

  11. Log in to comment