Skip to content

Commit

Permalink
Revert "Pass XSMM runner lib to MLIR execution engine (#147)"
Browse files Browse the repository at this point in the history
This reverts commit a510e01.
  • Loading branch information
adam-smnk authored Jul 25, 2024
1 parent a510e01 commit c94d756
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 32 deletions.
6 changes: 1 addition & 5 deletions cmake/tpp-mlir.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
30 changes: 3 additions & 27 deletions src/common/transformations/src/transformations/mlir/mlir_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@

#include "mlir_op.hpp"

#include <vector>
#include <algorithm>
#include <functional>
#include <memory>
#include <string>
#include <vector>

#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"
Expand Down Expand Up @@ -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 <dlfcn.h>
# 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 {
Expand Down Expand Up @@ -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<void*>(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<mlir::ModuleOp> _module) : module(std::move(_module)) {
if (true) {
Expand All @@ -303,8 +281,6 @@ MLIREvaluate::MLIREvaluate(OwningOpRef<mlir::ModuleOp> _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<StringRef>{xsmmLibPath};
auto maybeEngine = mlir::ExecutionEngine::create(module.get(), engineOptions);
if (maybeEngine) {
engine = std::move(maybeEngine.get());
Expand Down

0 comments on commit c94d756

Please sign in to comment.