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
14 changes: 8 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ jobs:
CMAKE_BUILD_PARALLEL_LEVEL: ${{ steps.env_vars.outputs.cpu_count }}
run: |
set -euxo pipefail
pip install scikit-build-core
pip install "scikit-build-core>=0.11" "setuptools-scm>=8"
export CMAKE_ARGS="-DTVM_TIRX_USE_LLVM=ON -DTVM_TIRX_USE_METAL=ON -DTVM_TIRX_BUILD_TESTS=OFF"
pip wheel --no-deps -w dist ./tirx -v
export PIP_FIND_LINKS="$(pwd)/dist"
pip install --no-deps --force-reinstall dist/apache_tvm_tirx-*.whl
export CMAKE_ARGS="-DBUILD_TESTING=OFF"
pip wheel --no-deps -w dist . -v
pip wheel --no-deps --no-build-isolation -w dist . -v
- name: Install TIRx and TVM from wheels
shell: bash -l {0}
run: |
Expand Down Expand Up @@ -121,12 +121,14 @@ jobs:
env:
CMAKE_BUILD_PARALLEL_LEVEL: ${{ steps.env_vars.outputs.cpu_count }}
run: |
pip install scikit-build-core || exit /b 1
pip install "scikit-build-core>=0.11" "setuptools-scm>=8" || exit /b 1
set CMAKE_ARGS=-DTVM_TIRX_USE_LLVM=ON -DTVM_TIRX_BUILD_TESTS=OFF
pip wheel --no-deps -w dist ./tirx -v || exit /b 1
set PIP_FIND_LINKS=%CD%\dist
for %%w in (dist\apache_tvm_tirx-*.whl) do (
pip install --no-deps --force-reinstall "%%w" || exit /b 1
)
set CMAKE_ARGS=-DBUILD_TESTING=OFF
pip wheel --no-deps -w dist . -v || exit /b 1
pip wheel --no-deps --no-build-isolation -w dist . -v || exit /b 1
for %%w in (dist\*.whl) do (
pip install --no-deps "%%w" || exit /b 1
)
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ conda/pkg
_docs/
jvm/target
.config/configstore/
.ci-py-scripts/


