tvm
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
tvm::runtime::DiscoWorker Class Reference

A worker in Disco. It takes a channel to communication with the controler. The worker can be run in a separate thread or process as long as the channel supports bi-directional communication in-between. More...

#include <disco_worker.h>

Collaboration diagram for tvm::runtime::DiscoWorker:

Public Member Functions

 DiscoWorker (int worker_id, int num_workers, WorkerZeroData *worker_zero_data, DiscoChannel *channel)
 Construct a worker. More...
 
void MainLoop ()
 Main loop of the worker. More...
 
void SetRegister (int reg_id, TVMArgValue value)
 Set the specific register to a specific value. More...
 

Static Public Member Functions

static DiscoWorkerThreadLocal ()
 Get the worker instance on the current thread. More...
 

Public Attributes

int worker_id
 The id of the worker. More...
 
int num_workers
 Total number of workers. More...
 
Device default_device
 The default device to allocate data if not specified. More...
 
String ccl
 The name of the underlying collective communication library. More...
 
WorkerZeroDataworker_zero_data
 The data shared between worker-0 and the controler. It's a nullptr if the worker is not worker-0. More...
 
DiscoChannelchannel
 The communication channel between the worker and the controler. More...
 
std::vector< TVMRetValueregister_file
 The registers in the worker. More...
 

Friends

struct DiscoWorker::Impl
 

Detailed Description

A worker in Disco. It takes a channel to communication with the controler. The worker can be run in a separate thread or process as long as the channel supports bi-directional communication in-between.

Constructor & Destructor Documentation

◆ DiscoWorker()

tvm::runtime::DiscoWorker::DiscoWorker ( int  worker_id,
int  num_workers,
WorkerZeroData worker_zero_data,
DiscoChannel channel 
)
inlineexplicit

Construct a worker.

Parameters
worker_idThe id of the worker.
num_workersThe number of the workers.
worker_zero_dataThe data shared between worker-0 and the controler. It's a nullptr if the worker is not worker-0.
channelThe communication channel between the worker and the controler.

Member Function Documentation

◆ MainLoop()

void tvm::runtime::DiscoWorker::MainLoop ( )

Main loop of the worker.

◆ SetRegister()

void tvm::runtime::DiscoWorker::SetRegister ( int  reg_id,
TVMArgValue  value 
)

Set the specific register to a specific value.

◆ ThreadLocal()

static DiscoWorker* tvm::runtime::DiscoWorker::ThreadLocal ( )
static

Get the worker instance on the current thread.

Friends And Related Function Documentation

◆ DiscoWorker::Impl

friend struct DiscoWorker::Impl
friend

Member Data Documentation

◆ ccl

String tvm::runtime::DiscoWorker::ccl

The name of the underlying collective communication library.

◆ channel

DiscoChannel* tvm::runtime::DiscoWorker::channel

The communication channel between the worker and the controler.

Note
This data structure is owned by the controler.

◆ default_device

Device tvm::runtime::DiscoWorker::default_device

The default device to allocate data if not specified.

◆ num_workers

int tvm::runtime::DiscoWorker::num_workers

Total number of workers.

◆ register_file

std::vector<TVMRetValue> tvm::runtime::DiscoWorker::register_file

The registers in the worker.

◆ worker_id

int tvm::runtime::DiscoWorker::worker_id

The id of the worker.

◆ worker_zero_data

WorkerZeroData* tvm::runtime::DiscoWorker::worker_zero_data

The data shared between worker-0 and the controler. It's a nullptr if the worker is not worker-0.

Note
This data structure is owned by the controler.

The documentation for this class was generated from the following file: