Skip to content

Commit

Permalink
cleanup and enable the previously-failing reshape parallelization
Browse files Browse the repository at this point in the history
  • Loading branch information
naoyam committed Sep 3, 2024
1 parent 1e8a10b commit ab65811
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
29 changes: 28 additions & 1 deletion csrc/device_lower/analysis/sync_information.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ SyncMap::SyncMap(Fusion* fusion) {
ca_map->areMapped(p_id, c_id, IdMappingMode::PERMISSIVE)) {
NVF_ERROR(
!requires_sync,
"Sync analysis mismatch. Sync not required with the legacy analysis but with the new analysis. ",
expr->toString(),
p_id->toString(),
" (",
Expand All @@ -752,11 +753,37 @@ SyncMap::SyncMap(Fusion* fusion) {

if (producer_ptype == consumer_ptype) {
if (useSameIndex(producer, p_id, consumer, c_id, indexing_info)) {
NVF_ERROR(!requires_sync);
NVF_ERROR(
!requires_sync,
"Sync analysis mismatch. Sync not required with the legacy analysis but with the new analysis. ",
expr->toString(),
p_id->toString(),
" (",
p_loop->toString(),
")",
", ",
c_id->toString(),
" (",
c_loop->toString(),
")");
continue;
}
}

NVF_ERROR(
requires_sync,
"Sync analysis mismatch. Sync required with the legacy analysis but not with the new analysis. ",
expr->toString(),
p_id->toString(),
" (",
p_loop->toString(),
")",
", ",
c_id->toString(),
" (",
c_loop->toString(),
")");

raw_dims.set(producer_ptype);
} // end for ptypes

Expand Down
2 changes: 1 addition & 1 deletion tests/cpp/test_gpu_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2701,7 +2701,7 @@ TEST_F(GpuViewTest, FusionMismatchingReshape) {
// Parallelize all tensors as [BIDx, TIDx]
schedule.merge(0);
schedule.split(0, 128);
#if 0
#if 1
// TODO: sync analysis is not working yet
schedule.parallelize(0, ParallelType::BIDx);
schedule.parallelize(1, ParallelType::TIDx);
Expand Down

0 comments on commit ab65811

Please sign in to comment.