Skip to content

[mlir][GPU] Remove the SerializeToCubin pass #82486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 22, 2024
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
1 change: 0 additions & 1 deletion mlir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ else()
endif()
add_definitions(-DMLIR_ROCM_CONVERSIONS_ENABLED=${MLIR_ENABLE_ROCM_CONVERSIONS})

set(MLIR_ENABLE_DEPRECATED_GPU_SERIALIZATION 0 CACHE BOOL "Enable deprecated GPU serialization passes")
set(MLIR_ENABLE_CUDA_RUNNER 0 CACHE BOOL "Enable building the mlir CUDA runner")
set(MLIR_ENABLE_ROCM_RUNNER 0 CACHE BOOL "Enable building the mlir ROCm runner")
set(MLIR_ENABLE_SYCL_RUNNER 0 CACHE BOOL "Enable building the mlir Sycl runner")
Expand Down
14 changes: 0 additions & 14 deletions mlir/include/mlir/Dialect/GPU/Transforms/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,25 +147,11 @@ class SerializeToBlobPass : public OperationPass<gpu::GPUModuleOp> {
// Registration
//===----------------------------------------------------------------------===//

/// Register pass to serialize GPU kernel functions to a CUBIN binary
/// annotation.
LLVM_DEPRECATED("use Target attributes instead", "")
void registerGpuSerializeToCubinPass();

/// Register pass to serialize GPU kernel functions to a HSAco binary
/// annotation.
LLVM_DEPRECATED("use Target attributes instead", "")
void registerGpuSerializeToHsacoPass();

/// Create an instance of the GPU kernel function to CUBIN binary serialization
/// pass with optLevel (default level 2).
LLVM_DEPRECATED("use Target attributes instead", "")
std::unique_ptr<Pass> createGpuSerializeToCubinPass(StringRef triple,
StringRef chip,
StringRef features,
int optLevel = 2,
bool dumpPtx = false);

/// Create an instance of the GPU kernel function to HSAco binary serialization
/// pass.
LLVM_DEPRECATED("use Target attributes instead", "")
Expand Down
52 changes: 0 additions & 52 deletions mlir/lib/Dialect/GPU/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
if ("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD)
set(NVPTX_LIBS
NVPTXCodeGen
NVPTXDesc
NVPTXInfo
)
endif()

if (MLIR_ENABLE_ROCM_CONVERSIONS)
set(AMDGPU_LIBS
IRReader
Expand Down Expand Up @@ -60,7 +52,6 @@ add_mlir_dialect_library(MLIRGPUTransforms
Transforms/ParallelLoopMapper.cpp
Transforms/ROCDLAttachTarget.cpp
Transforms/SerializeToBlob.cpp
Transforms/SerializeToCubin.cpp
Transforms/SerializeToHsaco.cpp
Transforms/ShuffleRewriter.cpp
Transforms/SPIRVAttachTarget.cpp
Expand All @@ -74,7 +65,6 @@ add_mlir_dialect_library(MLIRGPUTransforms
Core
MC
Target
${NVPTX_LIBS}
${AMDGPU_LIBS}

DEPENDS
Expand Down Expand Up @@ -110,48 +100,6 @@ add_mlir_dialect_library(MLIRGPUTransforms
add_subdirectory(TransformOps)
add_subdirectory(Pipelines)

if(MLIR_ENABLE_CUDA_RUNNER)
if(NOT MLIR_ENABLE_CUDA_CONVERSIONS)
message(SEND_ERROR
"Building mlir with cuda support requires the NVPTX backend")
endif()

# Configure CUDA language support. Using check_language first allows us to
# give a custom error message.
include(CheckLanguage)
check_language(CUDA)
if (CMAKE_CUDA_COMPILER)
enable_language(CUDA)
else()
message(SEND_ERROR
"Building mlir with cuda support requires a working CUDA install")
endif()

# Enable gpu-to-cubin pass.
target_compile_definitions(obj.MLIRGPUTransforms
PRIVATE
MLIR_GPU_TO_CUBIN_PASS_ENABLE=1
)

# Add CUDA headers includes and the libcuda.so library.
target_include_directories(obj.MLIRGPUTransforms
PRIVATE
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
)

# Add link path for the cuda driver library.
find_library(CUDA_DRIVER_LIBRARY cuda HINTS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES} REQUIRED)
get_filename_component(CUDA_DRIVER_LIBRARY_PATH "${CUDA_DRIVER_LIBRARY}" DIRECTORY)
target_link_directories(MLIRGPUTransforms PRIVATE ${CUDA_DRIVER_LIBRARY_PATH})

target_link_libraries(MLIRGPUTransforms
PRIVATE
MLIRNVVMToLLVMIRTranslation
cuda
)

endif()

if(MLIR_ENABLE_ROCM_CONVERSIONS)
if (NOT ("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD))
message(SEND_ERROR
Expand Down
180 changes: 0 additions & 180 deletions mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp

This file was deleted.