-
Notifications
You must be signed in to change notification settings - Fork 17
Update readme. Add build instructions #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
877b923
add cpu runner
70468bb
Merge branch 'main' of https://github.com/intel/graph-compiler into y…
096a88c
dyn link
5fc3f3a
stash
e752dd6
fix
b152188
Merge branch 'yijie/add-cpu-runner' into yijie/dyn_link
98553a3
fix
dd39dc0
fix
e96b040
fix
eea64fb
Merge branch 'yijie/add-cpu-runner' into yijie/dyn_link
b975989
fix
6f8d4c7
Merge branch 'yijie/add-cpu-runner' into yijie/dyn_link
57c7e6c
fix
7935361
add link
8306108
remove if(NOT LLVM_LINK_LLVM_DYLIB)
772d072
remove replica
f1a1549
Merge branch 'main' of https://github.com/intel/graph-compiler into y…
4861a4c
rename
77698d8
update readme
6f4d766
update
7b70f33
remove clone
551844c
Merge branch 'main' of https://github.com/intel/graph-compiler into y…
7f8e8d7
Merge branch 'main' of https://github.com/intel/graph-compiler into y…
3dccf85
Merge branch 'yijie/dyn_link' into yijie/update_doc
dd80b41
Update README.md
2c73717
Update README.md
e7ac3ee
Update README.md
ca98872
Merge branch 'main' of https://github.com/intel/graph-compiler into y…
4f22e01
Merge branch 'yijie/update_doc' of https://github.com/intel/graph-com…
5871ab5
update llvm cmake
423eee9
update doc
9646b34
Merge branch 'main' into yijie/update_doc
1e47975
fix typo
ba83ac2
Merge branch 'yijie/update_doc' of https://github.com/intel/graph-com…
6911118
Update README.md
81405ec
Merge branch 'main' into yijie/update_doc
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,66 @@ | ||
# Graph Compiler | ||
Graph Compiler is in active development stage. | ||
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. | ||
|
||
The current frontend for Graph Compiler is [oneDNN Graph API](https://oneapi-src.github.io/oneDNN/graph_extension.html). | ||
|
||
## Build instructions | ||
|
||
### All-in-one compile script | ||
|
||
It is recommended for the users to use the all-in-one compile script at `scripts/compile.sh`. It downloads the LLVM dependency and builds the project. | ||
|
||
### Step-by-step build intructions | ||
|
||
To build this project step by step, first you need to find the LLVM commit-id we are using at `cmake/llvm-version.txt`. Then clone specific version of LLVM: | ||
|
||
```bash | ||
export LLVM_COMMIT_HASH=$(< cmake/llvm-version.txt) | ||
git clone https://github.com/llvm/llvm-project | ||
cd llvm-project | ||
git checkout $LLVM_COMMIT_HASH | ||
``` | ||
|
||
Build LLVM with the command lines given in `.github/workflows/build-llvm.yml`: | ||
|
||
```bash | ||
mkdir llvm-install | ||
cmake -G Ninja llvm -B build -DCMAKE_INSTALL_PREFIX=llvm-install \ | ||
-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=true -DLLVM_ENABLE_PROJECTS="mlir" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_INSTALL_UTILS=true -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_INSTALL_GTEST=ON | ||
cmake --build build --target install | ||
``` | ||
|
||
Notes | ||
* It is recommended to add optional options `-DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON` to the command `cmake -G Ninja llvm ...` above. These will enable the build of LLVM/MLIR dynamic libraries and let MLIR/LLVM tools link to them, to reduce the installed binary size of LLVM/MLIR. These options also enable the `GC_DEV_LINK_LLVM_DYLIB` option of graph-compiler repo (see below). | ||
* The option `-DLLVM_INSTALL_GTEST=ON` is optional, if the tests of graph-compiler are disabled (see `GC_TEST_ENABLE` below). | ||
|
||
We have now installed LLVM at `llvm-project/llvm-install`. | ||
|
||
Change working directory to graph-compiler repo and prepare the build directory: | ||
|
||
```bash | ||
cd /PATH/TO/graph-compiler | ||
mkdir build && cd build | ||
``` | ||
|
||
Build and run tests: | ||
|
||
```bash | ||
cmake .. -G Ninja \ | ||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
-DMLIR_DIR=/PATH/TO/llvm-project/llvm-install/lib/cmake/mlir \ | ||
-DLLVM_EXTERNAL_LIT=$(which lit) | ||
cmake --build . --target gc-check | ||
``` | ||
|
||
Notes: | ||
* `/PATH/TO/llvm-project/llvm-install` should be the install path of LLVM. If you installed LLVM elsewhere by `-DCMAKE_INSTALL_PREFIX` option when building LLVM, you need to change the path in `-DMLIR_DIR` accordingly. | ||
* The cmake option `-DLLVM_EXTERNAL_LIT` is for the tests of this project. It requires the `lit` tool to be installed in the system. You can install it via `pip install lit`. If you don't need to run the tests of this repo, you can omit this option in the command line. | ||
|
||
Graph Compiler supports the following build-time options. | ||
|
||
| CMake Option | Supported values (defaults in bold) | Description | | ||
|:--------------------------------|:---------------------------------------|:---------------------------------------------------------------------------------------| | ||
| GC_LEGACY_ENABLE | **ON**, OFF | Controls building the legacy graph-compiler component | | ||
| GC_TEST_ENABLE | **ON**, OFF | Controls building the tests | | ||
| GC_DEV_LINK_LLVM_DYLIB | ON, **OFF** | Controls dynamic link LLVM/MLIR libraries, mainly for developer | | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.