From 259edfbd812743aea40bb3e093a5bc5869355331 Mon Sep 17 00:00:00 2001 From: Felix Reissmann Date: Mon, 21 Oct 2024 13:16:42 +0200 Subject: [PATCH] Move scheduling infrastructure to mlir::cinm::utils::scheduling. --- .../include/cinm-mlir/Utils/Scheduling/Schedulers/Alap.h | 4 ++-- .../include/cinm-mlir/Utils/Scheduling/Schedulers/Asap.h | 4 ++-- cinnamon/include/cinm-mlir/Utils/Scheduling/Scheduling.h | 8 ++------ cinnamon/lib/Dialect/Cim/Transforms/SchedulingPasses.cpp | 8 ++++---- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/cinnamon/include/cinm-mlir/Utils/Scheduling/Schedulers/Alap.h b/cinnamon/include/cinm-mlir/Utils/Scheduling/Schedulers/Alap.h index 0e4670a..6f44443 100644 --- a/cinnamon/include/cinm-mlir/Utils/Scheduling/Schedulers/Alap.h +++ b/cinnamon/include/cinm-mlir/Utils/Scheduling/Schedulers/Alap.h @@ -11,7 +11,7 @@ #include "cinm-mlir/Utils/Scheduling/Scheduling.h" -namespace mlir::cim::scheduling { +namespace mlir::cinm::utils::scheduling { template class AlapScheduler { @@ -68,4 +68,4 @@ namespace mlir::cim::scheduling { llvm::ArrayRef computeResources; }; -} // namespace mlir::cim::scheduling \ No newline at end of file +} // namespace mlir::cinm::utils::scheduling \ No newline at end of file diff --git a/cinnamon/include/cinm-mlir/Utils/Scheduling/Schedulers/Asap.h b/cinnamon/include/cinm-mlir/Utils/Scheduling/Schedulers/Asap.h index 708e470..4075bcc 100644 --- a/cinnamon/include/cinm-mlir/Utils/Scheduling/Schedulers/Asap.h +++ b/cinnamon/include/cinm-mlir/Utils/Scheduling/Schedulers/Asap.h @@ -10,7 +10,7 @@ #include "cinm-mlir/Utils/Scheduling/Scheduling.h" -namespace mlir::cim::scheduling { +namespace mlir::cinm::utils::scheduling { template class AsapScheduler { @@ -61,4 +61,4 @@ namespace mlir::cim::scheduling { llvm::ArrayRef computeResources; }; -} // namespace mlir::cim::scheduling \ No newline at end of file +} // namespace mlir::cinm::utils::scheduling \ No newline at end of file diff --git a/cinnamon/include/cinm-mlir/Utils/Scheduling/Scheduling.h b/cinnamon/include/cinm-mlir/Utils/Scheduling/Scheduling.h index e18a6be..15e9e87 100644 --- a/cinnamon/include/cinm-mlir/Utils/Scheduling/Scheduling.h +++ b/cinnamon/include/cinm-mlir/Utils/Scheduling/Scheduling.h @@ -15,11 +15,7 @@ #include #include #include - -#include "cinm-mlir/Dialect/Cim/IR/CimDialect.h" -#include "cinm-mlir/Dialect/Cim/Transforms/Passes.h" - -namespace mlir::cim::scheduling { +namespace mlir::cinm::utils::scheduling { struct DependencyGraphNode { Operation &operation; @@ -141,4 +137,4 @@ namespace mlir::cim::scheduling { } } -} // namespace mlir::cim::scheduling \ No newline at end of file +} // namespace mlir::cinm::utils::scheduling \ No newline at end of file diff --git a/cinnamon/lib/Dialect/Cim/Transforms/SchedulingPasses.cpp b/cinnamon/lib/Dialect/Cim/Transforms/SchedulingPasses.cpp index 469734c..640f033 100644 --- a/cinnamon/lib/Dialect/Cim/Transforms/SchedulingPasses.cpp +++ b/cinnamon/lib/Dialect/Cim/Transforms/SchedulingPasses.cpp @@ -183,14 +183,14 @@ namespace mlir::cim { auto [crossbars, roots] = prepareForScheduling(acquireDeviceOp, rewriter); Scheduler scheduler{crossbars}; - scheduling::SchedulingHooks hooks{ + cinm::utils::scheduling::SchedulingHooks hooks{ .rescheduleOperationFilter = isCimOp, .schedulingStrategy = std::bind(&Scheduler::schedule, &scheduler, std::placeholders::_1), .operationScheduler = scheduleCimOpOnCrossbar, .barrierInserter = insertBarrierForCimOpResult}; - scheduling::applyScheduling(rewriter, roots, hooks); + cinm::utils::scheduling::applyScheduling(rewriter, roots, hooks); op->setAttr("isFullyScheduled", rewriter.getBoolAttr(true)); @@ -230,7 +230,7 @@ namespace mlir::cim { //===----------------------------------------------------------------------===// - struct CimScheduleAsapPass : CimSchedulePassBase {}; - struct CimScheduleAlapPass : CimSchedulePassBase {}; + struct CimScheduleAsapPass : CimSchedulePassBase {}; + struct CimScheduleAlapPass : CimSchedulePassBase {}; } // namespace mlir::cim \ No newline at end of file