[Feature]: add Ulysses advanced_uaa mode (#1379)
Signed-off-by: dongbo910220 <1275604947@qq.com> Signed-off-by: dongbo910220 <32610838+dongbo910220@users.noreply.github.com> Co-authored-by: Didan Deng <33117903+wtomin@users.noreply.github.com>
This commit is contained in:
1 parent
4cfa9bf843
commit
50bd1961bf
17 files changed
+1064
-13
No files matched your search
@@ -55,6 +55,20 @@ class DiffusionParallelConfig:
|
||||
ring_degree: int = 1
|
||||
"""Number of GPUs used for ring sequence parallelism."""
|
||||
|
||||
ulysses_mode: str = "strict"
|
||||
"""Ulysses sequence-parallel mode.
|
||||
|
||||
- "strict": Require divisibility constraints (fastest, default).
|
||||
- "advanced_uaa": Enable UAA ("Ulysses Anything Attention") to support
|
||||
uneven sequence lengths and non-divisible head counts.
|
||||
|
||||
Note:
|
||||
- Ring attention does not support `attention_mask`, so models that rely on
|
||||
mask-based auto-padding are still incompatible with Ring.
|
||||
- When used in hybrid Ulysses+Ring, Ring requires consistent per-rank
|
||||
sequence shapes across the ring group.
|
||||
"""
|
||||
|
||||
cfg_parallel_size: int = 1
|
||||
"""Number of Classifier Free Guidance (CFG) parallel groups."""
|
||||
|
||||
@@ -88,6 +102,9 @@ class DiffusionParallelConfig:
|
||||
"Sequence parallel size must be equal to the product of ulysses degree and ring degree,"
|
||||
f" but got {self.sequence_parallel_size} != {self.ulysses_degree} * {self.ring_degree}"
|
||||
)
|
||||
assert self.ulysses_mode in {"strict", "advanced_uaa"}, (
|
||||
f"ulysses_mode must be one of {{'strict','advanced_uaa'}}, but got {self.ulysses_mode!r}."
|
||||
)
|
||||
|
||||
# Validate HSDP configuration
|
||||
if self.use_hsdp:
|
||||
|
||||
Reference in new issue
Block a user