Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 10 additions & 1 deletion benchmarks/python/sdpa_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,18 @@ def get_gflop_count(B, M, N, K):
( 1, 4096, 5000, 128, 32, 8),
( 1, 2048, 32121, 128, 32, 8),
)

shapes_256 = (
# ( B, qsl, ksl, head_dim, n_qh, n_kvh)
( 1, 1024, 1024, 256, 24, 4),
( 1, 2048, 2048, 256, 24, 4),
( 1, 4096, 4096, 256, 24, 4),
( 1, 4096, 5000, 256, 24, 4),
( 1, 2048, 32121, 256, 24, 4),
)
# fmt: on

shapes = shapes_64 + shapes_72 + shapes_80 + shapes_96 + shapes_128
shapes = shapes_64 + shapes_72 + shapes_80 + shapes_96 + shapes_128 + shapes_256

masks = [None, "bool", "causal"]

Expand Down
5 changes: 3 additions & 2 deletions mlx/backend/metal/jit_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,8 @@ MTL::ComputePipelineState* get_steel_attention_nax_kernel(
int bd,
int wm,
int wn,
const array& m) {
const array& m,
bool split_d) {
const auto& lib_name = kernel_name;
auto lib = d.get_library(lib_name, [&]() {
std::string kernel_source;
Expand All @@ -1340,7 +1341,7 @@ MTL::ComputePipelineState* get_steel_attention_nax_kernel(
metal::steel_attention_nax(),
get_template_definition(
lib_name,
"attention_nax",
split_d ? "attention_nax_dsplit" : "attention_nax",
get_type_string(q.dtype()),
bq,
bk,
Expand Down
3 changes: 2 additions & 1 deletion mlx/backend/metal/kernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ MTL::ComputePipelineState* get_steel_attention_nax_kernel(
int bd,
int wm,
int wn,
const array& m);
const array& m,
bool split_d);

// Create a GPU kernel template definition for JIT compilation
template <typename... Args>
Expand Down
Loading