Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ tvm_option(USE_MRVL "Build with MRVL TVM support" OFF)
tvm_option(USE_NVSHMEM "Build with NVSHMEM support" OFF)

# Python package options
tvm_option(TVM_BUILD_PYTHON_MODULE "Build Python module with scikit-build-core" ON)
tvm_option(TVM_BUILD_PYTHON_MODULE "Build Python module with scikit-build-core" OFF)

# include directories
include_directories(${CMAKE_INCLUDE_PATH})
Expand Down Expand Up @@ -826,50 +826,50 @@ endif()
if(TVM_BUILD_PYTHON_MODULE)
message(STATUS "Configuring Python package installation")

# Install Python source files
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/python/tvm"
DESTINATION "."
FILES_MATCHING
PATTERN "*.py"
PATTERN "*.pyi"
PATTERN "__pycache__" EXCLUDE
PATTERN "*.pyc" EXCLUDE
)
# Set RPATH for tvm and tvm_runtime to find other libraries relatively
if(APPLE)
# macOS uses @loader_path
set_target_properties(tvm PROPERTIES INSTALL_RPATH "@loader_path")
set_target_properties(tvm_runtime PROPERTIES INSTALL_RPATH "@loader_path")
elseif(LINUX)
# Linux uses $ORIGIN
set_target_properties(tvm PROPERTIES INSTALL_RPATH "\$ORIGIN")
set_target_properties(tvm_runtime PROPERTIES INSTALL_RPATH "\$ORIGIN")
endif()

# Install compiled shared libraries
install(TARGETS tvm DESTINATION "tvm")
install(TARGETS tvm_runtime DESTINATION "tvm")
install(TARGETS tvm DESTINATION ".")
install(TARGETS tvm_runtime DESTINATION ".")

# Install third-party compiled dependencies
if(TARGET fpA_intB_gemm)
install(TARGETS fpA_intB_gemm DESTINATION "tvm")
install(TARGETS fpA_intB_gemm DESTINATION ".")
endif()
if(TARGET flash_attn)
install(TARGETS flash_attn DESTINATION "tvm")
install(TARGETS flash_attn DESTINATION ".")
endif()

# Install minimal header files needed by Python extensions
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/tvm/runtime"
DESTINATION "tvm/include/tvm/runtime"
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/tvm/runtime/"
DESTINATION "include/tvm/runtime/"
FILES_MATCHING
PATTERN "*.h"
)

# Install minimal CMake configuration
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/cmake/utils"
DESTINATION "tvm/cmake/utils"
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/cmake/utils/"
DESTINATION "cmake/utils/"
FILES_MATCHING
PATTERN "*.cmake"
)

# Install CUTLASS headers only if available
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/cutlass/include")
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/cutlass/include"
DESTINATION "tvm/3rdparty/cutlass"
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/cutlass/include/"
DESTINATION "3rdparty/cutlass/include/"
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.hpp"
Expand All @@ -878,31 +878,31 @@ if(TVM_BUILD_PYTHON_MODULE)

# Install minimal source files
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/runtime"
DESTINATION "tvm/src/runtime"
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/runtime/"
DESTINATION "src/runtime/"
FILES_MATCHING
PATTERN "*.cc"
PATTERN "*.h"
)

# Install essential configuration files
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/configs"
DESTINATION "tvm/configs"
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/configs/"
DESTINATION "configs/"
)

# Install licenses (required for distribution)
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/licenses"
DESTINATION "tvm/licenses"
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/licenses/"
DESTINATION "licenses/"
)

# Install essential metadata files
install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/README.md"
"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE"
"${CMAKE_CURRENT_SOURCE_DIR}/NOTICE"
DESTINATION "tvm"
DESTINATION "."
)

message(STATUS "Python package installation configured")
Expand Down
10 changes: 2 additions & 8 deletions ffi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,10 @@ if (TVM_FFI_BUILD_PYTHON_MODULE)
# Set RPATH for tvm_ffi_cython to find tvm_ffi_shared.so relatively
if(APPLE)
# macOS uses @loader_path
set_target_properties(tvm_ffi_cython PROPERTIES
INSTALL_RPATH "@loader_path/lib"
BUILD_WITH_INSTALL_RPATH ON
)
set_target_properties(tvm_ffi_cython PROPERTIES INSTALL_RPATH "@loader_path/lib")
elseif(LINUX)
# Linux uses $ORIGIN
set_target_properties(tvm_ffi_cython PROPERTIES
INSTALL_RPATH "\$ORIGIN/lib"
BUILD_WITH_INSTALL_RPATH ON
)
set_target_properties(tvm_ffi_cython PROPERTIES INSTALL_RPATH "\$ORIGIN/lib")
endif()
install(TARGETS tvm_ffi_cython DESTINATION .)

Expand Down
19 changes: 3 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ classifiers = [
]
# Core dependencies - these are the minimum required for basic TVM functionality
dependencies = [
"apache-tvm-ffi",
"cloudpickle",
"ml_dtypes",
"numpy",
Expand Down Expand Up @@ -129,25 +130,11 @@ wheel.py-api = "py3"
build-dir = "build"

# CMake configuration - ensure proper installation paths
cmake.args = [
"-DTVM_BUILD_PYTHON_MODULE=ON",
"-DTVM_FFI_BUILD_PYTHON_MODULE=OFF",
"-DTVM_USE_CUTLASS=OFF",
"-DTVM_USE_FLASH_ATTN=OFF",
"-DTVM_USE_LLVM=OFF",
"-DTVM_USE_CUDA=OFF",
"-DTVM_USE_OPENCL=OFF",
"-DTVM_USE_VULKAN=OFF",
"-DTVM_USE_METAL=OFF",
"-DTVM_USE_OPENGL=OFF",
"-DTVM_USE_RPC=OFF",
"-DTVM_USE_GRAPH_EXECUTOR=OFF",
"-DTVM_USE_PROFILER=OFF",
"-DTVM_USE_UTILS=OFF",
]
cmake.args = ["-DTVM_BUILD_PYTHON_MODULE=ON"]

# Wheel configuration
wheel.packages = ["python/tvm"]
wheel.install-dir = "tvm"

# Source distribution configuration
sdist.include = [
Expand Down
Loading