You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
oneDNN validation for Nvidia backend hits a correctness issue on backward batch normalization with shift and scale under benchdnn.
Version
Latest master.
Environment
Hardware:
NVIDIA A100 80GB PCIe
(A10 should also work for most cases).
Software
SYCL Compiler with Nvidia support.
Any version that compiles without issues, preferable no later than April.
[Optional] TBB
Any version.
[Optional] OpenCL CPU
Latest version is preferable.
Optional means that CPU backend can be enabled if dependency is satisfied. Otherwise, should be switched off.
For a full suite validation, use --batch=test_bnorm_gpu instead of a specific test case.
Helper env vars:
CUDA_LOGINFO_DBG=1 CUDA_LOGDEST_DBG=stdout -- enables cuda API dump
CUDNN_LOGINFO_DBG=1 CUDNN_LOGDEST_DBG=stdout -- enables cudnn API dump
DNNL_VERBOSE=all (or desired level) -- enables oneDNN execution information
Helper tips:
benchdnn supports verbosity through -vX. Most info is available at v6. It's possible to dump destination with -v99 when really needed.
benchdnn documentation is here: https://github.com/oneapi-src/oneDNN/tree/master/tests/benchdnn (scroll down). Reorder doc and others may be found through links.
benchdnn binary also supports --help command, which will tip to use --bnorm --help to dump all supported options.
Observed behavior
Failures are reproducible within a single run, there are total of 8 failures of similar nature.
The output means that diff_shift and diff_src were not computed properly. Suggest to check what's going with diff_shift first, because this is just a diff_dst reduction over the channel dimension and should be easier to figure out than diff_src issue.
When dumping each point with -v99, the output is like this:
dzarukin
added
bug
A confirmed library bug
and removed
sighting
Suspicious library behavior. Should be promoted to a bug when confirmed
labels
Sep 14, 2023
dzarukin
changed the title
[nvidia] batch normalization primitive fails correctness check, case 1
[nvidia] batch normalization primitive fails correctness check
Sep 15, 2023
To summarise, the forward pass of batchnorm calculates means close to the expected value but there is still a difference of near zero values. Hence, because the src for the forward batchnorm has values equal to the expected mean, the output of the forward batchnorm has close to but not zero values (2.98e-8 to be exact) for those entries when they were expected to be zero. Thus, these values are propagated to the backwards pass and cause a gradient from dy to be propagated to dx from the relu backward pass which causes the error that was found.
As discussed offline, we won't be making any changes to benchdnn to account for this issue. Is there any further analysis or work for this issue or can we close it?
Summary
oneDNN validation for Nvidia backend hits a correctness issue on backward batch normalization with shift and scale under benchdnn.
Version
Latest master.
Environment
Hardware:
NVIDIA A100 80GB PCIe
(A10 should also work for most cases).
Software
SYCL Compiler with Nvidia support.
Any version that compiles without issues, preferable no later than April.
[Optional] TBB
Any version.
[Optional] OpenCL CPU
Latest version is preferable.
Steps to reproduce
Build
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=release (or debug) -DDNNL_CPU_RUNTIME=DPCPP (or NONE) -DDNNL_GPU_RUNTIME=DPCPP -DDNNL_GPU_VENDOR=NVIDIA -DONEDNN_BUILD_GRAPH=OFF
cmake --build . --target benchdnn
Run
<env_vars> ./build/tests/benchdnn/benchdnn --bnorm --engine=gpu --dir=BWD_DW --flags=CHR mb16ic64ih147
For a full suite validation, use
--batch=test_bnorm_gpu
instead of a specific test case.Helper env vars:
CUDA_LOGINFO_DBG=1 CUDA_LOGDEST_DBG=stdout -- enables cuda API dump
CUDNN_LOGINFO_DBG=1 CUDNN_LOGDEST_DBG=stdout -- enables cudnn API dump
DNNL_VERBOSE=all (or desired level) -- enables oneDNN execution information
Helper tips:
benchdnn supports verbosity through -vX. Most info is available at v6. It's possible to dump destination with -v99 when really needed.
benchdnn documentation is here: https://github.com/oneapi-src/oneDNN/tree/master/tests/benchdnn (scroll down). Reorder doc and others may be found through links.
benchdnn binary also supports
--help
command, which will tip to use--bnorm --help
to dump all supported options.Observed behavior
Failures are reproducible within a single run, there are total of 8 failures of similar nature.
The output means that diff_shift and diff_src were not computed properly. Suggest to check what's going with diff_shift first, because this is just a diff_dst reduction over the channel dimension and should be easier to figure out than diff_src issue.
When dumping each point with -v99, the output is like this:
A single point value is incorrect.
Expected behavior
The issue is not appearing during the single run validation nor under full batch.
The text was updated successfully, but these errors were encountered: