Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#15 from Fridge003/multi-down
Browse files Browse the repository at this point in the history
update LiftToAnchorPattern
  • Loading branch information
feifei-111 authored Apr 29, 2024
2 parents b0172b4 + 8e7d785 commit eb6ef40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion paddle/cinn/operator_fusion/graph_transformer/operation.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ struct LiftToHorizontalFusionPatternOperation {
struct LiftToAnchorPatternOperation {
template <typename Phrase>
void operator()(PatternGraph<Phrase>* graph, PatternNodePtr<Phrase> node) {
node->set_stmt_pattern(AnchorPattern<Phrase>(node->stmt_pattern()));
std::vector<pir::Operation*> ops = GetOpsInPattern(pattern);
pir::Value anchor = node->sink_op()->result(0);
node->set_stmt_pattern(AnchorPattern<Phrase>(ops, anchor));
}
};

Expand Down
2 changes: 1 addition & 1 deletion paddle/cinn/operator_fusion/pattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct AnchorPattern {
const std::vector<pir::Operation*>& ops,
const pir::Value& anchor const AnchorState<T>& anchor_state)
: ops_(ops), anchor_(anchor), {
// TODO(@wuzhanfei)
// TODO(@wuzhanfei): Initialize anchor state
}
std::vector<pir::Operation*> ops_;
pir::Value anchor_; // Choose only one anchor
Expand Down

0 comments on commit eb6ef40

Please sign in to comment.