Skip to content

Commit

Permalink
WIP tpp-opt pipelines-as-schedules via python
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfmorel committed Dec 24, 2024
1 parent 8d0da95 commit c75ec29
Show file tree
Hide file tree
Showing 5 changed files with 445 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/TPP/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ namespace arith {
class ArithDialect;
} // namespace arith

namespace async {
class AsyncDialect;
} // namespace async

namespace check {
class CheckDialect;
} // namespace check
Expand Down Expand Up @@ -56,6 +60,10 @@ namespace memref {
class MemRefDialect;
} // namespace memref

namespace omp {
class OpenMPDialect;
} // namespace omp

namespace perf {
class PerfDialect;
} // namespace perf
Expand Down
17 changes: 17 additions & 0 deletions include/TPP/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@

include "mlir/Pass/PassBase.td"

def LoadTppDialects : Pass<"load-tpp-dialects", "ModuleOp"> {
let summary = "Pre-load all TPP-specific dialects";
let description = [{
Pre-load dialects that -transform-interpreter would try to load at runtime.

The issue is that -transform-interpreter runs inside the multi-threaded
passmanager. Hence when the interpreter dynamically tries to load dependent
dialects this triggers an assert as loading during multi-threaded execution
could lead to concurrency issues.
}];
let dependentDialects = ["xsmm::XsmmDialect",
"check::CheckDialect",
"perf::PerfDialect",
"omp::OpenMPDialect",
"async::AsyncDialect"];
}

def ConvertLinalgToXsmm : Pass<"convert-linalg-to-xsmm", "func::FuncOp"> {
let summary = "Convert linalg to xsmm";
let description = [{
Expand Down
1 change: 1 addition & 0 deletions lib/TPP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
add_mlir_library(TPPPipeline
DefaultPipeline.cpp
DefaultTppPasses.cpp
LoadTppDialects.cpp

ADDITIONAL_HEADER_DIRS
${PROJECT_SOURCE_DIR}/include/TPP
Expand Down
41 changes: 41 additions & 0 deletions lib/TPP/LoadTppDialects.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//===- LoadTppDialects.cpp -----------------------------------------*- C++-*-===//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// Pass is a no-op as it is only used for the side-effect of loading dialects.
//
//===----------------------------------------------------------------------===//
#include "mlir/Pass/Pass.h"
#include "mlir/IR/BuiltinOps.h"
#include "TPP/Dialect/Check/CheckDialect.h"
#include "TPP/Dialect/Perf/PerfDialect.h"
#include "TPP/Dialect/Xsmm/XsmmDialect.h"
#include "mlir/Dialect/Async/IR/Async.h"
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"


namespace mlir {
namespace tpp {
#define GEN_PASS_DEF_LOADTPPDIALECTS
#include "TPP/Passes.h.inc"
} // namespace tpp
} // namespace mlir

using namespace mlir;
using namespace std;

namespace mlir {
namespace tpp {
struct LoadTppDialects
: public impl::LoadTppDialectsBase<LoadTppDialects> {
void runOnOperation() override {}
};
} // namespace tpp
} // namespace mlir

Loading

0 comments on commit c75ec29

Please sign in to comment.