Skip to content

Commit

Permalink
Rename transformOutputFromAllocationToLogical (#3341)
Browse files Browse the repository at this point in the history
  • Loading branch information
wujingyue authored Nov 6, 2024
1 parent 7074f87 commit e4ec3aa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions csrc/runtime/allocations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,12 +671,11 @@ class BackwardTraverseFromAllocToLogical {
// Another example, if the logical domain is [I1*I2] and the allocation domain
// is [I1, I2], then we will allocate as [I1, I2] and do a tensor.view(I1*I2) to
// get a tensor whose semantics is [I1*I2] but memory is [I1,I2]
at::Tensor transformOutputFromAllocationToLogical(
at::Tensor transformFromAllocationToLogical(
at::Tensor tensor,
TensorView* tv,
ExpressionEvaluator& ee) {
FUSER_PERF_SCOPE(
"fusion_executor::allocations::transformOutputFromAllocationToLogical");
FUSER_PERF_SCOPE("allocations::transformFromAllocationToLogical");
// Ignore reductions because reductions does not exist in tensor's definition
auto logical = TensorDomain::noReductions(tv->getLogicalDomain());
auto alloc = TensorDomain::noReductions(tv->getMaybeAllocationDomain());
Expand Down Expand Up @@ -751,9 +750,8 @@ std::pair<std::vector<int64_t>, std::vector<int64_t>> inferShapeOfOutput(
at::empty_strided(size_stride.first, size_stride.second, options);
// TODO(jiej): we should refactor it here, there's no need to use
// meta_tensor at all, size + stride should be used directly in the
// `transformOutputFromAllocationToLogical`
meta_tensor =
transformOutputFromAllocationToLogical(meta_tensor, tv, expr_eval);
// `transformFromAllocationToLogical`
meta_tensor = transformFromAllocationToLogical(meta_tensor, tv, expr_eval);
return {meta_tensor.sizes().vec(), meta_tensor.strides().vec()};
}

Expand Down

0 comments on commit e4ec3aa

Please sign in to comment.