Skip to content

Commit 4d2819d

Browse files
committed
Update README to clarify openmp setup on RVV platform
1 parent 387ff4f commit 4d2819d

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

README.md

+18-15
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@ This repository provides examples of using the Buddy Compiler to run inference o
44

55
## Available Examples
66

7-
The table below lists the supported large models:
7+
The table below lists the supported models:
88

99
| Name | Build Target |
1010
| -------------- | ------------- |
1111
| DeepSeekR1 | `ninja deepseek-r1` |
1212

1313

14-
## How to Build
14+
## How to Build on x86
1515

1616
1. Set the `buddy-mlir` toolchain and PYTHONPATH environment variable:
17-
Make sure that the PYTHONPATH variable includes the directory of LLVM/MLIR python bindings and the directory of Buddy MLIR python packages.
1817

1918
```bash
2019
$ cd buddy-mlir/build
@@ -36,18 +35,25 @@ $ cmake -G Ninja .. \
3635
-DCMAKE_C_COMPILER=${LLVM_MLIR_BUILD_DIR}/bin/clang \
3736
-DCMAKE_CXX_FLAGS=-march=native \
3837
-DCMAKE_C_FLAGS=-march=native
39-
$ ninja <target>
40-
// For example:
41-
$ ninja deepseek-r1
42-
$ ./bin/<target>
38+
$ ninja <target> // For example: `ninja deepseek-r1`
39+
$ ./bin/<target> // Directly run the target
4340
```
4441

45-
### Cross Compile to Target Platform
42+
## Cross Compile to RVV Platform
4643

47-
**RISC-V Vector Extension**
44+
### Environmental Setup
4845

49-
Follow the [Environment Setup Guide for MLIR and RVV Testing and Experiments](https://github.com/buddy-compiler/buddy-mlir/blob/main/docs/RVVEnvironment.md) to prepare the RVV environment. Furthermore, To enable the openmp feature on RISC-V, you also need to refer to [Prepare RISC-V OpenMP ToolChain](https://github.com/buddy-compiler/buddy-benchmark/blob/main/docs/PrepareRVOpenMP.md).
46+
1. Follow the [Environment Setup Guide for MLIR and RVV Testing and Experiments](https://github.com/buddy-compiler/buddy-mlir/blob/main/docs/RVVEnvironment.md) to prepare the RVV environment.
5047

48+
2. Since the repository depends on OpenMP shared libraries, follow the steps below to set up the OpenMP dependency:
49+
50+
```bash
51+
$ cd ${LLVM_MLIR_BUILD_DIR}/../
52+
$ wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=1XEsAhOcMioN9gdufuyO9OrHIdR0UtHh2' -O build-omp-shared-rv.tar.gz
53+
$ mkdir build-omp-shared-rv && tar -xzf build-omp-shared-rv.tar.gz -C build-omp-shared-rv && rm build-omp-shared-rv.tar.gz
54+
```
55+
56+
### How to Build
5157
1. Set variables for the toolchain:
5258

5359
```bash
@@ -81,10 +87,7 @@ $ cmake -G Ninja .. \
8187
-DBUDDY_MLIR_BUILD_DIR=${BUDDY_MLIR_BUILD_DIR} \
8288
-DBUDDY_MLIR_BUILD_CROSS_DIR=${BUDDY_MLIR_BUILD_CROSS_DIR} \
8389
-DBUDDY_MLIR_CROSS_LIB_DIR=${BUDDY_MLIR_BUILD_CROSS_DIR}/lib
84-
85-
$ ninja <target>
86-
// For example:
87-
$ ninja deepseek-r1
90+
$ ninja <target> // For example: `ninja deepseek-r1`
8891
```
8992

90-
3. Transfer the compiled file in `build/bin/` to your target platform and run it.
93+
3. Transfer `build/bin/` directory to your RVV platform, then run `build/bin/<target>`.

0 commit comments

Comments
 (0)