Skip to content

Commit 202f1c8

Browse files
committed
rebase from main
2 parents 48ae7b6 + 8ca9598 commit 202f1c8

File tree

306 files changed

+10918
-1833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+10918
-1833
lines changed

.github/workflows/mlir-tensorrt/ci-utils.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ cmd_lint_check() {
7777
local range
7878
range="$(compute_range)"
7979

80-
uv tool install black
80+
uv tool install 'black<26.0'
8181
uvx black --check --extend-exclude='.*\.pyi' mlir-tensorrt/compiler/ mlir-tensorrt/integrations
8282

8383
local clang_format_diff

.github/workflows/tripy-l0.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
REGISTRY: ghcr.io
1212
DEFAULT_IMAGE: ghcr.io/nvidia/tensorrt-incubator/tripy:latest
1313
NEW_TEST_IMAGE: test-image:latest
14+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
1415

1516

1617
jobs:
@@ -58,7 +59,7 @@ jobs:
5859
uses: addnab/docker-run-action@v3
5960
with:
6061
image: ${{ env.l0_image }}
61-
options: --gpus all -v ${{ github.workspace }}/tripy:/tripy
62+
options: --gpus all -v ${{ github.workspace }}/tripy:/tripy -e HF_TOKEN=${{ env.HF_TOKEN }}
6263
run: |
6364
python3 docs/generate_rsts.py
6465
sphinx-build build/doc_sources build/docs -c docs/ -j 4 -W -n
@@ -67,15 +68,15 @@ jobs:
6768
uses: addnab/docker-run-action@v3
6869
with:
6970
image: ${{ env.l0_image }}
70-
options: --gpus all -v ${{ github.workspace }}/tripy:/tripy
71+
options: --gpus all -v ${{ github.workspace }}/tripy:/tripy -e HF_TOKEN=${{ env.HF_TOKEN }}
7172
run: |
7273
pytest --cov=nvtripy/ --cov-config=.coveragerc tests/ -v -m "not l1" -n 4 --durations=15 --ignore tests/performance
7374
7475
- name: Run performance benchmarks
7576
uses: addnab/docker-run-action@v3
7677
with:
7778
image: ${{ env.l0_image }}
78-
options: --gpus all -v ${{ github.workspace }}/tripy:/tripy
79+
options: --gpus all -v ${{ github.workspace }}/tripy:/tripy -e HF_TOKEN=${{ env.HF_TOKEN }}
7980
run: |
8081
pytest tests/performance -v -m "not l1" --benchmark-warmup=on --benchmark-json benchmark.json
8182

.github/workflows/tripy-l1.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ concurrency:
1818
jobs:
1919
l1-test:
2020
runs-on: tripy-self-hosted
21+
env:
22+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
2123
container:
2224
image: ghcr.io/nvidia/tensorrt-incubator/tripy:latest
2325
volumes:

mlir-tensorrt/.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ repos:
3030
rev: 6.0.0
3131
hooks:
3232
- id: isort
33-
name: isort (python)
33+
args: ["--profile", "black"]
3434
- repo: https://github.com/pre-commit/mirrors-mypy
3535
rev: "v1.15.0"
3636
hooks:

mlir-tensorrt/CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,13 @@ include(MLIRDetectPythonEnv)
166166
mlir_configure_python_dev_packages()
167167

168168
find_package(TVMFFI REQUIRED)
169-
message(STATUS "LAN ADDED BEFORE FINDING GTEST PACKAGE ")
169+
170170
find_package(GTest REQUIRED)
171-
message(STATUS "LAN ADDED AFTER FINDING GTEST PACKAGE ")
171+
172+
if(MLIR_TRT_ENABLE_CUDATILE)
173+
find_package(CUDATile REQUIRED)
174+
endif()
175+
172176
#--------------------------------------------------
173177
# Diagnostics
174178
#--------------------------------------------------
@@ -204,7 +208,9 @@ endforeach()
204208
include_directories(${LLVM_INCLUDE_DIRS})
205209
include_directories(${MLIR_INCLUDE_DIRS})
206210
link_directories(${LLVM_BUILD_LIBRARY_DIR})
207-
add_definitions(${LLVM_DEFINITIONS} ${MLIR_TRT_DEFINITIONS})
211+
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
212+
add_definitions(${LLVM_DEFINITIONS_LIST})
213+
add_definitions(${LLVM_DEFINITIONS_LIST} ${MLIR_TRT_DEFINITIONS})
208214

209215
mtrt_write_feature_flags_header()
210216
include_directories("${CMAKE_CURRENT_BINARY_DIR}/include")

mlir-tensorrt/CMakeOptions.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ mtrt_option(MLIR_TRT_ENABLE_NCCL "Enable the NCCL runtime module" OFF)
88
mtrt_option(MLIR_TRT_ENABLE_CUBLAS "Enable CUBLAS in the executor" ON)
99
mtrt_option(MLIR_TRT_ENABLE_SHARDY "Enable compiler build with Shardy" OFF)
1010
mtrt_option(MLIR_TRT_ENABLE_CUDA "Enable the use of CUDA runtime" ON)
11+
mtrt_option(MLIR_TRT_ENABLE_CUDATILE "Enable the use of CUDA Tile IR" ON)
1112
mtrt_option(MLIR_TRT_ENABLE_MPI "Enable use of MPI in the runtime" ${MLIR_TRT_ENABLE_NCCL})
1213
mtrt_option(MLIR_TRT_LINK_MTRT_DYLIB "Link all tools against libMTRT dylib" OFF)
1314
mtrt_option(MLIR_TRT_LINK_MLIR_DYLIB "Use the libMLIR dylib to provide MLIR-TensorRT's MLIR dependencies" OFF)
@@ -65,8 +66,10 @@ set(MLIR_TRT_CUDA_ARCHITECTURES "detect" CACHE STRING
6566
# TODO: consider adding an option to link cudart statically.
6667
if(MLIR_TRT_ENABLE_CUDA)
6768
set(MLIR_TRT_CUDA_TARGET "CUDA::cudart" CACHE INTERNAL "")
69+
set(MLIR_TRT_CUDA_DRIVER_TARGET "CUDA::cuda_driver" CACHE INTERNAL "")
6870
else()
6971
set(MLIR_TRT_CUDA_TARGET "" CACHE INTERNAL "")
72+
set(MLIR_TRT_CUDA_DRIVER_TARGET "" CACHE INTERNAL "")
7073
endif()
7174

7275
# Set `MLIR_TRT_MPI_TARGET` to `MPI::MPI_C` if MPI is enabled, otherwise set it to an empty string.

mlir-tensorrt/DependencyProvider.cmake

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,27 @@ function(mtrt_find_tvm_ffi)
7171
CACHE INTERNAL "")
7272
endfunction()
7373

74+
#-------------------------------------------------------------------------------------
75+
# CUDA Tile
76+
#-------------------------------------------------------------------------------------
77+
78+
nv_register_package(
79+
NAME CUDATile
80+
GIT_REPOSITORY https://github.com/NVIDIA/cuda-tile.git
81+
GIT_TAG 802d9378800a3b7c9f88875206e84b2746d6991b
82+
EXCLUDE_FROM_ALL TRUE
83+
OPTIONS
84+
"CUDA_TILE_ENABLE_TESTING ON"
85+
PRE_ADD_HOOK [[
86+
nv_pkg_append_options("CUDA_TILE_USE_LLVM_INSTALL_DIR ${LLVM_BINARY_DIR}")
87+
if(NOT CPM_CUDATile_SOURCE)
88+
set(patch_dir "${MTRT_TOP_LEVEL_DIR}/build_tools/patches/CUDATile")
89+
nv_update_append_pkg_args(PATCHES
90+
"${patch_dir}/0001-Fix-build-with-BUILD_SHARED_LIBS-ON-and-prevent-auto.patch")
91+
endif()
92+
]]
93+
)
94+
7495
#-------------------------------------------------------------------------------------
7596
# Declare the LLVM dependency.
7697
#-------------------------------------------------------------------------------------

mlir-tensorrt/Version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(MLIR_TENSORRT_VERSION_MAJOR "0")
22
set(MLIR_TENSORRT_VERSION_MINOR "4")
3-
set(MLIR_TENSORRT_VERSION_PATCH "4")
3+
set(MLIR_TENSORRT_VERSION_PATCH "6")
44
set(MLIR_TENSORRT_VERSION
55
"${MLIR_TENSORRT_VERSION_MAJOR}.${MLIR_TENSORRT_VERSION_MINOR}.${MLIR_TENSORRT_VERSION_PATCH}")
66

mlir-tensorrt/build_tools/cmake/MTRTCompilationOptions.cmake

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ function(mtrt_apply_relative_path_options)
113113
# The following checks if the source directory is a prefix of the binary directory.
114114
cmake_path(IS_PREFIX CMAKE_SOURCE_DIR "${CMAKE_BINARY_DIR}" src_dir_is_prefix_of_bin_dir)
115115

116-
set(debug_remaps "-fdebug-prefix-map=${CMAKE_SOURCE_DIR}=.")
117-
set(file_remaps "-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.")
118-
if(src_dir_is_prefix_of_bin_dir)
116+
set(debug_remaps "-fdebug-prefix-map=${CMAKE_SOURCE_DIR}/=")
117+
set(file_remaps "-ffile-prefix-map=${CMAKE_SOURCE_DIR}/=")
118+
119+
if(NOT src_dir_is_prefix_of_bin_dir)
119120
set(debug_remaps "${debug_remaps} -fdebug-prefix-map=${CMAKE_BINARY_DIR}=build")
120121
set(file_remaps "${file_remaps} -ffile-prefix-map=${CMAKE_BINARY_DIR}=build")
121122
endif()
@@ -133,6 +134,9 @@ function(mtrt_apply_relative_path_options)
133134
CHECK "-no-canonical-prefixes"
134135
APPEND "-no-canonical-prefixes"
135136
)
137+
138+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" PARENT_SCOPE)
139+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" PARENT_SCOPE)
136140
endfunction()
137141

