Skip to content

Commit

Permalink
Make loop the same as allocation to avoid a change in transform_replay.
Browse files Browse the repository at this point in the history
  • Loading branch information
wujingyue committed Nov 21, 2024
1 parent 44696e4 commit cf126e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion csrc/fusion_segmenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1889,7 +1889,7 @@ void eraseInputDistinctRootDomains(Fusion* fusion) {
/*root_domain=*/std::vector<IterDomain*>(),
new_logical_domain,
new_alloc,
/*loop_domain=*/new_logical_domain,
/*loop_domain=*/new_alloc,
tv->domain()->contiguity());
} else {
new_td = IrBuilder::create<TensorDomain>(
Expand Down
14 changes: 7 additions & 7 deletions csrc/transform_replay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,19 +757,19 @@ std::pair<TensorDomain*, int64_t> TransformReplay::replayCasP(
consumer->domain()->contiguity());

if (producer->hasAllocation()) {
std::vector<IterDomain*> producer_allocation =
TensorDomain::noReductions(producer->getAllocationDomain());
ReplayTransformations replay_CasP(
producer_allocation,
auto replay_CasP = BestEffortReplay(
new_IDs,
producer->getLoopDomain(),
logical_map.mapProducerToConsumer(producer->domain(), replayed));
const auto& p2c_map = replay_CasP.getReplay();

auto producer_rank = producer->getAllocationDomain().size();
std::vector<IterDomain*> new_allocation_domain;
new_allocation_domain.reserve(producer_allocation.size());
new_allocation_domain.reserve(producer_rank);
std::vector<std::optional<bool>> new_contiguity;
new_contiguity.reserve(producer_allocation.size());
new_contiguity.reserve(producer_rank);

for (auto i : c10::irange(producer->getAllocationDomain().size())) {
for (auto i : c10::irange(producer_rank)) {
IterDomain* id = producer->getAllocationDomain()[i];
// We won't find reduction IterDomains in the map. See
// AllocationDomainTest.CacheBefore.
Expand Down

0 comments on commit cf126e6

Please sign in to comment.