oneapi-src / oneDNN

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

Jit uni reorders give incorrect results with certain 4d matrices and src zero point != 0 #2213

Open Ryo-not-rio opened 2 days ago

Ryo-not-rio commented 2 days ago

Jit:uni reorders for certain 4d matrices are returning incorrect results when the src zero point != 0. A guard has been added to skip jit uni reorders so the simple:any implementation will be used in https://github.com/oneapi-src/oneDNN/pull/2207, however a fix for jit:uni should be created to improve performance.

From my initial investigation, it seems to happen for some shapes when dim[2] > 16 and dim[3] != multiple of 2 but I'm sure there are other shapes that would cause the same issue.

Version

oneDNN v3.7.0 (commit 2fc6ff9d6142e1c1ab068165f953adf71c4350ff)

Environment

oneDNN includes hardware-specific optimizations and may behave differently on depending on the compiler and build environment. Include the following information to help reproduce the issue:

Steps to reproduce

./tests/benchdnn/benchdnn --reorder  --sdt=u8 --ddt=f32 --stag=adbc --attr-zero-points=src:common:1 1x32x128x33

Observed behavior

benchdnn test fails.

Expected behavior

benchdnn test passes.

Ryo-not-rio commented 2 days ago

@Shreyas-fuj I noticed you contributed to Jit:uni recently. Could you have a look at this or tag the appropriate person for this? Thank you