intgemm icon indicating copy to clipboard operation
intgemm copied to clipboard

Internal compiler error

Open kpu opened this issue 5 years ago • 3 comments

In file included from /home/heafield/intgemm/./sse2_gemm.h:6:0,
                 from /home/heafield/intgemm/./intgemm.h:48,
                 from /home/heafield/intgemm/test/multiply_test.cc:4:
/home/heafield/intgemm/./multiply.h: In function ‘static void intgemm::AVX512_16bit::Multiply(const int16_t*, const int16_t*, float*, PostprocessPipeline, intgemm::Index, intgemm::Index, intgemm::Index) [with PostprocessPipeline = std::tuple<intgemm::Unquantize, intgemm::AddBias>]’:
/home/heafield/intgemm/./multiply.h:16:50: internal compiler error: in convert_move, at expr.c:315
   *reinterpret_cast<__m256*>(C + offset) = result;
                                                  ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
CMakeFiles/tests.dir/build.make:62: recipe for target 'CMakeFiles/tests.dir/test/multiply_test.cc.o' failed

kpu avatar Jul 05 '19 11:07 kpu

In any case the writer shouldn't be in multiply.h anymore but that's a longer issue...

kpu avatar Jul 05 '19 11:07 kpu

@XapaJIaMnu Can you help with your internal compiler error expertise?

kpu avatar Jul 08 '19 15:07 kpu

I've encountered this bug before ( https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77952 ) and I've referenced it a pull request comment here: https://github.com/kpu/intgemm/pull/3#issue-271506602 .

I believe this crash happens when you have a mismatch in the target attribute in some cases, despite them being compatible. In my pull request, this happened because we were using AVX512BW functions inside functions annotated with AVX512F and we fixed it by having everything annotated as AVX512BW.

In this case, it seems the writer is annotated with AVX2, but it's being used inside AVX512BW annotated function (the multiply) and it crashes. A workaround, would be to have two separate functions with two different annotations, but function multiversioning is inherently broken especially on old GCC, so we would need #DEFINE it with two differet target attributes.

Or. use writer and writerAVX512DUMMY, and change the multiply function.

Cheers,

Nick

XapaJIaMnu avatar Jul 08 '19 16:07 XapaJIaMnu