Skip to content

Commit

Permalink
Fix grouped gemm invalid memory access to problem shapes (#1543)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongroo authored Jul 10, 2024
1 parent 52fb43f commit 56b46e2
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,9 @@ class GemmUniversal<
TileScheduler scheduler{params.scheduler};
auto work_tile_info = scheduler.get_current_work();
if (not work_tile_info.is_valid()) {
return;
}
// Optionally append 1s until problem shape is rank-4 in case it is only rank-3 (MNK)
auto problem_shape_MNKL = append<4>(params.problem_shape.get_problem_shape(work_tile_info.L_idx), Int<1>{});
Expand Down Expand Up @@ -623,7 +626,9 @@ class GemmUniversal<
// Get next work tile
work_tile_info = fetch_next_work(work_tile_info, scheduler);
if constexpr (IsGroupedGemmKernel) {
problem_shape_MNKL = append<4>(params.problem_shape.get_problem_shape(work_tile_info.L_idx), Int<1>{});
if (work_tile_info.is_valid()) {
problem_shape_MNKL = append<4>(params.problem_shape.get_problem_shape(work_tile_info.L_idx), Int<1>{});
}
}
} // Scheduler work fetch loop
Expand Down Expand Up @@ -702,7 +707,9 @@ class GemmUniversal<
// Get next work tile
work_tile_info = fetch_next_work(work_tile_info, scheduler);
if constexpr (IsGroupedGemmKernel) {
problem_shape_MNKL = append<4>(params.problem_shape.get_problem_shape(work_tile_info.L_idx), Int<1>{});
if (work_tile_info.is_valid()) {
problem_shape_MNKL = append<4>(params.problem_shape.get_problem_shape(work_tile_info.L_idx), Int<1>{});
}
}
} // Scheduler work fetch loop
Expand Down

0 comments on commit 56b46e2

Please sign in to comment.