Skip to main content

InProcessCollective

Struct InProcessCollective 

Source
pub struct InProcessCollective<'a, T, D: InProcessDevice<T>, E> { /* private fields */ }

Implementations§

Source§

impl<T, D, E> InProcessCollective<'_, T, D, E>
where T: Copy + Send + Sync + 'static, D: InProcessDevice<T>, E: From<D::Error> + From<InProcessError>,

Source

pub fn all_to_all( &self, input: &DistributedBuffer<T, D>, ) -> Result<(DistributedBuffer<T, D>, CollectiveStats), E>

Equal-count all-to-all. Each input rank stores destination shards in rank order; each output rank stores source shards in rank order.

Source

pub fn all_to_all_v( &self, input: &DistributedBuffer<T, D>, send_counts: &[Vec<usize>], ) -> Result<(VariableDistributedBuffer<T, D>, CollectiveStats), E>

Source§

impl<T, D, E> InProcessCollective<'_, T, D, E>
where T: Copy + Send + Sync + 'static, D: InProcessDevice<T>, E: From<D::Error> + From<InProcessError>,

Source

pub fn broadcast( &self, buffer: &DistributedBuffer<T, D>, root: usize, ) -> Result<CollectiveStats, E>

Source

pub fn all_gather( &self, input: &DistributedBuffer<T, D>, ) -> Result<(DistributedBuffer<T, D>, CollectiveStats), E>

Source

pub fn gather( &self, input: &DistributedBuffer<T, D>, root: usize, ) -> Result<(RootedBuffer<T, D>, CollectiveStats), E>

Source

pub fn scatter( &self, input: &RootedBuffer<T, D>, ) -> Result<(DistributedBuffer<T, D>, CollectiveStats), E>

Source

pub fn send_recv( &self, source: &DistributedBuffer<T, D>, destination: &DistributedBuffer<T, D>, transfer: PointToPointTransfer, ) -> Result<CollectiveStats, E>

Tagged point-to-point transfer between two rank-local buffers. This is synchronous on the host-staged transport; tag is retained in the API because network transports match send and receive by that value.

Source§

impl<B, T, E> InProcessCollective<'_, T, TensorDevice<B>, E>

Source

pub fn import_buffers( &self, buffers: Vec<TensorBuffer<B, T>>, ) -> Result<DistributedBuffer<T, TensorDevice<B>>, E>

Attach existing rank tensors without downloading and re-uploading values.

Source§

impl<T, D, E> InProcessCollective<'_, T, D, E>
where T: Copy + Send + Sync + 'static, D: InProcessDevice<T>, E: From<D::Error> + From<InProcessError>,

Source

pub fn allocate( &self, length_per_rank: usize, ) -> Result<DistributedBuffer<T, D>, E>

Source

pub fn allocate_rooted( &self, root: usize, length: usize, ) -> Result<RootedBuffer<T, D>, E>

Source

pub fn allocate_variable( &self, lengths: &[usize], ) -> Result<VariableDistributedBuffer<T, D>, E>

Source

pub fn upload_variable_rank( &self, buffer: &VariableDistributedBuffer<T, D>, rank: usize, values: &[T], ) -> Result<(), E>

Source

pub fn download_variable_rank( &self, buffer: &VariableDistributedBuffer<T, D>, rank: usize, ) -> Result<Vec<T>, E>

Source

pub fn upload_root( &self, buffer: &RootedBuffer<T, D>, values: &[T], ) -> Result<(), E>

Source

pub fn download_root(&self, buffer: &RootedBuffer<T, D>) -> Result<Vec<T>, E>

Source

pub fn upload_rank( &self, buffer: &DistributedBuffer<T, D>, rank: usize, values: &[T], ) -> Result<(), E>

Source

pub fn download_rank( &self, buffer: &DistributedBuffer<T, D>, rank: usize, ) -> Result<Vec<T>, E>

Source§

impl<T, D, E> InProcessCollective<'_, T, D, E>
where T: Copy + Send + Sync + 'static, D: InProcessDevice<T>, E: From<D::Error> + From<InProcessError>,

Source

pub fn reduce_sum( &self, input: &DistributedBuffer<T, D>, root: usize, function: &D::Kernel, ) -> Result<(RootedBuffer<T, D>, CollectiveStats), E>

Source

pub fn all_reduce_sum( &self, buffer: &DistributedBuffer<T, D>, function: &D::Kernel, ) -> Result<CollectiveStats, E>

Source

pub fn reduce_scatter_sum( &self, input: &DistributedBuffer<T, D>, function: &D::Kernel, ) -> Result<(DistributedBuffer<T, D>, CollectiveStats), E>

Source§

impl<T, D, E> InProcessCollective<'_, T, D, E>
where T: Copy + Send + Sync + 'static, D: InProcessDevice<T>, E: From<D::Error> + From<InProcessError>,

Source

pub fn world_size(&self) -> usize

Source

pub const fn transport(&self) -> CollectiveTransport

Auto Trait Implementations§

§

impl<'a, T, D, E> Freeze for InProcessCollective<'a, T, D, E>
where &'a [<D as InProcessDevice<T>>::Context]: Freeze, PhantomData<fn() -> (T, E)>: Freeze,

§

impl<'a, T, D, E> RefUnwindSafe for InProcessCollective<'a, T, D, E>

§

impl<'a, T, D, E> Send for InProcessCollective<'a, T, D, E>
where &'a [<D as InProcessDevice<T>>::Context]: Send, PhantomData<fn() -> (T, E)>: Send,

§

impl<'a, T, D, E> Sync for InProcessCollective<'a, T, D, E>
where &'a [<D as InProcessDevice<T>>::Context]: Sync, PhantomData<fn() -> (T, E)>: Sync,

§

impl<'a, T, D, E> Unpin for InProcessCollective<'a, T, D, E>
where &'a [<D as InProcessDevice<T>>::Context]: Unpin, PhantomData<fn() -> (T, E)>: Unpin,

§

impl<'a, T, D, E> UnsafeUnpin for InProcessCollective<'a, T, D, E>

§

impl<'a, T, D, E> UnwindSafe for InProcessCollective<'a, T, D, E>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

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

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

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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