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
6 changes: 5 additions & 1 deletion megakernels/demos/latency/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ def make_buffer(shape, buffer_dtype=dtype):

stacked_params = model.stacked_params

max_attn_partitions = get_sm_count(device)
def align_sm_to_partition_cacheline(x: int) -> int:
return int(math.ceil(x / 16) * 16)

max_attn_partitions = align_sm_to_partition_cacheline(get_sm_count(device))

barriers = torch.zeros(
[
Expand All @@ -60,6 +63,7 @@ def make_buffer(shape, buffer_dtype=dtype):
device=device,
)


return Globals(
# model params
qkv_proj_weights=stacked_params.qkv_proj,
Expand Down