Trait RunnerClient

Source
pub trait RunnerClient:
    Clone
    + Send
    + Sync
    + Sized {
    type Device: DeviceOps;

    // Required methods
    fn register(&self, op: OperationIr);
    fn read_tensor(&self, tensor: TensorIr) -> DynFut<TensorData>;
    fn sync(&self);
    fn register_tensor_data(&self, data: TensorData) -> RouterTensor<Self>;
    fn register_empty_tensor(
        &self,
        shape: Vec<usize>,
        dtype: DType,
    ) -> RouterTensor<Self>;
    fn register_float_tensor(
        &self,
        shape: Vec<usize>,
        dtype: FloatDType,
    ) -> RouterTensor<Self>;
    fn device(&self) -> Self::Device;
    fn seed(&self, seed: u64);
}
Expand description

Define how to interact with the runner.

Required Associated Types§

Source

type Device: DeviceOps

Device type.

Required Methods§

Source

fn register(&self, op: OperationIr)

Register a new tensor operation to be executed by the (runner) server.

Source

fn read_tensor(&self, tensor: TensorIr) -> DynFut<TensorData>

Read the values contained by a tensor.

Source

fn sync(&self)

Sync the runner, ensure that all computations are finished.

Source

fn register_tensor_data(&self, data: TensorData) -> RouterTensor<Self>

Create a new RouterTensor from the tensor data.

Source

fn register_empty_tensor( &self, shape: Vec<usize>, dtype: DType, ) -> RouterTensor<Self>

Create a new RouterTensor with no resources associated.

Source

fn register_float_tensor( &self, shape: Vec<usize>, dtype: FloatDType, ) -> RouterTensor<Self>

Create a new float RouterTensor with no resources associated.

Source

fn device(&self) -> Self::Device

Get the current device used by all operations handled by this client.

Source

fn seed(&self, seed: u64)

Seed the runner.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<B1: BackendIr, B2: BackendIr> RunnerClient for burn_router::duo::MultiRunnerClient<B1, B2>

Source§

impl<B1: BackendIr, B2: BackendIr, B3: BackendIr> RunnerClient for burn_router::trio::MultiRunnerClient<B1, B2, B3>

Source§

type Device = MultiDevice<B1, B2, B3>

Source§

impl<B1: BackendIr, B2: BackendIr, B3: BackendIr, B4: BackendIr> RunnerClient for burn_router::quad::MultiRunnerClient<B1, B2, B3, B4>

Source§

type Device = MultiDevice<B1, B2, B3, B4>

Source§

impl<B: BackendIr> RunnerClient for Runner<B>