Skip to content

Commit f204aee

Browse files
authored
[mlir][GPU] Remove the SerializeToCubin pass (#82486)
The `SerializeToCubin` pass was deprecated in September 2023 in favor of GPU compilation attributes; see the [GPU compilation](https://mlir.llvm.org/docs/Dialects/GPU/#gpu-compilation) section in the `gpu` dialect MLIR docs. This patch removes `SerializeToCubin` from the repo.
1 parent 004c197 commit f204aee

File tree

4 files changed

+0
-247
lines changed

4 files changed

+0
-247
lines changed

mlir/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ else()
123123
endif()
124124
add_definitions(-DMLIR_ROCM_CONVERSIONS_ENABLED=${MLIR_ENABLE_ROCM_CONVERSIONS})
125125

126-
set(MLIR_ENABLE_DEPRECATED_GPU_SERIALIZATION 0 CACHE BOOL "Enable deprecated GPU serialization passes")
127126
set(MLIR_ENABLE_CUDA_RUNNER 0 CACHE BOOL "Enable building the mlir CUDA runner")
128127
set(MLIR_ENABLE_ROCM_RUNNER 0 CACHE BOOL "Enable building the mlir ROCm runner")
129128
set(MLIR_ENABLE_SYCL_RUNNER 0 CACHE BOOL "Enable building the mlir Sycl runner")

mlir/include/mlir/Dialect/GPU/Transforms/Passes.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -147,25 +147,11 @@ class SerializeToBlobPass : public OperationPass<gpu::GPUModuleOp> {
147147
// Registration
148148
//===----------------------------------------------------------------------===//
149149

150-
/// Register pass to serialize GPU kernel functions to a CUBIN binary
151-
/// annotation.
152-
LLVM_DEPRECATED("use Target attributes instead", "")
153-
void registerGpuSerializeToCubinPass();
154-
155150
/// Register pass to serialize GPU kernel functions to a HSAco binary
156151
/// annotation.
157152
LLVM_DEPRECATED("use Target attributes instead", "")
158153
void registerGpuSerializeToHsacoPass();
159154

160-
/// Create an instance of the GPU kernel function to CUBIN binary serialization
161-
/// pass with optLevel (default level 2).
162-
LLVM_DEPRECATED("use Target attributes instead", "")
163-
std::unique_ptr<Pass> createGpuSerializeToCubinPass(StringRef triple,
164-
StringRef chip,
165-
StringRef features,
166-
int optLevel = 2,
167-
bool dumpPtx = false);
168-
169155
/// Create an instance of the GPU kernel function to HSAco binary serialization
170156
/// pass.
171157
LLVM_DEPRECATED("use Target attributes instead", "")

mlir/lib/Dialect/GPU/CMakeLists.txt

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
if ("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD)
2-
set(NVPTX_LIBS
3-
NVPTXCodeGen
4-
NVPTXDesc
5-
NVPTXInfo
6-
)
7-
endif()
8-
91
if (MLIR_ENABLE_ROCM_CONVERSIONS)
102
set(AMDGPU_LIBS
113
IRReader
@@ -60,7 +52,6 @@ add_mlir_dialect_library(MLIRGPUTransforms
6052
Transforms/ParallelLoopMapper.cpp
6153
Transforms/ROCDLAttachTarget.cpp
6254
Transforms/SerializeToBlob.cpp
63-
Transforms/SerializeToCubin.cpp
6455
Transforms/SerializeToHsaco.cpp
6556
Transforms/ShuffleRewriter.cpp
6657
Transforms/SPIRVAttachTarget.cpp
@@ -74,7 +65,6 @@ add_mlir_dialect_library(MLIRGPUTransforms
7465
Core
7566
MC
7667
Target
77-
${NVPTX_LIBS}
7868
${AMDGPU_LIBS}
7969

8070
DEPENDS
@@ -110,48 +100,6 @@ add_mlir_dialect_library(MLIRGPUTransforms
110100
add_subdirectory(TransformOps)
111101
add_subdirectory(Pipelines)
112102

113-
if(MLIR_ENABLE_CUDA_RUNNER)
114-
if(NOT MLIR_ENABLE_CUDA_CONVERSIONS)
115-
message(SEND_ERROR
116-
"Building mlir with cuda support requires the NVPTX backend")
117-
endif()
118-
119-
# Configure CUDA language support. Using check_language first allows us to
120-
# give a custom error message.
121-
include(CheckLanguage)
122-
check_language(CUDA)
123-
if (CMAKE_CUDA_COMPILER)
124-
enable_language(CUDA)
125-
else()
126-
message(SEND_ERROR
127-
"Building mlir with cuda support requires a working CUDA install")
128-
endif()
129-
130-
# Enable gpu-to-cubin pass.
131-
target_compile_definitions(obj.MLIRGPUTransforms
132-
PRIVATE
133-
MLIR_GPU_TO_CUBIN_PASS_ENABLE=1
134-
)
135-
136-
# Add CUDA headers includes and the libcuda.so library.
137-
target_include_directories(obj.MLIRGPUTransforms
138-
PRIVATE
139-
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
140-
)
141-
142-
# Add link path for the cuda driver library.
143-
find_library(CUDA_DRIVER_LIBRARY cuda HINTS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES} REQUIRED)
144-
get_filename_component(CUDA_DRIVER_LIBRARY_PATH "${CUDA_DRIVER_LIBRARY}" DIRECTORY)
145-
target_link_directories(MLIRGPUTransforms PRIVATE ${CUDA_DRIVER_LIBRARY_PATH})
146-
147-
target_link_libraries(MLIRGPUTransforms
148-
PRIVATE
149-
MLIRNVVMToLLVMIRTranslation
150-
cuda
151-
)
152-
153-
endif()
154-
155103
if(MLIR_ENABLE_ROCM_CONVERSIONS)
156104
if (NOT ("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD))
157105
message(SEND_ERROR

mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp

Lines changed: 0 additions & 180 deletions
This file was deleted.

0 commit comments

Comments
 (0)