PR #15491: [XLA:CPU][oneDNN] Enable oneDNN Graph build

Imported from GitHub PR https://github.com/openxla/xla/pull/15491

This PR enables oneDNN Graph functionality in oneDNN library which is a prep work for supporting fusions such as MHA via oneDNN graph.
Copybara import of the project:

--
06aed953869b5a91f9d2618d5d36eee372a9a18a by Yimei Sun <yimei.sun@intel.com>:

[XLA:CPU][oneDNN] Enable oneDNN Graph build
This PR enables oneDNN Graph functionality in oneDNN library which is a prep work for supporting fusions
such as MHA via oneDNN graph.

Merging this change closes #15491

PiperOrigin-RevId: 659891498
This commit is contained in:
Yimei Sun 2024-08-06 03:43:24 -07:00 committed by TensorFlower Gardener
parent f08b4eaa84
commit bd213ccfc8
2 changed files with 44 additions and 2 deletions

View File

@ -12,7 +12,7 @@ _CMAKE_COMMON_LIST = {
"#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": "#undef ONEDNN_BUILD_GRAPH",
"#cmakedefine ONEDNN_BUILD_GRAPH": "#define ONEDNN_BUILD_GRAPH",
"#cmakedefine DNNL_EXPERIMENTAL_SPARSE": "#define DNNL_EXPERIMENTAL_SPARSE",
"#cmakedefine DNNL_EXPERIMENTAL": "#undef DNNL_EXPERIMENTAL",
"#cmakedefine01 BUILD_TRAINING": "#define BUILD_TRAINING 1",
@ -109,6 +109,7 @@ _COPTS_LIST = select({
"-UUSE_CBLAS",
"-DDNNL_ENABLE_MAX_CPU_ISA",
"-DDNNL_ENABLE_ITT_TASKS",
"-DDNNL_ENABLE_GRAPH_DUMP",
] + tf_openmp_copts()
_INCLUDES_LIST = [
@ -119,6 +120,7 @@ _INCLUDES_LIST = [
"src/cpu",
"src/cpu/gemm",
"src/cpu/x64/xbyak",
"src/graph",
]
_TEXTUAL_HDRS_LIST = glob([
@ -129,6 +131,15 @@ _TEXTUAL_HDRS_LIST = glob([
"src/cpu/**/*.hpp",
"src/cpu/jit_utils/**/*.hpp",
"src/cpu/x64/xbyak/*.h",
"src/graph/interface/*.hpp",
"src/graph/backend/*.hpp",
"src/graph/backend/dnnl/*.hpp",
"src/graph/backend/fake/*.hpp",
"src/graph/backend/dnnl/passes/*.hpp",
"src/graph/backend/dnnl/patterns/*.hpp",
"src/graph/backend/dnnl/kernels/*.hpp",
"src/graph/utils/*.hpp",
"src/graph/utils/pm/*.hpp",
]) + [
":dnnl_config_h",
":dnnl_version_h",
@ -160,6 +171,16 @@ cc_library(
"src/cpu/**/*.cpp",
"src/common/ittnotify/*.c",
"src/cpu/jit_utils/**/*.cpp",
"src/cpu/x64/**/*.cpp",
"src/graph/interface/*.cpp",
"src/graph/backend/*.cpp",
"src/graph/backend/dnnl/*.cpp",
"src/graph/backend/fake/*.cpp",
"src/graph/backend/dnnl/passes/*.cpp",
"src/graph/backend/dnnl/patterns/*.cpp",
"src/graph/backend/dnnl/kernels/*.cpp",
"src/graph/utils/*.cpp",
"src/graph/utils/pm/*.cpp",
],
exclude = [
"src/cpu/aarch64/**",

View File

@ -12,7 +12,7 @@ _CMAKE_COMMON_LIST = {
"#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": "#undef ONEDNN_BUILD_GRAPH",
"#cmakedefine ONEDNN_BUILD_GRAPH": "#define ONEDNN_BUILD_GRAPH",
"#cmakedefine DNNL_EXPERIMENTAL_SPARSE": "#define DNNL_EXPERIMENTAL_SPARSE",
"#cmakedefine DNNL_EXPERIMENTAL": "#undef DNNL_EXPERIMENTAL",
"#cmakedefine01 BUILD_TRAINING": "#define BUILD_TRAINING 1",
@ -109,6 +109,7 @@ _COPTS_LIST = select({
"-UUSE_CBLAS",
"-DDNNL_ENABLE_MAX_CPU_ISA",
"-DDNNL_ENABLE_ITT_TASKS",
"-DDNNL_ENABLE_GRAPH_DUMP",
] + tf_openmp_copts()
_INCLUDES_LIST = [
@ -119,6 +120,7 @@ _INCLUDES_LIST = [
"src/cpu",
"src/cpu/gemm",
"src/cpu/x64/xbyak",
"src/graph",
]
_TEXTUAL_HDRS_LIST = glob([
@ -129,6 +131,15 @@ _TEXTUAL_HDRS_LIST = glob([
"src/cpu/**/*.hpp",
"src/cpu/jit_utils/**/*.hpp",
"src/cpu/x64/xbyak/*.h",
"src/graph/interface/*.hpp",
"src/graph/backend/*.hpp",
"src/graph/backend/dnnl/*.hpp",
"src/graph/backend/fake/*.hpp",
"src/graph/backend/dnnl/passes/*.hpp",
"src/graph/backend/dnnl/patterns/*.hpp",
"src/graph/backend/dnnl/kernels/*.hpp",
"src/graph/utils/*.hpp",
"src/graph/utils/pm/*.hpp",
]) + [
":dnnl_config_h",
":dnnl_version_h",
@ -160,6 +171,16 @@ cc_library(
"src/cpu/**/*.cpp",
"src/common/ittnotify/*.c",
"src/cpu/jit_utils/**/*.cpp",
"src/cpu/x64/**/*.cpp",
"src/graph/interface/*.cpp",
"src/graph/backend/*.cpp",
"src/graph/backend/dnnl/*.cpp",
"src/graph/backend/fake/*.cpp",
"src/graph/backend/dnnl/passes/*.cpp",
"src/graph/backend/dnnl/patterns/*.cpp",
"src/graph/backend/dnnl/kernels/*.cpp",
"src/graph/utils/*.cpp",
"src/graph/utils/pm/*.cpp",
],
exclude = [
"src/cpu/aarch64/**",