joint_attention_base
joint_attention_base
¶
Base class for dual-stream attention mechanisms.
Provides shared K/V concatenation, GQA expansion, dual SDPA, mask building, and tensor reshaping used by both full and precomputed dual-stream attention variants.
References
Esser et al. "Scaling Rectified Flow Transformers for High-Resolution Image Synthesis" https://arxiv.org/abs/2403.03206
JointAttentionBase
¶
Bases: Module
Shared dual-stream attention computation.
Subclasses handle projection (full vs precomputed primary) and call
_joint_sdpa with the projected Q/K/V tensors.
Shape notation
B: batch size S: primary sequence length T: secondary sequence length H: number of query heads KV_H: number of key/value heads D_head: per-head dimension