ulysses_a2a ¶
Fused NVLink all-to-all for Ulysses sequence parallelism.
Drop-in replacement for DistributedAutograd.AllToAll4D when the group is a load-store accessible NVLink mesh: same layout, byte-identical results, fewer passes over local memory. Anything else falls back to the NCCL path.
Classes¶
fastvideo.distributed.device_communicators.ulysses_a2a.UlyssesA2AHelper ¶
UlyssesA2AHelper(cpu_group: ProcessGroup, device_group: ProcessGroup, world_size: int, device: device, pynccl_comm)
Owns the fused all-to-all context for one sequence-parallel group.
Group capability is agreed during construction; the NCCL window is registered on first use, once an operand size is known.
Source code in fastvideo/distributed/device_communicators/ulysses_a2a.py
Methods:¶
fastvideo.distributed.device_communicators.ulysses_a2a.UlyssesA2AHelper.close ¶
close() -> bool
Collectively destroy the device communicator and its window.
Returns whether all ranks completed teardown. An armed/unarmed split cannot safely enter NCCL window deregistration, so that exceptional state is leaked until process exit and permanently disabled instead of risking a distributed deadlock.
Source code in fastvideo/distributed/device_communicators/ulysses_a2a.py
fastvideo.distributed.device_communicators.ulysses_a2a.UlyssesA2AHelper.run_armed ¶
run_armed(x: Tensor, mode: int) -> Tensor
Run one collective on an already-armed context.
Source code in fastvideo/distributed/device_communicators/ulysses_a2a.py
fastvideo.distributed.device_communicators.ulysses_a2a.UlyssesA2AHelper.try_all_to_all_4D ¶
Fused collective, or None to let the caller use the NCCL path.
Source code in fastvideo/distributed/device_communicators/ulysses_a2a.py
Functions:¶
fastvideo.distributed.device_communicators.ulysses_a2a.maybe_create_helper ¶
maybe_create_helper(cpu_group: ProcessGroup | None, device_group: ProcessGroup | None, world_size: int, device: device | None, pynccl_comm) -> UlyssesA2AHelper | None
Collectively create a helper only when every rank can use it.