Summary
The AVX-512 microkernels compute acc += beta * C_old with fmadd.
scalar_microkernel() does not: it zeroes C when beta is 0 and otherwise adds
products straight into C, i.e. C_old + A*B with an implicit weight of 1. That is
correct only for beta ∈ {0, 1} and silently wrong for every other value.
The FP32 looper reaches those other values by design: when alpha != 1 it defers
scaling and passes beta/alpha to the microkernel, so an arbitrary alpha with an
arbitrary beta yields an arbitrary ratio. Any host without AVX-512 therefore gets
wrong results from the native FP32 path whenever alpha != 1 and beta != 0.
Reproduce
On a host without AVX-512, force the native path over the gtests' random
alpha/beta and compare against the reference kernel:
ZENDNNL_MATMUL_ALGO=10 ./gtests --seed 424242 --gtest_filter="*TestMatmul.F32_F32*"
Requires the unguarded AVX-512 epilogue helpers (#32) to be fixed first, since
those otherwise fault before reaching this.
After the fix, every remaining failure in that run is transA=1, which the native
path declines outright and which has no AOCL-DLP to fall back to in such a build.
Suggested fix
Scale C by beta, matching the AVX-512 kernels.
Reference branch: https://github.com/lwandrebeck/BullDNN/tree/upstream/native-beta-as-flag
Summary
The AVX-512 microkernels compute
acc += beta * C_oldwith fmadd.scalar_microkernel()does not: it zeroes C when beta is 0 and otherwise addsproducts straight into C, i.e.
C_old + A*Bwith an implicit weight of 1. That iscorrect only for beta ∈ {0, 1} and silently wrong for every other value.
The FP32 looper reaches those other values by design: when
alpha != 1it defersscaling and passes
beta/alphato the microkernel, so an arbitrary alpha with anarbitrary beta yields an arbitrary ratio. Any host without AVX-512 therefore gets
wrong results from the native FP32 path whenever
alpha != 1andbeta != 0.Reproduce
On a host without AVX-512, force the native path over the gtests' random
alpha/beta and compare against the reference kernel:
Requires the unguarded AVX-512 epilogue helpers (#32) to be fixed first, since
those otherwise fault before reaching this.
After the fix, every remaining failure in that run is
transA=1, which the nativepath declines outright and which has no AOCL-DLP to fall back to in such a build.
Suggested fix
Scale C by beta, matching the AVX-512 kernels.
Reference branch: https://github.com/lwandrebeck/BullDNN/tree/upstream/native-beta-as-flag