Skip to content

Commit

Permalink
Move scheduling infrastructure to mlir::cinm::utils::scheduling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix-Rm committed Oct 21, 2024
1 parent 7f3fbb2 commit 259edfb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions cinnamon/include/cinm-mlir/Utils/Scheduling/Schedulers/Alap.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "cinm-mlir/Utils/Scheduling/Scheduling.h"

namespace mlir::cim::scheduling {
namespace mlir::cinm::utils::scheduling {

template<typename ComputeResource>
class AlapScheduler {
Expand Down Expand Up @@ -68,4 +68,4 @@ namespace mlir::cim::scheduling {

llvm::ArrayRef<ComputeResource> computeResources;
};
} // namespace mlir::cim::scheduling
} // namespace mlir::cinm::utils::scheduling
4 changes: 2 additions & 2 deletions cinnamon/include/cinm-mlir/Utils/Scheduling/Schedulers/Asap.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "cinm-mlir/Utils/Scheduling/Scheduling.h"

namespace mlir::cim::scheduling {
namespace mlir::cinm::utils::scheduling {

template<typename ComputeResource>
class AsapScheduler {
Expand Down Expand Up @@ -61,4 +61,4 @@ namespace mlir::cim::scheduling {

llvm::ArrayRef<ComputeResource> computeResources;
};
} // namespace mlir::cim::scheduling
} // namespace mlir::cinm::utils::scheduling
8 changes: 2 additions & 6 deletions cinnamon/include/cinm-mlir/Utils/Scheduling/Scheduling.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
#include <limits>
#include <list>
#include <vector>

#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;
Expand Down Expand Up @@ -141,4 +137,4 @@ namespace mlir::cim::scheduling {
}
}

} // namespace mlir::cim::scheduling
} // namespace mlir::cinm::utils::scheduling
8 changes: 4 additions & 4 deletions cinnamon/lib/Dialect/Cim/Transforms/SchedulingPasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ namespace mlir::cim {
auto [crossbars, roots] = prepareForScheduling(acquireDeviceOp, rewriter);
Scheduler<Value> scheduler{crossbars};

scheduling::SchedulingHooks<Value> hooks{
cinm::utils::scheduling::SchedulingHooks<Value> hooks{
.rescheduleOperationFilter = isCimOp,
.schedulingStrategy =
std::bind(&Scheduler<Value>::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));

Expand Down Expand Up @@ -230,7 +230,7 @@ namespace mlir::cim {

//===----------------------------------------------------------------------===//

struct CimScheduleAsapPass : CimSchedulePassBase<scheduling::AsapScheduler, impl::CimScheduleAsapPassBase> {};
struct CimScheduleAlapPass : CimSchedulePassBase<scheduling::AlapScheduler, impl::CimScheduleAlapPassBase> {};
struct CimScheduleAsapPass : CimSchedulePassBase<cinm::utils::scheduling::AsapScheduler, impl::CimScheduleAsapPassBase> {};
struct CimScheduleAlapPass : CimSchedulePassBase<cinm::utils::scheduling::AlapScheduler, impl::CimScheduleAlapPassBase> {};

} // namespace mlir::cim

0 comments on commit 259edfb

Please sign in to comment.