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 <[email protected]>:

upgrading oneDNN version to 3.6

--
ed9992b5c01483118639e012c8f7fe161e964aae by Ashiq Imran <[email protected]>:

adding suggested change

--
367c8c8ba54b6c89852c0829cd918178837b0039 by Ashiq Imran <[email protected]>:

Update mkldnn_v1.BUILD
--
232890c357ab49da3dac93bd91b71fa1cb6bd2a6 by Ashiq Imran <[email protected]>:

Update mkldnn_v1.BUILD

adding spdlog into the include and textual hdrs list

Merging this change closes #77927

FUTURE_COPYBARA_INTEGRATE_REVIEW=tensorflow/tensorflow#77927 from Intel-tensorflow:aimran/oneDNN_3.6 232890c357ab49da3dac93bd91b71fa1cb6bd2a6
PiperOrigin-RevId: 696254899
  • Loading branch information
ashiqimranintel authored and Google-ML-Automation committed Nov 21, 2024
1 parent ebce390 commit 6a1867a
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 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,15 +6,19 @@ 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",
"#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",
"#cmakedefine DNNL_EXPERIMENTAL_SPARSE": "#define DNNL_EXPERIMENTAL_SPARSE",
"#cmakedefine DNNL_EXPERIMENTAL": "#undef DNNL_EXPERIMENTAL",
"#cmakedefine DNNL_EXPERIMENTAL_LOGGING": "#undef DNNL_EXPERIMENTAL_LOGGING",
"#cmakedefine01 BUILD_TRAINING": "#define BUILD_TRAINING 1",
"#cmakedefine01 BUILD_INFERENCE": "#define BUILD_INFERENCE 0",
"#cmakedefine01 BUILD_PRIMITIVE_ALL": "#define BUILD_PRIMITIVE_ALL 1",
Expand Down Expand Up @@ -51,6 +55,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 +99,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 All @@ -117,6 +130,11 @@ _INCLUDES_LIST = [
"src",
"src/common",
"src/common/ittnotify",
"src/common/spdlog",
"src/common/spdlog/details",
"src/common/spdlog/fmt",
"src/common/spdlog/fmt/bundled",
"src/common/spdlog/sinks",
"src/cpu",
"src/cpu/gemm",
"src/cpu/x64/xbyak",
Expand All @@ -127,6 +145,10 @@ _TEXTUAL_HDRS_LIST = glob([
"include/**/*",
"src/common/*.hpp",
"src/common/ittnotify/**/*.h",
"src/common/spdlog/*.h",
"src/common/spdlog/details/*.h",
"src/common/spdlog/fmt/**/*.h",
"src/common/spdlog/sinks/*.h",
"src/cpu/*.hpp",
"src/cpu/**/*.hpp",
"src/cpu/jit_utils/**/*.hpp",
Expand All @@ -143,6 +165,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 +209,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 6a1867a

Please sign in to comment.