Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tile_kernels/engram/engram_grad_w_reduce_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ def get_engram_grad_w_reduce_kernel(
blk_d = 512
assert hidden_size % blk_d == 0
num_tiles = hidden_size // blk_d
num_batches = 4
assert num_persistent_blocks % num_batches == 0
# SM90/SM100 devices can have SM counts such as 114, so avoid assuming
# that the persistent-block count is always divisible by four.
num_batches = max(batch for batch in range(4, 0, -1) if num_persistent_blocks % batch == 0)
num_rows = num_persistent_blocks // num_batches

@T.prim_func
Expand Down