compact_runtime
Reversible compact forwards for physically sliced attention and GDN candidates.
Functions
Run Qwen-style GDN with the exact compact geometry used by materialization. |
|
Run gated grouped attention with the exact projection geometry of export. |
|
Resolve one physically compact gated-attention target, if supported. |
|
Return whether this exact tested Qwen GDN layout supports compact execution. |
|
Return whether this exact tested Qwen attention layout supports compact execution. |
- compact_gated_delta_net_forward(gdn_module, *, teacher_shape, target_shape)
Run Qwen-style GDN with the exact compact geometry used by materialization.
- compact_grouped_attention_forward(attention_module, *, orig_num_q, orig_num_kv, target_num_q, target_num_kv, head_dim)
Run gated grouped attention with the exact projection geometry of export.
- Parameters:
orig_num_q (int)
orig_num_kv (int)
target_num_q (int)
target_num_kv (int)
head_dim (int)
- resolve_compact_grouped_attention_target(layer, teacher_attention, child_attention)
Resolve one physically compact gated-attention target, if supported.
- supports_compact_gated_delta_net(gdn_module, *, teacher_shape)
Return whether this exact tested Qwen GDN layout supports compact execution.
- Parameters:
teacher_shape (GDNShape)
- Return type:
bool
- supports_compact_grouped_attention(attention_module, *, orig_num_q, orig_num_kv, head_dim)
Return whether this exact tested Qwen attention layout supports compact execution.
- Parameters:
orig_num_q (int)
orig_num_kv (int)
head_dim (int)
- Return type:
bool