gemm acc issue on AVX512 and AVX
Created by: tensor-tang
code base: https://github.com/PaddlePaddle/Paddle/pull/15448
how to reproduce
cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_GPU=OFF -DWITH_MKL=ON -DWITH_TESTING=ON -DWITH_FLUID_ONLY=ON -DWITH_DOC=OFF -DWITH_MKLDNN=OFF -DWITH_CONTRIB=OFF
make jit_kernel_test -j
make test ARGS="-R jit_kernel_test -V"
This would pass.
But when delete line here, and do step2 and step3, then it will fail like:
...
73: /home/tangjian/paddle-tj-docker/paddle/fluid/operators/jit/test.cc:42: Failure
73: The difference between target[i] and refer[i] is 5.340576171875e-05, which exceeds FLAGS_acc, where
73: target[i] evaluates to -55.43963623046875,
73: refer[i] evaluates to -55.439689636230469, and
73: FLAGS_acc evaluates to 1.0000000000000001e-05.
73: /home/tangjian/paddle-tj-docker/paddle/fluid/operators/jit/test.cc:42: Failure
73: The difference between target[i] and refer[i] is 8.392333984375e-05, which exceeds FLAGS_acc, where
73: target[i] evaluates to 93.255752563476562,
73: refer[i] evaluates to 93.255836486816406, and
73: FLAGS_acc evaluates to 1.0000000000000001e-05.
73: /home/tangjian/paddle-tj-docker/paddle/fluid/operators/jit/test.cc:42: Failure
73: The difference between target[i] and refer[i] is 6.103515625e-05, which exceeds FLAGS_acc, where
73: target[i] evaluates to -67.680465698242188,
73: refer[i] evaluates to -67.680526733398438, and
73: FLAGS_acc evaluates to 1.0000000000000001e-05.
...
Failed on both 2620v2 and 5117.