138142
if(PROJECT_IS_TOP_LEVEL AND MLIR_TRT_RELATIVE_DEBUG_PATHS)
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
From dd0b0215100ee530ee58dec18726cff70c0b17a1 Mon Sep 17 00:00:00 2001
2+
From: Christopher Bate <cbate@nvidia.com>
3+
Date: Sun, 11 Jan 2026 13:40:52 -0700
4+
Subject: [PATCH 1/1] Fix build with BUILD_SHARED_LIBS=ON and prevent automatic
5+
creation of empty media directory
6+
7+
---
8+
include/cuda_tile/Dialect/CudaTile/IR/CMakeLists.txt | 2 +-
9+
lib/Bytecode/Translation/CMakeLists.txt | 1 +
10+
lib/Dialect/CudaTile/IR/CMakeLists.txt | 3 +++
11+
3 files changed, 5 insertions(+), 1 deletion(-)
12+
13+
diff --git a/include/cuda_tile/Dialect/CudaTile/IR/CMakeLists.txt b/include/cuda_tile/Dialect/CudaTile/IR/CMakeLists.txt
14+
index 93b9c7f..414db08 100644
15+
--- a/include/cuda_tile/Dialect/CudaTile/IR/CMakeLists.txt
16+
+++ b/include/cuda_tile/Dialect/CudaTile/IR/CMakeLists.txt
17+
@@ -43,10 +43,10 @@ set(LLVM_TARGET_DEFINITIONS Types.td)
18+
tablegen(MLIR CudaTileTypes.md -gen-typedef-doc -allow-hugo-specific-features)
19+
20+
set(GEN_DOC_DIR ${CMAKE_SOURCE_DIR}/media/docs/Dialects/CudaTile)
21+
-file(MAKE_DIRECTORY ${GEN_DOC_DIR})
22+
23+
add_custom_command(
24+
OUTPUT ${GEN_DOC_DIR}/CudaTile.md
25+
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${GEN_DOC_DIR}
26+
COMMAND ${CMAKE_COMMAND} -E cat
27+
${CMAKE_CURRENT_BINARY_DIR}/CudaTile.md
28+
${CMAKE_CURRENT_BINARY_DIR}/CudaTileOps.md
29+
diff --git a/lib/Bytecode/Translation/CMakeLists.txt b/lib/Bytecode/Translation/CMakeLists.txt
30+
index e8055b7..b783b4d 100644
31+
--- a/lib/Bytecode/Translation/CMakeLists.txt
32+
+++ b/lib/Bytecode/Translation/CMakeLists.txt
33+
@@ -12,4 +12,5 @@ add_mlir_library(CudaTileBytecodeTranslation
34+
CudaTileDialect
35+
MLIRIR
36+
MLIRPass
37+
+ MLIRTranslateLib
38+
)
39+
diff --git a/lib/Dialect/CudaTile/IR/CMakeLists.txt b/lib/Dialect/CudaTile/IR/CMakeLists.txt
40+
index 822a2c7..3934b30 100644
41+
--- a/lib/Dialect/CudaTile/IR/CMakeLists.txt
42+
+++ b/lib/Dialect/CudaTile/IR/CMakeLists.txt
43+
@@ -23,4 +23,7 @@ add_mlir_library(CudaTileDialect
44+
LINK_LIBS PUBLIC
45+
MLIRIR
46+
MLIRSideEffectInterfaces
47+
+ MLIRFunctionInterfaces
48+
+ MLIRInferTypeOpInterface
49+
+ MLIRControlFlowInterfaces
50+
)
51+
--
52+
2.39.3 (Apple Git-146)
53+

0 commit comments

Comments
 (0)