-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## NFC: Simplify some aspects of options management (OptionsContext) - Adds a convenience 'OptionsContext::Option' class that simplifies how options are declared. - Closes a loophole where tuples of structs containing options can cause crashes if they populate options in their constructor. Due to how the external storage mechanism works, we can no longer use direct `std::tuple` of aggregate objects which invoke `addOption`. Instead, one must use `unique_ptr` to wrap those types when used as elements of a `std::tuple`. - To help enforce this, we explicitly delete the move constructor of `OptionsProvider`. ## [compiler|python] Update how cached pipelines/"Compiler Tasks" are registered This change updates how registration functions for "compilation tasks" invoked. We now expose a C API method that can be invoked within the Pybind11 module initializer. This decouples compiler task registration from pass or dialect registration. This change also cleans up the C API function naming for pass/dialect registration functions. ## [python] Add more robust CMake logic for fixing missing CAPI dependency in core MLIR PyBind module Adds CMake logic to ensure that the Core '_mlir' pybind extension has the correct CAPI dependencies declared until the upstream CMake declarations can be fixed. ## NFC: Remove unnecessary PyCapsule <-> CAPI casters in compiler and runtime bindings Removes unnecessary custom PyBind11 capsule -> C API object casters. These cast functions are only required when it is desired to allow PyBind11 to extract the C API object from the C++ python wrapper type automatically. ## [tensorrt|compiler] Drop "layer metadata callback" utility from TensorRT translation This change removes the "layer metadata callback" feature from the MLIR-to-TensorRT translation. It also removes the relevant APIs from the MLIR-TensorRT compiler's C++ and Python APIs. This capability was originally offered as a bridge for populating the generated TensorRT ILayers with custom metadata. However, the mechanism prevents caching of pass pipelines and therefore is too expensive to use. In the future, any metadata passed to TensorRT should be derived from the MLIR operations' location information. ## NFC: update various uses of "Stablehlo" in class and function names to have consistent capitalization ## NFC: Reorganize some directories This change: - Moves the top-level 'tools' to 'compiler/tools' - Moves the top-level 'test' to 'compiler/test' - Moves the 'mlir-tensorrt-tblgen' tool under 'tensorrt/tools' since the 'tensorrt' project is supposed to be independent. - Similarly move TensorRT-specific python definitions under `tensorrt/python`. ## [executor]: Add a missing guard for builds without CUDA enabled. Wrapping the makeCudaStringError function with MLIR_EXECUTOR_ENABLE_CUDA fixes builds without CUDA enabled. ## [executor] Use Lua locals for block arguments Previously, the Executor MLIR-to-Lua translator used Lua globals for block arguments outside of the entry block since the values that represent block arguments need to be passed between blocks. On the other hand, the scope of Lua local variables are restricted to their block. It is almost never a good idea to use Lua global variables in our translation strategy, however -- for coroutine functions, a translation that uses globals is obviously incorrect since all Lua coroutines in a single Lua environment share the same set of globals. This change declares all block arguments up front as locals in the "entry block" and just sets them to `nil` initially. Since we don't declare a block scope for the entry block, all the following Lua block scopes will have these locals in scope. This allows us to retain the use of locals for all block arguments. GitOrigin-RevId: e9dd03c47eab6145e889ea8ff56fd1c71181f72a
- Loading branch information
1 parent
cbf0e09
commit f2e5819
Showing
178 changed files
with
421 additions
and
500 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
set(MLIR_TENSORRT_COMPILER_DIR "${CMAKE_CURRENT_SOURCE_DIR}") | ||
|
||
include_directories(${CMAKE_CURRENT_LIST_DIR}/include) | ||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) | ||
include_directories(${MLIR_TENSORRT_ROOT_DIR}/executor/include) | ||
include_directories(${MLIR_TENSORRT_ROOT_BINARY_DIR}/executor/include) | ||
|
||
add_subdirectory(include) | ||
add_subdirectory(lib) | ||
add_subdirectory(test) | ||
add_subdirectory(tools) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.