19 #ifndef TVM_RUNTIME_DISCO_BUILTIN_H_
20 #define TVM_RUNTIME_DISCO_BUILTIN_H_
22 #include <tvm/ffi/extra/module.h>
56 TVM_FFI_THROW(ValueError) <<
"Unknown ReduceKind: " <<
static_cast<int>(kind);
74 ffi::Optional<Device> device);
Runtime primitive data type.
Definition: data_type.h:45
Managed Tensor. The array is backed by reference counted blocks.
Definition: tensor.h:49
TVM_RUNTIME_DLL void SyncWorker()
Called by the worker thread. Waiting until the worker completes all its tasks. As a specific example,...
TVM_RUNTIME_DLL ffi::Module LoadVMModule(std::string path, ffi::Optional< Device > device)
Load a runtime Module, then create and initialize a RelaxVM.
std::string ReduceKind2String(ReduceKind kind)
Converts ReduceKind to string.
Definition: builtin.h:43
TVM_RUNTIME_DLL void GatherToWorker0(Tensor send, bool in_group, ffi::Optional< Tensor > recv)
Perform a gather operation to worker-0.
TVM_RUNTIME_DLL void AllGather(Tensor send, bool in_group, Tensor recv)
Perform an allgather operation using the underlying communication library.
TVM_RUNTIME_DLL void RecvFromWorker(Tensor buffer, int sender_id)
Receive a buffer from the target sender worker (globally across all groups).
TVM_RUNTIME_DLL void RecvFromWorker0(Tensor buffer)
Receive a buffer from worker-0. No-op if the current worker is worker-0.
TVM_RUNTIME_DLL void BroadcastFromWorker0(Tensor send, bool in_group, Tensor recv)
Perform a broadcast operation from worker-0.
TVM_RUNTIME_DLL void ScatterFromWorker0(ffi::Optional< Tensor > send, bool in_group, Tensor recv)
Perform a scatter operation from worker-0, chunking the given buffer into equal parts.
TVM_RUNTIME_DLL void RecvFromPrevGroup(Tensor buffer)
Receive a buffer from the corresponding worker in the previous group. An error is thrown if the worke...
ReduceKind
Possible kinds of reduction operations.
Definition: builtin.h:34
TVM_RUNTIME_DLL void SendToNextGroup(Tensor buffer)
Send a buffer to the corresponding worker in the next group. An error is thrown if the worker is alre...
TVM_RUNTIME_DLL Tensor DiscoEmptyTensor(ffi::Shape shape, DataType dtype, ffi::Optional< Device > device)
Create an uninitialized empty Tensor.
TVM_RUNTIME_DLL void AllReduce(Tensor send, ReduceKind reduce_kind, bool in_group, Tensor recv)
Perform an allreduce operation using the underlying communication library.
TVM_RUNTIME_DLL void SendToWorker(Tensor buffer, int receiver_id)
Send a buffer to the target receiver worker (globally across all groups).
TVM_RUNTIME_DLL int WorkerId()
Get the local worker id.
Tensor shape(const Tensor &src, DataType dtype, const std::string name="T_shape", const std::string tag=kInjective)
Get the shape of input tensor.
Definition: transform.h:1981
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:37
#define TVM_RUNTIME_DLL
Definition: base.h:88
A device-independent managed Tensor abstraction.