Skip to content

Commit

Permalink
[PIR+CINN]Replace FlattenLoops with Fuse (PaddlePaddle#58910)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurelius84 authored and SecretXV committed Nov 28, 2023
1 parent 721e0ac commit 0442f1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions paddle/cinn/hlir/framework/pir/op_lowering_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -578,11 +578,7 @@ ir::Expr OpLowererImpl::DoGroupSchedule(
// if node is horizontal with reduce or node is reduce, loop assign
// master.
auto loops = ir_sch.GetLoops(op_out_name);
if (op_kind == framework::kElementWise) {
ir_sch.FlattenLoops(loops, true);
} else if (op_kind != framework::kReduction) {
ir_sch.FlattenLoops(loops, false);
}
ir_sch.Fuse(loops);

if (master && op_kind != framework::kReduction) {
auto master_loops =
Expand Down
2 changes: 1 addition & 1 deletion paddle/cinn/optim/transform_gpu_forloop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ class ReplaceLoopVarToGpu : public ir::IRMutator<> {
auto bind_info = for_ir->bind_info();

std::string var_name = "";
if (bind_info.offset == 0)
if (bind_info.offset <= 0)
var_name = "x";
else if (bind_info.offset == 1)
var_name = "y";
Expand Down

0 comments on commit 0442f1a

Please sign in to comment.