[Bugfix] Solve Ulysses-SP sequence length not divisible by SP degree (using padding and attention mask) (#672)

Signed-off-by: Didan Deng <33117903+wtomin@users.noreply.github.com>
This commit is contained in:
Didan Deng authored and GitHub committed 2026-01-08 00:02:22 +08:00
1 parent 89f47c910a
commit 4df794bdaa
4 files changed
+244 -12

No files matched your search

@@ -48,6 +48,8 @@ class AttentionBackend(ABC):
@dataclass
class AttentionMetadata:
attn_mask: torch.Tensor | None = None
joint_attn_mask: torch.Tensor | None = None
# a joint mask for the joint query, key, and value, depends the joint_strategy
joint_query: torch.Tensor | None = None
# a replicated tensor among processes appended to the front or rear of query, depends the joint_strategy
joint_key: torch.Tensor | None = None