Skip to content

Commit c14c63d

Browse files
committed
update
2 parents bbc66a2 + d7e952e commit c14c63d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3029
-352
lines changed

.github/workflows/clang-tidy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
steps:
1616
- name: Install OpenMP
17-
run: "sudo apt install -y libomp-dev"
17+
run: "sudo apt install -y libomp-dev opencl-c-headers"
1818

1919
- name: Fetch sources
2020
uses: actions/checkout@v4

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,15 @@ get_property(GC_TOOLS GLOBAL PROPERTY GC_TOOLS)
9898
get_property(GC_MLIR_LIBS GLOBAL PROPERTY GC_MLIR_LIBS)
9999
get_property(GC_PASS_LIBS GLOBAL PROPERTY GC_PASS_LIBS)
100100
get_property(GC_DIALECT_LIBS GLOBAL PROPERTY GC_DIALECT_LIBS)
101+
get_property(IMEX_LIBS GLOBAL PROPERTY IMEX_LIBS)
102+
101103
install(TARGETS
102104
GcInterface
103105
${GC_TOOLS}
104106
${GC_MLIR_LIBS}
105107
${GC_PASS_LIBS}
106108
${GC_DIALECT_LIBS}
109+
${IMEX_LIBS}
107110
EXPORT ${PROJECT_NAME}Targets
108111
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
109112
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
[<img src="https://scan.coverity.com/projects/30281/badge.svg">](https://scan.coverity.com/projects/intel-graph-compiler)
22

33
# Graph Compiler
4-
Graph Compiler is an end-to-end, MLIR-based compiler designed to enhance the performance of deep learning workloads. It accepts computation graphs from the frontend, applies domain-specific optimizations and transformations, generates code, and manages runtime execution.
5-
6-
The current frontend for Graph Compiler is [oneDNN Graph API](https://oneapi-src.github.io/oneDNN/graph_extension.html).
4+
Graph Compiler is an end-to-end, MLIR-based compiler designed to enhance the performance of deep learning workloads. It accepts computation graphs from the frontend (primarily linalg on tensors), applies domain-specific optimizations and transformations, generates code, and manages runtime execution.
75

86
## Build instructions
97

cmake/functions.cmake

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,36 @@ function(gc_add_mlir_dialect_library name)
117117
if(GcInterface IN_LIST ARGN)
118118
target_link_libraries(obj.${name} PUBLIC GcInterface)
119119
endif()
120-
endfunction()
120+
endfunction()
121+
122+
macro(gc_add_mlir_tool name)
123+
# the dependency list copied from mlir/tools/mlir-cpu-runner/CMakeLists.txt of upstream
124+
if(NOT DEFINED LLVM_LINK_COMPONENTS)
125+
set(LLVM_LINK_COMPONENTS
126+
Core
127+
Support
128+
nativecodegen
129+
native
130+
)
131+
endif()
132+
if(NOT DEFINED MLIR_LINK_COMPONENTS)
133+
gc_set_mlir_link_components(MLIR_LINK_COMPONENTS
134+
MLIRAnalysis
135+
MLIRBuiltinToLLVMIRTranslation
136+
MLIRExecutionEngine
137+
MLIRIR
138+
MLIRJitRunner
139+
MLIRLLVMDialect
140+
MLIRLLVMToLLVMIRTranslation
141+
MLIRToLLVMIRTranslationRegistration
142+
MLIRParser
143+
MLIRTargetLLVMIRExport
144+
MLIRSupport
145+
)
146+
endif()
147+
add_mlir_tool(${ARGV})
148+
#LLVM_LINK_COMPONENTS is processed by LLVM cmake in add_llvm_executable
149+
target_link_libraries(${name} PRIVATE GcInterface ${MLIR_LINK_COMPONENTS})
150+
llvm_update_compile_flags(${name})
151+
set_property(GLOBAL APPEND PROPERTY GC_TOOLS ${name})
152+
endmacro()

cmake/imex-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8209807be6148d81fda6f439a01b77696986dd3e
1+
25123cc3692fdbcf837510f39de47ff353d482fc

cmake/imex.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ if (NOT DEFINED IMEX_INCLUDES)
1414

1515
# TODO: Change to main https://github.com/intel/mlir-extensions when all the
1616
# required functionality is merged.
17-
gc_fetch_content(imex "${IMEX_HASH}" https://github.com/intel/mlir-extensions
17+
set(IMEX_URL https://github.com/intel/mlir-extensions)
18+
gc_fetch_content(imex "${IMEX_HASH}" "${IMEX_URL}"
1819
SET IMEX_CHECK_LLVM_VERSION=ON IMEX_ENABLE_L0_RUNTIME=0
1920
)
2021

@@ -24,4 +25,5 @@ if (NOT DEFINED IMEX_INCLUDES)
2425
${imex_SOURCE_DIR}/src
2526
)
2627
set_property(GLOBAL PROPERTY IMEX_INCLUDES ${IMEX_INCLUDES})
28+
target_compile_options(GcInterface INTERFACE -DGC_USE_IMEX)
2729
endif ()

cmake/llvm-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3191587666aa3d1e53966bc8876614c7197fac4f
1+
f6a756f35a4d0719a96b4e214905369d565d87da

cmake/onednn_lite_config.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if(${DNNL_CPU_RUNTIME} STREQUAL "OMP")
2828
endif()
2929

3030
if(${DNNL_CPU_RUNTIME} STREQUAL "TBB")
31-
include("${DNNL_PATH}/cmake/TBB.cmake")
31+
find_package(TBB REQUIRED)
3232
endif()
3333

3434
########## copied from main cmake file of DNNL
File renamed without changes.

include/gc/Analysis/MatmulConfigAnalysis.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ struct MatmulConfig {
3333
uint32_t innerMostMBlock, innerMostNBlock, innerMostKBlock;
3434
};
3535

36+
bool validateConfig(const MatmulConfig &cfg, ArrayRef<uint32_t> shape,
37+
bool allowIndivisibleInnerblock, bool isVNNIMM2D);
38+
3639
enum DimType { Batch, M, N, K };
3740

3841
// Extract the index of the given DimType in the DimType list

0 commit comments

Comments
 (0)