# Local tvm-site checkout
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "3rdparty/cutlass"]
path = 3rdparty/cutlass
url = https://github.com/NVIDIA/cutlass.git
[submodule "3rdparty/OpenCL-Headers"]
path = 3rdparty/OpenCL-Headers
url = https://github.com/KhronosGroup/OpenCL-Headers.git
[submodule "3rdparty/cutlass_fpA_intB_gemm"]
path = 3rdparty/cutlass_fpA_intB_gemm
url = https://github.com/tlc-pack/cutlass_fpA_intB_gemm
Expand Down
1 change: 0 additions & 1 deletion 3rdparty/OpenCL-Headers
Submodule OpenCL-Headers deleted from b590a6
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ if(TVM_USE_INSTALLED_TIRX)
message(FATAL_ERROR "TVM requires apache-tvm-tirx 0.1.0a0")
endif()
else()
if(NOT TVM_OPENCL_HEADERS_ROOT AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/OpenCL-Headers/CL/cl.h")
set(TVM_OPENCL_HEADERS_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/OpenCL-Headers")
endif()
# Keep source-built core libraries beside the parent libraries.
set(_tirx_output_defaults "")
foreach(_kind ARCHIVE LIBRARY RUNTIME)
Expand Down Expand Up @@ -332,6 +329,13 @@ foreach(_target tvm_compiler tvm_runtime_extra)
elseif(UNIX)
set_property(TARGET ${_target} APPEND PROPERTY INSTALL_RPATH "\$ORIGIN/../../tvm_tirx/lib")
endif()
if(TVM_BUILD_PYTHON_MODULE)
if(APPLE)
set_property(TARGET ${_target} APPEND PROPERTY INSTALL_RPATH "@loader_path/../../tvm_ffi/lib")
elseif(UNIX)
set_property(TARGET ${_target} APPEND PROPERTY INSTALL_RPATH "\$ORIGIN/../../tvm_ffi/lib")
endif()
endif()
tvm_ffi_add_apple_dsymutil(${_target})
endforeach()
add_subdirectory(tests/cpp)
Expand Down Expand Up @@ -364,6 +368,9 @@ install(TARGETS tvm_compiler tvm_runtime_extra
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT tvm
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT tvm)
if(TVM_TIRX_USE_CUDA AND USE_CUTLASS)
foreach(_target fpA_intB_gemm flash_attn)
tvm_configure_target_library(${_target})
endforeach()
install(TARGETS fpA_intB_gemm flash_attn
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT tvm
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT tvm
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ respective component directories for their licenses.
Apache Software Foundation License 2.0
--------------------------------------

3rdparty/OpenCL-Headers
OpenCL-Headers (downloaded when OpenCL is enabled)
3rdparty/cutlass_fpA_intB_gemm
3rdparty/tensorrt_llm

Expand Down
3 changes: 2 additions & 1 deletion apps/android_rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ $ANDROID_HOME/platform-tools/adb uninstall org.apache.tvm.tvmrpc

### Build with OpenCL

Application is building with OpenCL support by default.
Application is building with OpenCL support by default. Set `OPENCL_SDK` to an
OpenCL SDK containing `include/CL/cl.h` before invoking the Android build.
[OpenCL-wrapper](../../src/runtime/opencl/opencl_wrapper) is used and will dynamically load OpenCL library on the device.
If the device doesn't have OpenCL library on it, then you'll see in the runtime that OpenCL library cannot be opened.
If you want to build this application without OpenCL then set `USE_OPENCL = 0`
Expand Down
7 changes: 5 additions & 2 deletions apps/android_rpc/app/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ LOCAL_LDFLAGS := -L$(SYSROOT)/usr/lib/ -llog

LOCAL_C_INCLUDES := $(ROOT_PATH)/include $(ROOT_PATH)/tirx/include \
$(ROOT_PATH)/tirx/3rdparty/tvm-ffi/include \
$(ROOT_PATH)/tirx/3rdparty/tvm-ffi/3rdparty/dlpack/include \
$(ROOT_PATH)/3rdparty/OpenCL-Headers
$(ROOT_PATH)/tirx/3rdparty/tvm-ffi/3rdparty/dlpack/include

ifeq ($(USE_OPENCL), 1)
LOCAL_C_INCLUDES += $(OPENCL_SDK)/include
endif

LOCAL_MODULE = tvm4j_runtime_packed

Expand Down
19 changes: 19 additions & 0 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,22 @@ Other jobs run in GitHub Actions for Windows and MacOS jobs.
The native Groovy entry points in `ci/jenkins/generated/` load shared helpers
from `common.groovy`. Edit these sources directly; no generation step is needed.
See comments in [common.groovy](jenkins/generated/common.groovy) for shared utility options and trust constraints.

The native Jenkins pipelines source
`tests/scripts/task_install_build_dependencies.sh` once to clean `dist/` and
install build backend and Z3 prerequisites. They then invoke
`tests/scripts/task_build_<platform>.sh`. Each root platform script sets the full
platform CMake options and directly builds the pinned-source FFI wheel from
`tirx/3rdparty/tvm-ffi`, followed by the TIRx and TVM wheels. All three wheel
builds use the same root CMake source and absolute `build/` directory, with fixed
package-specific install components. They perform normal CMake configuration
passes over the shared native build graph. The root script also runs enabled
C++ tests, and all three wheels are written to `dist/`.

Before running a consumer script, Groovy sources
`tests/scripts/test_task_install_dist_wheels.sh` in the same shell. This installs
the three transferred wheels offline without dependencies into `.local/python`
and sets its absolute path as `PYTHONPATH`; `TVM_HOME` retains checkout resources.
Test and docs scripts use that caller-provided environment. Groovy sets the
cache, parallelism and C/C++ compiler-launcher environment values;
`docker/bash.sh` forwards them to the build scripts.
32 changes: 11 additions & 21 deletions ci/jenkins/generated/arm_jenkinsfile.groovy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion ci/jenkins/generated/common.groovy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 15 additions & 26 deletions ci/jenkins/generated/cpu_jenkinsfile.groovy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 26 additions & 15 deletions ci/jenkins/generated/gpu_jenkinsfile.groovy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 13 additions & 25 deletions ci/jenkins/generated/wasm_jenkinsfile.groovy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading