From c94d756f9d4d3f3e5b5440b1028aa6108e5f350f Mon Sep 17 00:00:00 2001 From: Adam Siemieniuk Date: Thu, 25 Jul 2024 16:46:16 +0200 Subject: [PATCH] Revert "Pass XSMM runner lib to MLIR execution engine (#147)" This reverts commit a510e017e1c2f61cb04b9916fa3705d0f4b15af2. --- cmake/tpp-mlir.cmake | 6 +--- .../src/transformations/mlir/mlir_op.cpp | 30 ++----------------- 2 files changed, 4 insertions(+), 32 deletions(-) diff --git a/cmake/tpp-mlir.cmake b/cmake/tpp-mlir.cmake index 5c658f7c6bd67e..300ac99df3b734 100644 --- a/cmake/tpp-mlir.cmake +++ b/cmake/tpp-mlir.cmake @@ -27,11 +27,7 @@ if (TPP_MLIR_DIR) tpp_xsmm_runner_utils ) function(add_tpp_mlir_includes target) - target_include_directories(${target} - PRIVATE - ${TPP_MLIR_DIR}/../include - ${TPP_MLIR_DIR}/include - ${TPP_MLIR_DIR}/../runtime) + target_include_directories(${target} PRIVATE ${TPP_MLIR_DIR}/../include ${TPP_MLIR_DIR}/include) endfunction() function(add_tpp_mlir_libs target) target_link_directories(${target} PRIVATE ${TPP_MLIR_DIR}/lib) diff --git a/src/common/transformations/src/transformations/mlir/mlir_op.cpp b/src/common/transformations/src/transformations/mlir/mlir_op.cpp index 7bba79c2dffcec..eea1019f60db91 100644 --- a/src/common/transformations/src/transformations/mlir/mlir_op.cpp +++ b/src/common/transformations/src/transformations/mlir/mlir_op.cpp @@ -4,17 +4,16 @@ #include "mlir_op.hpp" +#include #include #include #include #include -#include #include "mlir/Dialect/Bufferization/Transforms/Passes.h" #include "mlir/Pass/PassManager.h" // TODO: Prune unused headers -- it's hard to understand needed ones -#include "llvm/ADT/SmallVector.h" #include "llvm/MC/TargetRegistry.h" #include "llvm/Support/Casting.h" #include "llvm/Support/InitLLVM.h" @@ -55,16 +54,8 @@ #include "mlir/Target/LLVMIR/ModuleTranslation.h" #ifdef TPP_MLIR // If TPP is available -# if defined(__APPLE__) || defined(__linux__) || defined(__EMSCRIPTEN__) -# include -# else -# error "Unsupported OS" -# endif - -# include "PerfRunnerUtils.h" -# include "TPP/PassBundles.h" -# include "TPP/Passes.h" -# include "openvino/util/file_util.hpp" +#include "TPP/PassBundles.h" +#include "TPP/Passes.h" #endif namespace { @@ -264,19 +255,6 @@ namespace mlir { using namespace ::mlir; -static std::string get_xsmm_runner_path() { -#if defined(__APPLE__) || defined(__linux__) || defined(__EMSCRIPTEN__) - // TODO: Add multiplatform shared library search support. - Dl_info info; - if (dladdr(reinterpret_cast(perf_start_timer), &info) == 0) { - llvm::errs() << "failed to find XSMM Runner library\n"; - abort(); - } - return ov::util::get_absolute_file_path(info.dli_fname); -#else -# error "Unsupported OS" -#endif -} MLIREvaluate::MLIREvaluate(OwningOpRef _module) : module(std::move(_module)) { if (true) { @@ -303,8 +281,6 @@ MLIREvaluate::MLIREvaluate(OwningOpRef _module) : module(std::mo engineOptions.transformer = optPipeline; // opt level looks to be overriden in lowerToLLVMIR, but is still used // in `create` independently engineOptions.llvmModuleBuilder = lowerToLLVMIR; - std::string xsmmLibPath = get_xsmm_runner_path(); - engineOptions.sharedLibPaths = SmallVector{xsmmLibPath}; auto maybeEngine = mlir::ExecutionEngine::create(module.get(), engineOptions); if (maybeEngine) { engine = std::move(maybeEngine.get());