19 #ifndef TVM_RUNTIME_DISCO_BUILTIN_H_
20 #define TVM_RUNTIME_DISCO_BUILTIN_H_
56 LOG(FATAL) <<
"ValueError: Unknown ReduceKind: " <<
static_cast<int>(kind);
65 TVM_DLL ffi::Module
LoadVMModule(std::string path, ffi::Optional<Device> device);
Runtime primitive data type.
Definition: data_type.h:47
Managed Tensor. The array is backed by reference counted blocks.
Definition: tensor.h:53
void SendToWorker(Tensor buffer, int receiver_id)
Send a buffer to the target receiver worker (globally across all groups).
ffi::Module LoadVMModule(std::string path, ffi::Optional< Device > device)
Load a runtime Module, then create and initialize a RelaxVM.
int WorkerId()
Get the local worker id.
void RecvFromWorker0(Tensor buffer)
Receive a buffer from worker-0. No-op if the current worker is worker-0.
void SendToNextGroup(Tensor buffer)
Send a buffer to the corresponding worker in the next group. An error is thrown if the worker is alre...
std::string ReduceKind2String(ReduceKind kind)
Converts ReduceKind to string.
Definition: builtin.h:43
void RecvFromPrevGroup(Tensor buffer)
Receive a buffer from the corresponding worker in the previous group. An error is thrown if the worke...
void SyncWorker()
Called by the worker thread. Waiting until the worker completes all its tasks. As a specific example,...
void AllGather(Tensor send, bool in_group, Tensor recv)
Perform an allgather operation using the underlying communication library.
ReduceKind
Possible kinds of reduction operations.
Definition: builtin.h:34
void BroadcastFromWorker0(Tensor send, bool in_group, Tensor recv)
Perform a broadcast operation from worker-0.
void AllReduce(Tensor send, ReduceKind reduce_kind, bool in_group, Tensor recv)
Perform an allreduce operation using the underlying communication library.
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.
Tensor DiscoEmptyTensor(ffi::Shape shape, DataType dtype, ffi::Optional< Device > device)
Create an uninitialized empty Tensor.
void RecvFromWorker(Tensor buffer, int sender_id)
Receive a buffer from the target sender worker (globally across all groups).
void GatherToWorker0(Tensor send, bool in_group, ffi::Optional< Tensor > recv)
Perform a gather operation to worker-0.
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:1960
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37
Runtime container of the functions generated by TVM, This is used to support dynamically link,...
A device-independent managed Tensor abstraction.