pub struct SingleDeviceTP;Expand description
No-op tensor parallel for single device (world_size=1)
Trait Implementations§
Source§impl TensorParallel for SingleDeviceTP
impl TensorParallel for SingleDeviceTP
Source§fn world_size(&self) -> usize
fn world_size(&self) -> usize
Number of devices (world size)
Source§fn all_reduce_sum(&self, _tensor: &mut Tensor) -> BackendResult<()>
fn all_reduce_sum(&self, _tensor: &mut Tensor) -> BackendResult<()>
All-reduce sum: sum tensor across all devices in-place
Source§fn all_gather(&self, local: &Tensor, output: &mut Tensor) -> BackendResult<()>
fn all_gather(&self, local: &Tensor, output: &mut Tensor) -> BackendResult<()>
All-gather: gather local tensors from all devices into output
output is world_size * local_size
Source§fn scatter(&self, input: &Tensor, output: &mut Tensor) -> BackendResult<()>
fn scatter(&self, input: &Tensor, output: &mut Tensor) -> BackendResult<()>
Scatter: split input across devices, each gets 1/world_size
Source§fn barrier(&self) -> BackendResult<()>
fn barrier(&self) -> BackendResult<()>
Barrier: synchronize all devices
Auto Trait Implementations§
impl Freeze for SingleDeviceTP
impl RefUnwindSafe for SingleDeviceTP
impl Send for SingleDeviceTP
impl Sync for SingleDeviceTP
impl Unpin for SingleDeviceTP
impl UnsafeUnpin for SingleDeviceTP
impl UnwindSafe for SingleDeviceTP
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more