SingleGpuBackend

Struct SingleGpuBackend 

Source
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

Source§

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<()>

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<()>

Reduce-scatter: reduce + scatter (inverse of all-gather).
Source§

fn broadcast(&self, _ptr: u64, _bytes: usize, _root: usize) -> Result<()>

Broadcast from root rank to all ranks.
Source§

fn barrier(&self) -> Result<()>

Barrier: block until all ranks reach this point.
Source§

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<()>

Receive tokens from a specific rank (for EP token combine). Read more
Source§

fn rank(&self) -> usize

This rank’s index (0-based).
Source§

fn world_size(&self) -> usize

Total number of ranks.
Source§

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>

Pre-register a GPU buffer with the communication backend. Read more
Source§

fn deregister_buffer(&self, _handle: u64) -> Result<()>

Deregister a previously registered buffer.
Source§

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 more
Source§

fn symmetric_free(&self, _ptr: u64) -> Result<()>

Free a buffer previously returned by symmetric_alloc.
Source§

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<()>

Begin a group of point-to-point operations (send_to/recv_from). Read more
Source§

fn group_end(&self) -> Result<()>

End a group of point-to-point operations.
Source§

fn is_healthy(&self) -> bool

Check if the communicator is healthy (no async errors, no timeouts). Read more
Source§

fn attempt_reconnect(&self) -> Result<()>

Attempt to recover a degraded communicator. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more