|
tvm
|
A Disco interactive session. It allows users to interact with the Disco command queue with various ffi::Function calling convention. More...
#include <session.h>
Public Member Functions | |
| virtual | ~SessionObj ()=default |
| template<typename... Args> | |
| TVM_FFI_INLINE DRef | CallPacked (const DRef &func, Args &&... args) |
| Call a ffi::Function on workers providing variadic arguments. More... | |
| virtual TVM_RUNTIME_DLL DRef | CallWithPacked (const ffi::PackedArgs &args)=0 |
| Call packed function on each worker using a packed sequence. The calling convention: The first element must be DiscoAction::kCallPacked, The second element must be 0, which will later be updated by the session to return reg_id The thirtd element is the function to be called. More... | |
| virtual TVM_RUNTIME_DLL int64_t | GetNumWorkers ()=0 |
| Get the number of workers in the session. More... | |
| virtual TVM_RUNTIME_DLL DRef | GetGlobalFunc (const std::string &name)=0 |
| Get a global functions on workers. More... | |
| virtual TVM_RUNTIME_DLL void | CopyFromWorker0 (const Tensor &host_array, const DRef &remote_array)=0 |
| Copy an Tensor from worker-0 to the controler-side Tensor. More... | |
| virtual TVM_RUNTIME_DLL void | CopyToWorker0 (const Tensor &host_array, const DRef &remote_array)=0 |
| Copy the controler-side Tensor to worker-0. More... | |
| virtual TVM_RUNTIME_DLL void | SyncWorker (int worker_id)=0 |
| Synchrnoize the controler with a worker, and it will wait until worker finishes executing this instruction. More... | |
| virtual TVM_RUNTIME_DLL void | Shutdown ()=0 |
| Signal all the workers to shutdown. More... | |
| virtual TVM_RUNTIME_DLL void | InitCCL (ffi::String ccl, ffi::Shape device_ids)=0 |
| Initialize the data plane between workers. More... | |
| virtual TVM_RUNTIME_DLL ffi::Any | DebugGetFromRemote (int64_t reg_id, int worker_id)=0 |
| Get the value of a register from a remote worker. More... | |
| virtual TVM_RUNTIME_DLL void | DebugSetRegister (int64_t reg_id, ffi::AnyView value, int worker_id)=0 |
| Set the value of a register on a remote worker. More... | |
| TVM_FFI_DECLARE_OBJECT_INFO ("runtime.disco.Session", SessionObj, ffi::Object) | |
| template<typename... Args> | |
| DRef | CallPacked (const DRef &func, Args &&... args) |
Static Public Attributes | |
| static constexpr const bool | _type_mutable = true |
Protected Member Functions | |
| virtual void | DeallocReg (int reg_id)=0 |
Deallocate a register id, kill it on all workers, and append it to free_regs_. More... | |
Friends | |
| struct | SessionObj::FFI |
| class | DRefObj |
A Disco interactive session. It allows users to interact with the Disco command queue with various ffi::Function calling convention.
|
virtualdefault |
| TVM_FFI_INLINE DRef tvm::runtime::SessionObj::CallPacked | ( | const DRef & | func, |
| Args &&... | args | ||
| ) |
Call a ffi::Function on workers providing variadic arguments.
| Args | In the variadic arguments, the supported types include: |
| func | The function to be called. |
| args | The variadic arguments. |
| DRef tvm::runtime::SessionObj::CallPacked | ( | const DRef & | func, |
| Args &&... | args | ||
| ) |
|
pure virtual |
Call packed function on each worker using a packed sequence. The calling convention: The first element must be DiscoAction::kCallPacked, The second element must be 0, which will later be updated by the session to return reg_id The thirtd element is the function to be called.
|
pure virtual |
|
pure virtual |
|
protectedpure virtual |
Deallocate a register id, kill it on all workers, and append it to free_regs_.
|
pure virtual |
Get the value of a register from a remote worker.
| reg_id | The id of the register to be fetched. |
| worker_id | The id of the worker to be fetched from. |
|
pure virtual |
Set the value of a register on a remote worker.
| reg_id | The id of the register to be set. |
| value | The value to be set. |
| worker_id | The id of the worker to be set. |
|
pure virtual |
Get a global functions on workers.
|
pure virtual |
Get the number of workers in the session.
|
pure virtual |
Initialize the data plane between workers.
| ccl | The name of the communication backend, e.g., nccl, rccl, mpi. |
| device_ids | The device ids of the workers. |
|
pure virtual |
Signal all the workers to shutdown.
|
pure virtual |
Synchrnoize the controler with a worker, and it will wait until worker finishes executing this instruction.
| worker_id | The id of the worker to be synced with. |
| tvm::runtime::SessionObj::TVM_FFI_DECLARE_OBJECT_INFO | ( | "runtime.disco.Session" | , |
| SessionObj | , | ||
| ffi::Object | |||
| ) |
|
friend |
|
friend |
|
staticconstexpr |