Unverified Commit 01d207fa authored by Chaofan Lin's avatar Chaofan Lin Committed by GitHub
Browse files

[Installation] Fix building using customized TVM path (#1326)

parent 2a70fd3f
...@@ -3,12 +3,15 @@ ...@@ -3,12 +3,15 @@
set(TVM_BUILD_FROM_SOURCE TRUE) set(TVM_BUILD_FROM_SOURCE TRUE)
set(TVM_SOURCE ${CMAKE_SOURCE_DIR}/3rdparty/tvm) set(TVM_SOURCE ${CMAKE_SOURCE_DIR}/3rdparty/tvm)
if(DEFINED $ENV{TVM_ROOT}) if(DEFINED ENV{TVM_ROOT})
if(EXISTS $ENV{TVM_ROOT}/cmake/config.cmake) if(EXISTS $ENV{TVM_ROOT}/cmake/config.cmake)
set(TVM_SOURCE $ENV{TVM_ROOT}) set(TVM_SOURCE $ENV{TVM_ROOT})
message(STATUS "Using TVM_ROOT from environment variable: ${TVM_SOURCE}")
endif() endif()
endif() endif()
message(STATUS "Using TVM source: ${TVM_SOURCE}")
set(TVM_INCLUDES set(TVM_INCLUDES
${TVM_SOURCE}/include ${TVM_SOURCE}/include
${TVM_SOURCE}/src ${TVM_SOURCE}/src
......
...@@ -93,14 +93,16 @@ Some useful CMake options you can toggle while configuring: ...@@ -93,14 +93,16 @@ Some useful CMake options you can toggle while configuring:
(using-existing-tvm)= (using-existing-tvm)=
### Building with Existing TVM Installation ### Building with Customized TVM Path
If you already have a compatible TVM installation, use the `TVM_ROOT` environment variable to specify the location of your existing TVM repository when building tilelang: If you already have a TVM codebase, use the `TVM_ROOT` environment variable to specify the location of your existing TVM repository when building tilelang:
```bash ```bash
TVM_ROOT=<your-tvm-repo> pip install . -v TVM_ROOT=<your-tvm-repo> pip install . -v
``` ```
> **Note**: This will still rebuild the TVM-related libraries (stored in `TL_LIBS`). And this method often leads to some path issues. Check `env.py` to see some environment variables which are not set properly.
(install-using-docker)= (install-using-docker)=
## Install Using Docker ## Install Using Docker
...@@ -197,8 +199,7 @@ Set `NO_TOOLCHAIN_VERSION=ON` to disable this. ...@@ -197,8 +199,7 @@ Set `NO_TOOLCHAIN_VERSION=ON` to disable this.
### Run-time environment variables ### Run-time environment variables
<!-- TODO: tvm --> Please refer to the `env.py` file for a full list of supported run-time environment variables.
TODO
## Other Tips ## Other Tips
......
...@@ -314,8 +314,8 @@ else: ...@@ -314,8 +314,8 @@ else:
if tvm_path not in sys.path: if tvm_path not in sys.path:
prepend_pythonpath(tvm_path) prepend_pythonpath(tvm_path)
env.TVM_IMPORT_PYTHON_PATH = tvm_path env.TVM_IMPORT_PYTHON_PATH = tvm_path
# By default, the built TVM-related libraries are stored in TL_LIBS.
if os.environ.get("TVM_LIBRARY_PATH") is None: if os.environ.get("TVM_LIBRARY_PATH") is None:
os.environ['TVM_LIBRARY_PATH'] = env.TVM_LIBRARY_PATH = os.pathsep.join(TL_LIBS) os.environ['TVM_LIBRARY_PATH'] = env.TVM_LIBRARY_PATH = os.pathsep.join(TL_LIBS)
# Initialize CUTLASS paths # Initialize CUTLASS paths
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment