compact_runtime

Reversible compact forwards for physically sliced attention and GDN candidates.

Functions

compact_gated_delta_net_forward

Run Qwen-style GDN with the exact compact geometry used by materialization.

compact_grouped_attention_forward

Run gated grouped attention with the exact projection geometry of export.

resolve_compact_grouped_attention_target

Resolve one physically compact gated-attention target, if supported.

supports_compact_gated_delta_net

Return whether this exact tested Qwen GDN layout supports compact execution.

supports_compact_grouped_attention

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.

Parameters:
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