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