tvm
Public Member Functions | Static Public Member Functions | List of all members
tvm::runtime::Session Class Reference

Managed reference to SessionObj. More...

#include <session.h>

Inheritance diagram for tvm::runtime::Session:
Collaboration diagram for tvm::runtime::Session:

Public Member Functions

 TVM_FFI_DEFINE_MUTABLE_OBJECT_REF_METHODS (Session, ObjectRef, SessionObj)
 

Static Public Member Functions

static Session ThreadedSession (int num_workers, int num_groups)
 Create a session backed by a thread pool of workers. More...
 
static Session ProcessSession (int num_workers, int num_groups, String process_pool_creator, String entrypoint)
 Create a session backed by pipe-based multiprocessing. More...
 

Detailed Description

Managed reference to SessionObj.

See also
SessionObj

Member Function Documentation

◆ ProcessSession()

static Session tvm::runtime::Session::ProcessSession ( int  num_workers,
int  num_groups,
String  process_pool_creator,
String  entrypoint 
)
static

Create a session backed by pipe-based multiprocessing.

Parameters
num_workersThe number of workers.
num_groupsThe number of worker groups.
process_pool_creatorThe name of a global function that takes num_workers as an input, and returns a ffi::Function, which takes an integer worker_id as the input and returns None. When worker-id is 0, it shuts down the process pool; Otherwise, it retursn a tuple (read_fd, writefd) used to communicate with the corresponding worker.
entrypointThe entrypoint of DiscoWorker main worker function.
Note
Worker-0 is always co-located with the controler as a separate thread, and therefore worker-0 does not exist in the process pool.

◆ ThreadedSession()

static Session tvm::runtime::Session::ThreadedSession ( int  num_workers,
int  num_groups 
)
static

Create a session backed by a thread pool of workers.

Parameters
num_workersThe number of workers.
num_groupsThe number of worker groups.

◆ TVM_FFI_DEFINE_MUTABLE_OBJECT_REF_METHODS()

tvm::runtime::Session::TVM_FFI_DEFINE_MUTABLE_OBJECT_REF_METHODS ( Session  ,
ObjectRef  ,
SessionObj   
)

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