Commit c76570b
committed
[CI] Add manylinux auditwheel repair
[executor] Introduce a pass to expand unsupproted Math operations
Adds path `executor-expand-math-ops` to expand unsupported Math
operations into compositions of supported operations. This pass
utilizes upstream Math dialect rewrite pattern sets (e.g.
`math-expand-ops`, `math-polynomial-approx` etc).
GitOrigin-RevId: 5d1736f1a5a398ee37a003461ee2d32cd0a5c06e
[mlir-tensorrt] Add Stablehlo patch for various Stablehlo upstream pass issues
Add a Stablehlo patch for the following issues:
1. No Atan2 scalar float support in StablehloToScalarOp template
2. Fix crash when convert `stablehlo.bitcast_convert` with complex
type to arith::BitcastOp
3. Fix StablehloRefineShapes can accidentally erase functions with
side effects
4. Fix StablehloAggressiveFolder can crash when folding
`stablehlo.compare` if the result type has static dimensions
erased.
[compiler][emitc] Add support for embedding and emitting runtime files
This change enables the compiler to emit the required Standalone runtime
sources and headers as artifacts when translating to EmitC, eliminating the
need for users to manually locate and copy runtime files from the source tree.
The StandaloneCPP runtime files (*.cpp, *.h) are now embedded directly into
the compiler binary at build time using a new CMake script
(GenerateEmbeddedStandaloneCPP.cmake) that generates a translation unit
containing the file contents as raw string literals.
A new pass `EmitCppSupportFilesPass` analyzes the EmitC module to determine
which runtime components are required (Core, CUDA, TensorRT) and emits them
as `executor.file_artifact` operations. The pass can also optionally generate
an example CMakeLists.txt and a test driver source file.
New compiler options control emission:
- `--emitc-emit-support-files`: Emit all support files (runtime, CMake, driver)
- `--emitc-emit-runtime-files`: Emit only the required runtime subset
- `--emitc-emit-cmake-file`: Emit an example CMake file
- `--emitc-emit-test-driver`: Emit a C++ test driver source file
The `-o` output path option is now scoped to global CLI parsing only
to avoid conflicts when parsing option strings programmatically.
GitOrigin-RevId: 330f1f17e78584131b1b4a482e7600b39d3dfb27
[compiler] NFC: Add missing `memref-to-cuda` test cases
[integrations/PJRT] Fix CMake configuration for PJRT library
- Previous change to PJRT CMake config broke the build
when BUILD_SHARED_LIBS is set to ON.
- The fix is simply to undo the change to the location
of the CMAKE_CXX_VISIBILITY_PRESET setting.
- In addition, the visiblility fix using the linker option
is improved using CMake `LINKER:` prefix.
- Finally, the linker option fixed the issue that was causing
us to build an additional PJRT static library for unit tests,
so we can eliminate the extra library and just build the one
monolithic shared library for testing and deployment. This
additionally seems to act as a check against LLVM/MLIR
symbol visibility.
GitOrigin-RevId: 24c3090fca08602319466e2eefeb9f6fb0f68677
NFC: Consolidate CUDA integration tests and simplify test commands
GitOrigin-RevId: 94c9f43ca8c51c6f02edcc8f26725268a84210a1
[mlir-tensorrt] Integrate internal changes
--- [compiler] Add cuda.get_program_device op
Introduce `cuda.get_program_device` as a pure/speculatable way to map
a program logical device id (i32) to a CUDA device ordinal (i32).
GitOrigin-RevId: 00512cc5a9e9c61023e1d9de734b2383da369bcf
--- [compiler] Refactor device management and stream creation utilities
This commit introduces a new device management model to support
multi-device SPMD and MPMD programs and refactors stream creation to
use reusable utility functions. The primary motivation is to enable
more flexible device assignment where programs can be assigned to
specific CUDA ordinals via logical device IDs, laying the groundwork
for better multi-device support.
GitOrigin-RevId: 447b72743e64f394671f866fcdfdb0d6f0f3d579
---[compiler|executor] Refactor plugin call stream handling
This change refactors how CUDA streams are handled for plugin calls in
the executor dialect. Previously, when no stream was provided to a
CallPluginOp, the lowering would create and use a global CUDA stream
(stream0). This approach had several issues:
1. It tightly coupled the executor dialect to CUDA-specific stream
creation
2. It required maintaining global stream state across compilation
3. It made the stream handling implicit and harder to reason about
The new approach uses null streams (nullptr) when no explicit stream
is provided. This is the standard CUDA convention where a null stream
represents the default stream. The changes include:
- Modified `executor.call_plugin` op to accept any type for the stream
operand (not just `!executor.ptr<host>`), allowing frontend dialects
to pass their own stream representations (e.g. `!cuda.stream`)
- Updated the assembly format to print the stream type for clarity
- Removed `getGlobalCudaStream` helper method from
ConvertToExecutorPattern
- Changed CallPluginConversionPattern to create a null pointer
(inttoptr 0) when no stream is provided instead of creating a global
stream
- Updated StablehloToPlan conversion to use
`cuda::getOrCreateDefaultStream0` to explicitly create CUDA streams
when converting TVM FFI custom calls
- Added CUDADialect dependency to StablehloToPlan pass and CMakeLists
This makes stream handling more explicit and flexible, allowing
different frontend dialects to manage their own stream creation while
falling back to null streams (CUDA default stream) when appropriate.
GitOrigin-RevId: 764238bc58308d5d284f8e32da91c7e5f90fdf0c1 parent bce288b commit c76570b
File tree
131 files changed
+3595
-632
lines changed- .github/workflows
- mlir-tensorrt
- mlir-tensorrt
- .devcontainer
- cuda12.9-rockylinux8-prebuilt
- cuda12.9-rockylinux8
- cuda13.0-rockylinux8-prebuilt
- cuda13.0-rockylinux8
- build_tools
- docker
- patches/stablehlo
- scripts
- common/include/mlir-tensorrt-common/Utils
- compiler
- cmake
- include/mlir-tensorrt
- Compiler
- Conversion
- HostToEmitC
- Dialect
- CUDA
- IR
- Utils
- Plan/Transforms
- StablehloExt/Transforms
- lib
- Compiler
- Extensions/KernelGenExtension
- InputPipelines
- Conversion
- CUDAToExecutor
- CUDAToLLVM
- HostToEmitC
- KernelToCUDA
- MemRefToCUDA
- StablehloToPlan
- TensorRTToTensorRTRuntime
- Dialect
- CUDA
- Utils
- Plan/Transforms
- StablehloExt/Transforms
- Transforms/ExecuteConstantFoldableSubgraphs
- test
- Backend
- Host
- Kernel
- TensorRT
- Compiler
- InputPipelines/Stablehlo
- KernelGenExtension
- Conversion
- CUDAToExecutor
- CUDAToLLVM
- HostToEmitC
- KernelToCUDA
- MemRefToCUDA
- StablehloToPlan
- TensorRTToTensorRTRuntime
- Dialect/CUDA
- IntegrationTests
- CUDA
- Check
- DynamicShape
- EmitC
- JAXRandomNormalMatMul
- JAXResNet50
- PyTorchBert
- Target/Lua/IntegrationTests
- Transforms/OutlineTensorRTOps
- tools/mlir-tensorrt-compiler
- executor
- include/mlir-executor
- Conversion
- Executor
- IR
- Transforms
- Runtime/API
- lib
- CAPI/Runtime
- Conversion
- Executor/Transforms
- Runtime
- API
- Backend
- C
- Lua
- Modules
- CUDA
- NCCL
- StandaloneCPP
- Target/Lua
- Tools
- test
- Conversion
- Executor
- Unit/Runtime/LuaRuntime
- integrations
- PJRT
- lib
- CAPI
- python
- test/Unit/CAPI
- python
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
131 files changed
+3595
-632
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
| 26 | + | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| 46 | + | |
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
| |||
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
50 | | - | |
51 | | - | |
52 | | - | |
| 57 | + | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
74 | 83 | | |
75 | 84 | | |
76 | 85 | | |
| |||
84 | 93 | | |
85 | 94 | | |
86 | 95 | | |
87 | | - | |
| 96 | + | |
88 | 97 | | |
89 | | - | |
| 98 | + | |
90 | 99 | | |
91 | 100 | | |
92 | 101 | | |
| |||
Lines changed: 88 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
0 commit comments