Skip to content

Commit

Permalink
redefine OpTopoPattern
Browse files Browse the repository at this point in the history
  • Loading branch information
jiahy0825 committed Mar 6, 2024
1 parent 6dcde97 commit 826809a
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@ struct ReductionPattern {};
template <typename T>
struct PartialShardablePattern {};

// SR := [R | PS]
template <typename T>
using ShardableReductionsPattern = std::vector<std::variant<ReductionPattern<T>, PartialShardablePattern<T>>>;
using ShardableReductionPattern = std::vector<std::variant<ReductionPattern<T>, PartialShardablePattern<T>>>;

// fuse rules:
// 1. IS * PS -> PS
// 2. PS * PS -> PS
// 3. R * PS -> RS
// 4. RS * (PS | R) -> RS
// 3. PS * R -> R
// 4. IS * R -> R

// OpsTopoPattern := IS | SR
// lifting rules:
// 1. R -> SR
// 2. PS -> SR
// 3. SR * SR -> SR

// OpTopoPattern := IS | SR
template <typename T>
using OpsTopoPattern = std::variant<InjectiveSourcePattern<T>, ShardableReductionsPattern<T>>;
using OpTopoPattern = std::variant<InjectiveSourcePattern<T>, ShardableReductionPattern<T>>;

}

0 comments on commit 826809a

Please sign in to comment.