Skip to content

Commit

Permalink
PR #77927: [oneDNN] upgrading oneDNN version to 3.6
Browse files Browse the repository at this point in the history
Imported from GitHub PR tensorflow/tensorflow#77927

This PR upgrades oneDNN version from v3.5 to v3.6, this PR has been tested on several models across different platforms including cascade-lake, sapphire-rapids, and granite-rapids

Several bug fixes have been resolved in this version. Details can be found here https://github.com/oneapi-src/oneDNN/releases
Copybara import of the project:

--
748ad53782ed53252ce154ba18e8259ca6a282c3 by Ashiq Imran <ashiq.imran@intel.com>:

upgrading oneDNN version to 3.6

--
ed9992b5c01483118639e012c8f7fe161e964aae by Ashiq Imran <ashiq.imran@intel.com>:

adding suggested change

Merging this change closes #77927

FUTURE_COPYBARA_INTEGRATE_REVIEW=tensorflow/tensorflow#77927 from Intel-tensorflow:aimran/oneDNN_3.6 ed9992b5c01483118639e012c8f7fe161e964aae
PiperOrigin-RevId: 686051615
  • Loading branch information
ashiqimranintel authored and Google-ML-Automation committed Oct 21, 2024
1 parent c5c29c1 commit 2010127
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions third_party/tsl/third_party/mkl_dnn/mkldnn_v1.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ exports_files(["LICENSE"])

_CMAKE_COMMON_LIST = {
"#cmakedefine DNNL_GPU_RUNTIME DNNL_RUNTIME_${DNNL_GPU_RUNTIME}": "#define DNNL_GPU_RUNTIME DNNL_RUNTIME_NONE",
"#cmakedefine DNNL_GPU_VENDOR DNNL_VENDOR_${DNNL_GPU_VENDOR}": "#define DNNL_VENDOR_NONE",
"#cmakedefine DNNL_USE_RT_OBJECTS_IN_PRIMITIVE_CACHE": "#undef DNNL_USE_RT_OBJECTS_IN_PRIMITIVE_CACHE",
"#cmakedefine DNNL_WITH_SYCL": "#undef DNNL_WITH_SYCL",
"#cmakedefine DNNL_SYCL_GENERIC": "#define DNNL_SYCL_GENERIC 1",
"#cmakedefine DNNL_WITH_LEVEL_ZERO": "#undef DNNL_WITH_LEVEL_ZERO",
"#cmakedefine DNNL_SYCL_CUDA": "#undef DNNL_SYCL_CUDA",
"#cmakedefine DNNL_SYCL_HIP": "#undef DNNL_SYCL_HIP",
"#cmakedefine DNNL_ENABLE_STACK_CHECKER": "#undef DNNL_ENABLE_STACK_CHECKER",
"#cmakedefine ONEDNN_BUILD_GRAPH": "#define ONEDNN_BUILD_GRAPH",
"#cmakedefine DNNL_DISABLE_GPU_REF_KERNELS": "#define DNNL_DISABLE_GPU_REF_KERNELS 0",
"#cmakedefine DNNL_EXPERIMENTAL_SPARSE": "#define DNNL_EXPERIMENTAL_SPARSE",
"#cmakedefine DNNL_EXPERIMENTAL": "#undef DNNL_EXPERIMENTAL",
"#cmakedefine01 BUILD_TRAINING": "#define BUILD_TRAINING 1",
Expand Down Expand Up @@ -51,6 +54,7 @@ _CMAKE_COMMON_LIST = {
"#cmakedefine01 BUILD_PRIMITIVE_GPU_ISA_ALL": "#define BUILD_PRIMITIVE_GPU_ISA_ALL 0",
"#cmakedefine01 BUILD_GEN9": "#define BUILD_GEN9 0",
"#cmakedefine01 BUILD_GEN11": "#define BUILD_GEN11 0",
"#cmakedefine01 BUILD_SDPA": "#define BUILD_SDPA 1",
"#cmakedefine01 BUILD_XE2": "#define BUILD_XE2 0",
"#cmakedefine01 BUILD_XELP": "#define BUILD_XELP 0",
"#cmakedefine01 BUILD_XEHPG": "#define BUILD_XEHPG 0",
Expand Down Expand Up @@ -94,13 +98,21 @@ expand_template(
out = "include/oneapi/dnnl/dnnl_version.h",
substitutions = {
"@DNNL_VERSION_MAJOR@": "3",
"@DNNL_VERSION_MINOR@": "5",
"@DNNL_VERSION_MINOR@": "6",
"@DNNL_VERSION_PATCH@": "0",
"@DNNL_VERSION_HASH@": "N/A",
},
template = "include/oneapi/dnnl/dnnl_version.h.in",
)

expand_template(
name = "dnnl_version_hash_h",
out = "include/oneapi/dnnl/dnnl_version_hash.h",
substitutions = {
"@DNNL_VERSION_HASH@": "N/A",
},
template = "include/oneapi/dnnl/dnnl_version_hash.h.in",
)

_COPTS_LIST = select({
"@xla//xla/tsl:windows": [],
"//conditions:default": ["-fexceptions"],
Expand Down Expand Up @@ -143,6 +155,7 @@ _TEXTUAL_HDRS_LIST = glob([
]) + [
":dnnl_config_h",
":dnnl_version_h",
":dnnl_version_hash_h",
]

# Large autogen files take too long time to compile with usual optimization
Expand Down Expand Up @@ -186,6 +199,7 @@ cc_library(
"src/cpu/aarch64/**",
"src/cpu/rv64/**",
"src/cpu/x64/gemm/**/*_kern_autogen.cpp",
"src/cpu/sycl/**",
],
),
copts = _COPTS_LIST,
Expand Down

0 comments on commit 2010127

Please sign in to comment.