Skip to content

Commit

Permalink
Add slice tests to demonstrate manual scheduling (#2898)
Browse files Browse the repository at this point in the history
Slice and concat patterns without rotation. See #2851.

Stacked on #2897, #2875
Closes #2870
  • Loading branch information
naoyam authored Sep 5, 2024
1 parent 1158543 commit 0058da9
Show file tree
Hide file tree
Showing 4 changed files with 518 additions and 28 deletions.
3 changes: 0 additions & 3 deletions csrc/device_lower/lower2device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,6 @@ void GpuLower::analysis(Fusion* fusion) {
validateSwizzle(fusion_);
dumpExprsIfEnabled(fusion_->exprs(), "validateSwizzle");

validateResize(fusion_);
dumpExprsIfEnabled(fusion_->exprs(), "validateResize");

validateReductions(fusion_);
dumpExprsIfEnabled(fusion_->exprs(), "validateReductions");

Expand Down
19 changes: 0 additions & 19 deletions csrc/device_lower/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1058,25 +1058,6 @@ void validateLookupTV(Fusion* fusion) {
}
}

void validateResize(Fusion* fusion) {
auto fusion_vals = fusion->usedMathVals();
for (auto tv : ir_utils::filterByType<TensorView>(fusion_vals)) {
// Make sure resize is only used as part of root to logical transformations
auto rf_to_loop_exprs = StmtSort::getExprsBetween(
{tv->getLogicalDomain().begin(), tv->getLogicalDomain().end()},
{tv->getLoopDomain().begin(), tv->getLoopDomain().end()});

NVF_ERROR(
std::none_of(
rf_to_loop_exprs.begin(),
rf_to_loop_exprs.end(),
[](Expr* expr) { return expr->isA<Resize>(); }),
"Invalid use of resize detected with ",
tv->toString(),
". Resize may only be used as part of root to logical transformations.");
}
}

void validateReductions(Fusion* fusion) {
for (auto rop : ir_utils::getOpsOfType<ReductionOp>(fusion)) {
auto in = rop->in()->as<TensorView>();
Expand Down
3 changes: 0 additions & 3 deletions csrc/device_lower/validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ void validateGroupedReductions(Fusion* fusion);
//! Validate all of the lookup TVs are ensured to be fusion inputs
void validateLookupTV(Fusion* fusion);

//! Validate resize usage
void validateResize(Fusion* fusion);

//! Check that there are no reductions over unexpanded broadcasts
void validateReductions(Fusion* fusion);

Expand Down
Loading

0 comments on commit 0058da9

Please sign in to comment.