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
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ sdpa_compute_attn_weights_coop:
TILE_K4: 1
TILE_N4: 1
generate_variant_forall:
combination:
parameter_names: [IO_STORAGE, K_CACHE_STORAGE]
combos:
- parameter_values: [texture3d, texture3d]
- parameter_values: [buffer, texture3d]
- parameter_values: [buffer, buffer]
DTYPE:
- VALUE: float
- VALUE: half
shader_variants:
- NAME: sdpa_compute_attn_weights_coop_texture3d_texture3d
- NAME: sdpa_compute_attn_weights_coop_buffer_texture3d
IO_STORAGE: buffer
- NAME: sdpa_compute_attn_weights_coop
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ sdpa_compute_attn_weights_tiled:
TILE_K4: 1
TILE_N4: 1
generate_variant_forall:
combination:
parameter_names: [IO_STORAGE, K_CACHE_STORAGE]
combos:
- parameter_values: [texture3d, texture3d]
- parameter_values: [buffer, texture3d]
- parameter_values: [buffer, buffer]
DTYPE:
- VALUE: float
- VALUE: half
shader_variants:
- NAME: sdpa_compute_attn_weights_tiled_texture3d_texture3d
- NAME: sdpa_compute_attn_weights_tiled_buffer_texture3d
IO_STORAGE: buffer
- NAME: sdpa_compute_attn_weights_tiled
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ sdpa_compute_out_coop:
TILE_K4: 1
TILE_N4: 1
generate_variant_forall:
combination:
parameter_names: [IO_STORAGE, V_CACHE_STORAGE]
combos:
- parameter_values: [texture3d, texture3d]
- parameter_values: [buffer, texture3d]
- parameter_values: [buffer, buffer]
DTYPE:
- VALUE: float
- VALUE: half
shader_variants:
- NAME: sdpa_compute_out_coop_texture3d_texture3d
- NAME: sdpa_compute_out_coop_buffer_texture3d
IO_STORAGE: buffer
- NAME: sdpa_compute_out_coop
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ sdpa_compute_out_tiled:
TILE_K4: 1
TILE_N4: 1
generate_variant_forall:
combination:
parameter_names: [IO_STORAGE, V_CACHE_STORAGE]
combos:
- parameter_values: [texture3d, texture3d]
- parameter_values: [buffer, texture3d]
- parameter_values: [buffer, buffer]
DTYPE:
- VALUE: float
- VALUE: half
shader_variants:
- NAME: sdpa_compute_out_tiled_texture3d_texture3d
- NAME: sdpa_compute_out_tiled_buffer_texture3d
IO_STORAGE: buffer
- NAME: sdpa_compute_out_tiled
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#define IN_VEC4_T ${texel_load_type(DTYPE, INPUT_STORAGE)}
#define T ${buffer_scalar_type(DTYPE)}

$if OUTPUT_STORAGE == "buffer":
#define OUTPUT_BUFFER
$if INPUT_STORAGE == "buffer":
#define INPUT_BUFFER

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ sdpa_kv_cache_update:
INPUT_STORAGE: texture3d
OUTPUT_STORAGE: texture3d
generate_variant_forall:
combination:
parameter_names: [OUTPUT_STORAGE, INPUT_STORAGE]
combos:
- parameter_values: [texture3d, texture3d]
- parameter_values: [texture3d, buffer]
- parameter_values: [buffer, buffer]
DTYPE:
- VALUE: half
- VALUE: float
shader_variants:
- NAME: sdpa_kv_cache_update_texture3d
- NAME: sdpa_kv_cache_update_buffer
INPUT_STORAGE: buffer
- NAME: sdpa_kv_cache_update
1 change: 1 addition & 0 deletions backends/vulkan/runtime/graph/ops/impl/SDPA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ void add_sdpa_kv_cache_update_node(
const ValueRef projected,
const ValueRef cache) {
std::string kernel_name("sdpa_kv_cache_update");
add_storage_type_suffix(kernel_name, graph.storage_type_of(cache));
add_storage_type_suffix(kernel_name, graph.storage_type_of(projected));
add_dtype_suffix(kernel_name, graph.dtype_of(projected));

Expand Down
Loading