8000 Clean up some more instructions · srcarroll/mmperf@8187179 · GitHub
[go: up one dir, main page]

Ski 8000 p to content

Commit 8187179

Browse files
committed
Clean up some more instructions
1 parent 473a4a6 commit 8187179

File tree

4 files changed

+30
-38
lines changed

4 files changed

+30
-38
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.vscode
2+
.env
3+
4+
build
5+
__pycache__
6+

LLVM-IR-E2E/README.md

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,6 @@
1-
To run examples you need to have:
2-
- tf-opt
3-
- mlir-hlo-opt
4-
- tf-mlir-translate
5-
- tf\_to\_kernel
6-
- tf\_to\_gpu\_binary
7-
- kernel-gen-opt
8-
- mlir-opt
9-
- mlir-tranlsate
10-
11-
using TF: da034876d3d1849f6328c9c05c918b506e62dd63\
12-
using LLVM: 0f6facca9701f6df87d13e55d70bd7111a0472aa
13-
14-
**Intalling TensorFlow Opt and Tools**:
15-
```sh
16-
git clone https://github.com/tensorflow/tensorflow
17-
cd tensorflow
18-
./configure #say N to every [y/N] execpt CUDA(that's up to you :))
19-
bazel build //tensorflow/compiler/mlir:tf-mlir-translate && bazel build //tensorflow/compiler/mlir:tf
20-
-opt && bazel build //tensorflow/compiler/mlir/tools/kernel_gen:kernel-gen-opt && bazel build //tenso
21-
rflow/compiler/mlir/hlo:mlir-hlo-opt && bazel build //tensorflow/compiler/mlir/tools/kernel_gen:tf_to
22-
_kernel && bazel build //tensorflow/compiler/mlir/tools/kernel_gen:tf_to_gpu_binary
23-
```
24-
**Intalling MLIR Tools**:
25-
```sh
26-
git clone https://github.com/llvm/llvm-project.git
27-
mkdir llvm-project/build
28-
cd llvm-project/build
29-
cmake -G Ninja ../llvm \
30-
-DLLVM_ENABLE_PROJECTS=mlir \
31-
-DLLVM_BUILD_EXAMPLES=ON \
32-
-DLLVM_TARGETS_TO_BUILD="X86;NVPTX;AMDGPU" \
33-
-DCMAKE_BUILD_TYPE=Release \
34-
-DLLVM_ENABLE_ASSERTIONS=ON \
35-
# -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_ENABLE_LLD=ON
36-
cmake --build . --target check-mlir
37-
```
1+
**Install Deps**
2+
See here to install deps via ./install_deps.sh
3+
https://github.com/NodLabs/mlir-examples
384

395
### How to run:
406
**TF Absolute CPU example(![#c5f015](https://via.placeholder.com/15/c5f015/000000?text=+) working)**

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,25 @@ A collection of MLIR End to End examples. We plan to add working examples of:
1111
* Use mlir-npcomp to generate ATen Dialect.
1212
* Lower to C++ / LLVM_IR (?)
1313

14+
**Intalling LLVM/MLIR and TF Dependencies**:
15+
```sh
16+
git clone https://github.com/NodLabs/mlir-examples.git
17+
mkdir mlir-examples/
18+
./install_deps.sh
19+
```
20+
Export the pre-built binaries into your path (you can also directly call the binaries)
21+
22+
```
23+
export PATH=`pwd`/build/install/bin:$PATH
24+
```
25+
26+
Now cd into one of the examples and give it a try.
27+
28+
```
29+
./build/install/bin/tf_to_kernel --input=LLVM-IR-E2E/tf_abs/tf_abs.mlir --output=abs_kernel.o
30+
31+
file abs_kernel.o
32+
```
33+
1434
# Other references
1535
https://llvm.discourse.group/t/print-in-mlir/1701/13

install_deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if [ ! -f ".tf_configure.bazelrc" ]; then
5959
./configure
6060
fi
6161
echo "TF configured... invoking bazel. If you dont have bazel .. download and install bazelisk"
62-
bazel build //tensorflow/compiler/mlir:tf-mlir-translate //tensorflow/compiler/mlir:tf-opt //tensorflow/compiler/mlir/tools/kernel_gen:kernel-gen-opt //tensorflow/compiler/mlir/hlo:mlir-hlo-opt //tensorflow/compiler/mlir/tools/kernel_gen:tf_to_kernel //tensorflow/compiler/mlir/tools/kernel_gen:tf_to_gpu_binary
62+
bazel build --config=cuda //tensorflow/compiler/mlir:tf-mlir-translate //tensorflow/compiler/mlir:tf-opt //tensorflow/compiler/mlir/tools/kernel_gen:kernel-gen-opt //tensorflow/compiler/mlir/hlo:mlir-hlo-opt //tensorflow/compiler/mlir/tools/kernel_gen:tf_to_kernel //tensorflow/compiler/mlir/tools/kernel_gen:tf_to_gpu_binary
6363

6464
ln -s ${TF_SRC_DIR}/bazel-bin/tensorflow/compiler/mlir/tf-mlir-translate $install_mlir/bin/
6565
ln -s ${TF_SRC_DIR}/bazel-bin/tensorflow/compiler/mlir/tf-opt $install_mlir/bin/

0 commit comments

Comments
 (0)
0