NVIDIA/Fuser

`getExprsBetween` is not getting expressions between vals

Open

#2,383 opened on Jun 11, 2024

View on GitHub
 (5 comments) (0 reactions) (0 assignees)C++ (80 forks)github user discovery
Triagegood first issue

Repository metrics

Stars
 (392 stars)
PR merge metrics
 (PR metrics pending)

Description

TEST_F(IterVisitorTest, ExprsBetween) {
  Fusion fusion;
  FusionGuard fg(&fusion);

  TensorView* tv0 = makeSymbolicTensor(1);
  TensorView* tv1 = set(tv0);
  TensorView* tv2 = set(tv1);
  TensorView* tv3 = set(tv2);
  TensorView* tv4 = set(tv3);

  fusion.addInput(tv0);
  fusion.addOutput(tv4);

  auto exprs0 = StmtSort::getExprsBetween({tv2}, {tv3});
  auto exprs1 = StmtSort::getExprsBetween({tv3}, {tv2});

  std::cout << "exprs0: " << ir_utils::toString(exprs0) << std::endl;
  std::cout << "exprs1: " << ir_utils::toString(exprs1) << std::endl;

  EXPECT_EQ(exprs0, std::vector<Expr*>{tv3->definition()});
  EXPECT_EQ(exprs1, std::vector<Expr*>{});
}

I am expecting exprs1 to be empty, but getting:

exprs1:
T1_l[ iS1{i0} ]
   = Set( T0_g[ iS0{i0} ], cache_op=Streaming )
T2_l[ iS2{i0} ]
   = Set( T1_l[ iS1{i0} ], cache_op=Streaming )

Contributor guide