pub struct SingleGpuBackend;Expand description
Single-GPU backend: all collective ops are no-ops.
Used in Phase 1 where the entire model fits on one GPU.
Trait Implementations§
Source§impl CommBackend for SingleGpuBackend
impl CommBackend for SingleGpuBackend
Source§fn all_reduce(&self, _ptr: u64, _bytes: usize) -> Result<()>
fn all_reduce(&self, _ptr: u64, _bytes: usize) -> Result<()>
All-reduce: sum across all ranks, result on all ranks.
Source§fn all_gather(
&self,
_send_ptr: u64,
_recv_ptr: u64,
_bytes: usize,
) -> Result<()>
fn all_gather( &self, _send_ptr: u64, _recv_ptr: u64, _bytes: usize, ) -> Result<()>
All-gather: each rank contributes a chunk, all ranks get full buffer.
Source§fn reduce_scatter(
&self,
_send_ptr: u64,
_recv_ptr: u64,
_bytes: usize,
) -> Result<()>
fn reduce_scatter( &self, _send_ptr: u64, _recv_ptr: u64, _bytes: usize, ) -> Result<()>
Reduce-scatter: reduce + scatter (inverse of all-gather).
Source§fn broadcast(&self, _ptr: u64, _bytes: usize, _root: usize) -> Result<()>
fn broadcast(&self, _ptr: u64, _bytes: usize, _root: usize) -> Result<()>
Broadcast from root rank to all ranks.
Source§fn send_to(
&self,
_ptr: u64,
_bytes: usize,
_dest_rank: usize,
_stream: u64,
) -> Result<()>
fn send_to( &self, _ptr: u64, _bytes: usize, _dest_rank: usize, _stream: u64, ) -> Result<()>
Send tokens to a specific rank (for EP token dispatch). Read more
Source§fn recv_from(
&self,
_ptr: u64,
_bytes: usize,
_src_rank: usize,
_stream: u64,
) -> Result<()>
fn recv_from( &self, _ptr: u64, _bytes: usize, _src_rank: usize, _stream: u64, ) -> Result<()>
Receive tokens from a specific rank (for EP token combine). Read more
Source§fn world_size(&self) -> usize
fn world_size(&self) -> usize
Total number of ranks.
Source§fn all_reduce_async(
&self,
ptr: u64,
bytes: usize,
compute_stream: u64,
) -> Result<()>
fn all_reduce_async( &self, ptr: u64, bytes: usize, compute_stream: u64, ) -> Result<()>
Async all-reduce using GPU-side event synchronization. Read more
Source§fn register_buffer(&self, _ptr: u64, _bytes: usize) -> Result<u64>
fn register_buffer(&self, _ptr: u64, _bytes: usize) -> Result<u64>
Pre-register a GPU buffer with the communication backend. Read more
Source§fn deregister_buffer(&self, _handle: u64) -> Result<()>
fn deregister_buffer(&self, _handle: u64) -> Result<()>
Deregister a previously registered buffer.
Source§fn symmetric_alloc(&self, _bytes: usize) -> Result<u64>
fn symmetric_alloc(&self, _bytes: usize) -> Result<u64>
Allocate a GPU buffer in NCCL’s symmetric-memory window
(NCCL ≥ 2.28 /
ncclMemAlloc). Returns the device pointer as u64. Read moreSource§fn symmetric_free(&self, _ptr: u64) -> Result<()>
fn symmetric_free(&self, _ptr: u64) -> Result<()>
Free a buffer previously returned by
symmetric_alloc.Source§fn set_add_kernel(&self, _handle: u64)
fn set_add_kernel(&self, _handle: u64)
Provide a kernel handle for the BF16 in-place addition kernel. Read more
Source§fn group_start(&self) -> Result<()>
fn group_start(&self) -> Result<()>
Begin a group of point-to-point operations (send_to/recv_from). Read more
Source§fn is_healthy(&self) -> bool
fn is_healthy(&self) -> bool
Check if the communicator is healthy (no async errors, no timeouts). Read more
Auto Trait Implementations§
impl Freeze for SingleGpuBackend
impl RefUnwindSafe for SingleGpuBackend
impl Send for SingleGpuBackend
impl Sync for SingleGpuBackend
impl Unpin for SingleGpuBackend
impl UnwindSafe for SingleGpuBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more