Skip to content

Commit

Permalink
[Midend] Enhancements and Optimizations for batch matmul and convolut…
Browse files Browse the repository at this point in the history
…ion [Examples] Added MLIRLinalg Examples for Various Optimization Options. (#1)

* [examples] Add mobilenet example.

Co-authored-by: zhanghb97 <[email protected]>
Co-authored-by: qingqing12138 <[email protected]>

* [examples] Add examples for transformer-based model optimization.

* [examples] Add convolution optimization examples (buddy-compiler#333)


---------

Co-authored-by: FloatingcloudKnight <‘[email protected]’>

* bmm2mm 0.0

* [examples] Add attention loop and fusion example.

* [BuddyWhisper] Add whisper model example and Conv1d operation.

Co-authored-by: zhanghb97 <[email protected]>

* [examples] Add rtclock to attention fusion examples.

* [thirdparty] Add riscv-gnu-toolchain as an submodule.

* [RVV] Add RVV environment guide and update examples.

* [examples] Annotate the llama mlir code. (buddy-compiler#337)

* [thirdparty] Remove legacy RISC-V toolchain.

* [frontend] Update convolution groups feature. (buddy-compiler#338)

* [examples] Update Whisper README doc.

* [NFC] Make buddy tests and examples depends on mlir-cpu-runner (buddy-compiler#342)

* [examples] Add vector iteration example.

* [DAP/Whisper]Add Whisper Preprocessor. (buddy-compiler#313)

* [examples] Add MLIR CF example.

* [examples] Fix cf-iteration-exit filecheck.

* [example] Fix cf-iteration-exit example.

* [examples] Add sigmoid and rope case.

* tiling batch matmul

* tiling batch matmul

* [frontend] Add missing dependencies into DAP target. (buddy-compiler#357)

Ninja introduced different build graph algorithm in version v1.12.0,
which will required project to explicitly specify dependencies. Without
this commit, ninja v1.12.0 will not link mlir-translate and llc before the DAP
target and causing build failure.

* bmm tile try to remove redundant subview

* pass check

* bmm tile try to remove redundant subview

* bmm tile to vector.load/store

* buddy opt add(fake rvv version)

* bmm fuse for loop

* bmm m n border control add

* [Container] Use integrated audio decoding method.

* [examples] Use container to read audio file.

Co-authored-by: taiqzheng <[email protected]>

* [NFC] Fix warnings.

* [build system] use variable from LLVMConfig (buddy-compiler#359)

* [build system] use variable from LLVMConfig

In the previous build script, we always assumed that the binary and the
library are relative to the MLIR_DIR variable. But this prevents
buddy-mlir from properly packaging by the system. We should use the
LLVMConfig.cmake file to have a more flexible build system.

Signed-off-by: Avimitin <[email protected]>

* [python] add install target for buddy python modules

* [nix] update buddy-mlir derivation

Signed-off-by: Avimitin <[email protected]>

---------

Signed-off-by: Avimitin <[email protected]>

* [chore] fix typo in pass manager (buddy-compiler#360)

Signed-off-by: Avimitin <[email protected]>

* [container] Add initial standalone image container.

* remove rvv

* add int support

* [examples] Add initial GPU matmul transform example.

* [examples] Add conv2d-nhwc-fhwc manual vectorization.

* [Container] Add encoder for wav audio format. (buddy-compiler#366)

* [examples] Fix rvv intrinsic.

* [midend] Fix batch matmul vectorization pass.

* [example] Fix typo.

* [examples] LeNet E2E pipeline uses batchmatmul-optimize pass.

* [examples] Fix LeNet E2E pipeline.

* [examples] Add memref type generation example.

* [NFC] Fix typo.

* [Docs] Add Python Virtual Environment Setup Guide. (buddy-compiler#373)

* [examples] Update module generation example.

* add conv nhwc

* add conv nhwc

* oc bug repair

* [Examples] Adapt Audio Container for dap examples. (buddy-compiler#369)

* [Examples] Adapt the new Audio Container for 'buddy-whisper-preprocess' example.

* [Examples] Adapt the new Audio container for 'buddy-biquad' example.

* [Examples] Adapt the new Audio Container for 'buddy-fir' example.

* [Examples] Adapt the new Audio Container for 'buddy-iir-scalar' example.

* [Examples] Adapt the new Audio Container for 'buddy-iir-vectorization' example.

* [DAP] Merge 'BuddyLibDAPVectorization' library into 'BuddyLibDAP' library.

* [Container] Update the Audio container to support converting a MemRef (base class) object to an Audio (derived class) object.

* [Examples] Adapt the new constructor in the Audio Container to facilitate the conversion of a MemRef object to an Audio object.

* [Container] Handle corner case for NaN. Reset NaN to 1.

* conv2d +dilation,strides

* conv2d +tilling

* fixed int float determine

* conv2d to forall

* clear useless commits

* conv2d pass float test

* add bmm scf

* add depthwise

* add depthwise correct

* [DAP/Whisper] Extract RFFT operation from 'dap.whisper_preprocess'. (buddy-compiler#379)

* [DAP/Whisper] Remove 'memref.copy' operation in 'dap.whisper_preprocess'.

* [DAP] Extract RFFT400Op from 'dap.whisper_preprocess'.

* for dev merge

* [examples] add MLIRLinalg example for options: 1.conv-nhwc-fhwc-optimize 2.conv-nhwc-fhwc-tile-optimize  3.depthwise-conv-nhwc-hwc-optimize 4.batchmatmul-tile-optimize 5.batchmatmul-scf-optimize . Example mlir:   batchmatmul conv2d_nhwc_fhwc depthwise_conv_2d_nhwc_hwc

* [examples] add MLIRLinalg example for options: 1.conv-nhwc-fhwc-optimize 2.conv-nhwc-fhwc-tile-optimize  3.depthwise-conv-nhwc-hwc-optimize 4.batchmatmul-tile-optimize 5.batchmatmul-scf-optimize . Example mlir:   batchmatmul conv2d_nhwc_fhwc depthwise_conv_2d_nhwc_hwc

* Update .gitmodules

* Update .gitignore

* [Midend] Enhancements and Optimizations for batch matmul and convolution  [Examples] Added MLIRLinalg Examples for Various Optimization Options

* [Midend] Enhancements and Optimizations for batch matmul and convolution [Examples] Added MLIRLinalg Examples for Various Optimization Options. fixed thirdparty.

* [Examples] Added MLIRLinalg Examples for Various Optimization Options.  linalg-batch-matmul-dync.mlir fixed .

---------

Signed-off-by: Avimitin <[email protected]>
Co-authored-by: WuXintong123 <[email protected]>
Co-authored-by: zhanghb97 <[email protected]>
Co-authored-by: qingqing12138 <[email protected]>
Co-authored-by: FloatingcloudKnight <[email protected]>
Co-authored-by: FloatingcloudKnight <‘[email protected]’>
Co-authored-by: Weijia <[email protected]>
Co-authored-by: effrey-liu <[email protected]>
Co-authored-by: Wu Xintong <[email protected]>
Co-authored-by: Kiva <[email protected]>
Co-authored-by: Taiqi Zheng <[email protected]>
Co-authored-by: Jiongjia Lu <[email protected]>
Co-authored-by: taiqzheng <[email protected]>
Co-authored-by: ShiHaoGao <[email protected]>
  • Loading branch information
14 people authored Sep 26, 2024
1 parent 61de7a5 commit 94d7db2
Show file tree
Hide file tree
Showing 152 changed files with 68,143 additions and 1,034 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@

# Clangd cache
.cache

# Clangd configurations
.clangd
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
path = thirdparty/mimalloc
url = https://github.com/microsoft/mimalloc.git
shallow = true
[submodule "thirdparty/riscv-gnu-toolchain"]
path = thirdparty/riscv-gnu-toolchain
url = https://github.com/riscv-collab/riscv-gnu-toolchain.git
shallow = true
42 changes: 29 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ project(buddy-mlir LANGUAGES CXX C)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
include(ExternalProject)

#-------------------------------------------------------------------------------
# Options and settings
Expand All @@ -41,13 +42,15 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR BUDDY_MLIR_OUT_OF_TREE_
message(STATUS "Using MLIRConfig.cmake in: ${MLIR_DIR}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")

set(LLVM_MLIR_BINARY_DIR ${MLIR_DIR}/../../../bin)
set(LLVM_MLIR_LIBRARY_DIR ${MLIR_DIR}/../../../lib)
set(LLVM_PROJECT_BUILD_DIR ${MLIR_DIR}/../../../)
if(NOT DEFINED LLVM_PROJECT_SOURCE_DIR)
get_filename_component(LLVM_PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/llvm/ ABSOLUTE)
# LLVM_MAIN_SRC_DIR is a private variable for the LLVM in-tree build.
# To provide compatibility for unifying the one-step and two-step build,
# we set LLVM_MAIN_SRC_DIR ourselves here.
# This could benefit users who want to specify a custom LLVM source directory,
# but also not interfere with normal users who just want to use the buddy-mlir provided LLVM sources.
if(NOT DEFINED LLVM_MAIN_SRC_DIR)
get_filename_component(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/llvm/llvm ABSOLUTE)
endif()
set(LLVM_MLIR_SOURCE_DIR ${LLVM_PROJECT_SOURCE_DIR}/mlir)
set(MLIR_MAIN_SRC_DIR ${LLVM_MAIN_SRC_DIR}/../mlir)

list(APPEND CMAKE_MODULE_PATH "${MLIR_CMAKE_DIR}")
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
Expand All @@ -65,16 +68,9 @@ else()
#-------------------------------------------------------------------------------
# MLIR/LLVM Configuration
#-------------------------------------------------------------------------------

# Allow using out-of-tree llvm directory
set(LLVM_PROJECT_SOURCE_DIR ${LLVM_MAIN_SRC_DIR}/..)
message(STATUS "Using LLVM Project ${LLVM_PROJECT_SOURCE_DIR}")

set(MLIR_MAIN_SRC_DIR ${LLVM_MAIN_SRC_DIR}/../mlir)
set(MLIR_INCLUDE_DIR ${MLIR_MAIN_SRC_DIR}/include)
set(MLIR_GENERATED_INCLUDE_DIR ${LLVM_BINARY_DIR}/tools/mlir/include)
set(LLVM_MLIR_BINARY_DIR ${CMAKE_BINARY_DIR}/bin)
set(MLIR_INCLUDE_DIRS "${MLIR_INCLUDE_DIR};${MLIR_GENERATED_INCLUDE_DIR}")
endif()

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -188,6 +184,24 @@ if(BUDDY_MLIR_USE_MIMALLOC)
find_package(mimalloc REQUIRED)
endif()

#-------------------------------------------------------------------------------
# The RISC-V toolchain
#-------------------------------------------------------------------------------

if(BUDDY_MLIR_ENABLE_RISCV_GNU_TOOLCHAIN)
set(RISCV_GNU_TOOLCHAIN_DIR "${BUDDY_SOURCE_DIR}/thirdparty/riscv-gnu-toolchain")
set(RISCV_GNU_TOOLCHAIN_INSTALL_DIR "${CMAKE_BINARY_DIR}/thirdparty/riscv-gnu-toolchain")
ExternalProject_Add(
riscv-gnu-toolchain
SOURCE_DIR ${RISCV_GNU_TOOLCHAIN_DIR}
PREFIX ${RISCV_GNU_TOOLCHAIN_INSTALL_DIR}
CONFIGURE_COMMAND ${RISCV_GNU_TOOLCHAIN_DIR}/configure --prefix=${RISCV_GNU_TOOLCHAIN_INSTALL_DIR}
BUILD_COMMAND make clean && make linux build-qemu -j
BUILD_IN_SOURCE TRUE
INSTALL_COMMAND ""
)
endif()

#-------------------------------------------------------------------------------
# Initialize Python packages
#-------------------------------------------------------------------------------
Expand All @@ -201,6 +215,8 @@ if(BUDDY_MLIR_ENABLE_PYTHON_PACKAGES)
# Create empty __init__.py files to make these directories Python packages
file(WRITE ${BUDDY_MLIR_PYTHON_PACKAGES_DIR}/buddy/__init__.py "")
file(WRITE ${BUDDY_MLIR_PYTHON_PACKAGES_DIR}/buddy/compiler/__init__.py "")

install(DIRECTORY ${BUDDY_MLIR_PYTHON_PACKAGES_DIR}/buddy DESTINATION python_packages)
endif()

#-------------------------------------------------------------------------------
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ If you want to add domain-specific framework support, please add the following c
| -------------- | ------------- | ------------- |
| OpenCV | `-DBUDDY_ENABLE_OPENCV=ON` | Add `-DOpenCV_DIR=</PATH/TO/OPENCV/BUILD/>` or install OpenCV release version on your local device. |

To build buddy-mlir with custom LLVM sources:

```
$ cmake -G Ninja .. \
-DMLIR_DIR=PATH/TO/LLVM/lib/cmake/mlir \
-DLLVM_DIR=PATH/TO/LLVM/lib/cmake/llvm \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_BUILD_TYPE=RELEASE \
-DLLVM_MAIN_SRC_DIR=PATH/TO/LLVM_SOURCE
```

<h3 id="one-step">One-step building strategy</h3>

If you only want to use our tools and integrate them more easily into your projects, you can choose to use the one-step build strategy.
Expand Down Expand Up @@ -134,7 +145,7 @@ This repository have nix flake support. You can follow the [nix installation ins
nix develop .
```

This will setup a bash shell with `clang`, `clangd`, `cmake`, `ninja`, and other necessary dependencies to build buddy-mlir from source.
This will setup a bash shell with `clang`, `ccls`, `cmake`, `ninja`, and other necessary dependencies to build buddy-mlir from source.

- If you want to use the buddy-mlir bintools

Expand Down
2 changes: 1 addition & 1 deletion backend/include/llvm/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include_directories(${LLVM_PROJECT_SOURCE_DIR}/llvm/include/llvm/IR/)
include_directories(${LLVM_MAIN_SRC_DIR}/include/llvm/IR/)

set(LLVM_TARGET_DEFINITIONS IntrinsicsBuddyExt.td)
tablegen(LLVM IntrinsicImpl.inc -gen-intrinsic-impl)
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Analysis_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Analysis)
set(LLVM_Analysis_DIR ${LLVM_MAIN_SRC_DIR}/lib/Analysis)

add_llvm_component_library(LLVMBuddyAnalysis

Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/AsmParser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AsmParser

set(LLVM_AsmParser_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/AsmParser)
set(LLVM_AsmParser_DIR ${LLVM_MAIN_SRC_DIR}/lib/AsmParser)

add_llvm_component_library(LLVMBuddyAsmParser
${LLVM_AsmParser_DIR}/LLLexer.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Bitcode/Reader/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Reader_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Bitcode/Reader)
set(LLVM_Reader_DIR ${LLVM_MAIN_SRC_DIR}/lib/Bitcode/Reader)

add_llvm_component_library(LLVMBuddyBitReader
${LLVM_Reader_DIR}/BitcodeAnalyzer.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Bitcode/Writer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Writer_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Bitcode/Writer)
set(LLVM_Writer_DIR ${LLVM_MAIN_SRC_DIR}/lib/Bitcode/Writer)


add_llvm_component_library(LLVMBuddyBitWriter
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_AsmPrinter_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/CodeGen/AsmPrinter)
set(LLVM_AsmPrinter_DIR ${LLVM_MAIN_SRC_DIR}/lib/CodeGen/AsmPrinter)

add_llvm_component_library(LLVMBuddyAsmPrinter
${LLVM_AsmPrinter_DIR}/AccelTable.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/CodeGen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_CodeGen_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/CodeGen)
set(LLVM_CodeGen_DIR ${LLVM_MAIN_SRC_DIR}/lib/CodeGen)

add_llvm_component_library(LLVMBuddyCodeGen
${LLVM_CodeGen_DIR}/AggressiveAntiDepBreaker.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/CodeGen/MIRParser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_MIRParser_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/CodeGen/MIRParser)
set(LLVM_MIRParser_DIR ${LLVM_MAIN_SRC_DIR}/lib/CodeGen/MIRParser)

add_llvm_component_library(LLVMBuddyMIRParser
${LLVM_MIRParser_DIR}/MILexer.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_SelectionDAG_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/CodeGen/SelectionDAG)
set(LLVM_SelectionDAG_DIR ${LLVM_MAIN_SRC_DIR}/lib/CodeGen/SelectionDAG)

add_llvm_component_library(LLVMBuddySelectionDAG
${LLVM_SelectionDAG_DIR}/DAGCombiner.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_IR_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/IR)
set(LLVM_IR_DIR ${LLVM_MAIN_SRC_DIR}/lib/IR)

add_llvm_component_library(LLVMBuddyCore
${LLVM_IR_DIR}/AbstractCallSite.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/IRReader/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_IRReader_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/IRReader)
set(LLVM_IRReader_DIR ${LLVM_MAIN_SRC_DIR}/lib/IRReader)

add_llvm_component_library(LLVMBuddyIRReader
${LLVM_IRReader_DIR}/IRReader.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Object/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Object_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Object)
set(LLVM_Object_DIR ${LLVM_MAIN_SRC_DIR}/lib/Object)

add_llvm_component_library(LLVMBuddyObject
${LLVM_Object_DIR}/Archive.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/ProfileData/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_ProfileData_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/ProfileData)
set(LLVM_ProfileData_DIR ${LLVM_MAIN_SRC_DIR}/lib/ProfileData)

add_llvm_component_library(LLVMBuddyProfileData
${LLVM_ProfileData_DIR}/GCOV.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Remarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Remarks_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Remarks)
set(LLVM_Remarks_DIR ${LLVM_MAIN_SRC_DIR}/lib/Remarks)

add_llvm_component_library(LLVMBuddyRemarks
${LLVM_Remarks_DIR}/BitstreamRemarkParser.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Target/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ list(APPEND LLVM_COMMON_DEPENDS buddy_intrinsics_gen)

list(APPEND LLVM_TABLEGEN_FLAGS -I ${LLVM_MAIN_SRC_DIR}/lib/Target)

set(LLVM_Target_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Target)
set(LLVM_Target_DIR ${LLVM_MAIN_SRC_DIR}/lib/Target)

add_llvm_component_library(LLVMBuddyTarget
${LLVM_Target_DIR}/Target.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Target/RISCV/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ macro(buddy_add_llvm_target target_name)
set( CURRENT_LLVM_TARGET LLVM${target_name} )
endmacro(buddy_add_llvm_target)

set(LLVM_TARGET_RISCV_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Target/RISCV)
set(LLVM_TARGET_RISCV_DIR ${LLVM_MAIN_SRC_DIR}/lib/Target/RISCV)

# ------------------------------------------------------------------------------
# Configure RISC-V Buddy Extension.
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Transforms/IPO/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_IPO_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Transforms/IPO)
set(LLVM_IPO_DIR ${LLVM_MAIN_SRC_DIR}/lib/Transforms/IPO)

add_llvm_component_library(LLVMBuddyIPO
${LLVM_IPO_DIR}/AlwaysInliner.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Transforms/Scalar/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Scalar_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Transforms/Scalar)
set(LLVM_Scalar_DIR ${LLVM_MAIN_SRC_DIR}/lib/Transforms/Scalar)

add_llvm_component_library(LLVMBuddyScalarOpts
${LLVM_Scalar_DIR}/ADCE.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Transforms/Utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Utils_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Transforms/Utils)
set(LLVM_Utils_DIR ${LLVM_MAIN_SRC_DIR}/lib/Transforms/Utils)


add_llvm_component_library(LLVMBuddyTransformUtils
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Transforms/Vectorize/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Vectorize_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Transforms/Vectorize)
set(LLVM_Vectorize_DIR ${LLVM_MAIN_SRC_DIR}/lib/Transforms/Vectorize)

add_llvm_component_library(LLVMBuddyVectorize
${LLVM_Vectorize_DIR}/LoadStoreVectorizer.cpp
Expand Down
10 changes: 10 additions & 0 deletions docs/PythonEnvironment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Python Virtual Environment Setup Guide for Buddy-mlir

We recommend you to use anaconda3 to create python virtual environment. You should install python packages as buddy-mlir/requirements.

```bash
$ conda create -n <your virtual environment name> python=3.11
$ conda activate <your virtual environment name>
$ cd buddy-mlir
$ pip install -r requirements.txt
```
Loading

0 comments on commit 94d7db2

Please sign in to comment.