Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[BUGFIX] Fix accuracy issue due to reuse of primitives for MKLDNN-AArch64. Fixes #20265. #20482

Merged
merged 1 commit into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ if(USE_MKLDNN)
# Also ACL_ROOT_DIR need to be set
set(CMAKE_CXX_STANDARD 14)
set(DNNL_AARCH64_USE_ACL ON CACHE INTERNAL "" FORCE)
add_definitions(-DDNNL_AARCH64_USE_ACL=1)
endif()
if (MKLDNN_USE_APL)
# APL needs to be added to LD_LIBRARY_PATH
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ List of Contributors
* [Zhaoqi Zhu](https://github.com/zha0q1)
* [Harshit Sharma](https://github.com/harshitshrma)
* [Andrzej Kotlowski](https://github.com/anko-intel)
* [Crefeda Faviola Rodrigues](https://github.com/cfRod)

Label Bot
---------
Expand Down
11 changes: 11 additions & 0 deletions src/operator/operator_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,12 @@ class OpSignature {
hash = hash * 2 + arr.dtype();
eles.push_back(arr.dtype());
AddSign(arr.shape());
// Note:Temporary workaround for the accuracy issue noted here #20265.
// Future releases of Compute Library will aim to fix this.
#if DNNL_AARCH64_USE_ACL == 1
auto ival = reinterpret_cast<const uint64_t>(arr.storage_handle().dptr);
AddSign(ival);
#endif
szha marked this conversation as resolved.
Show resolved Hide resolved
#if MXNET_USE_MKLDNN == 1
}
#endif
Expand All @@ -643,6 +649,11 @@ class OpSignature {
eles.push_back(val);
}

void AddSign(uint64_t val) {
hash = hash * 2 + val;
eles.push_back(val);
}

void AddSign(float val) {
hash = dmlc::HashCombine(hash, val);
eles.push_back(val);
Expand Down