tvm
|
Namespaces | |
cuda_ipc | |
memory | |
profiling | |
relax_vm | |
symbol | |
namespace for constant symbols | |
threading | |
Classes | |
struct | PackedFuncValueConverter< tvm::IntImm > |
struct | PackedFuncValueConverter< tvm::Integer > |
struct | PackedFuncValueConverter< tvm::Bool > |
struct | PackedFuncValueConverter< tvm::FloatImm > |
struct | PackedFuncValueConverter< runtime::Int > |
class | ArrayNode |
array node content in array More... | |
struct | is_valid_iterator |
Helper struct for type-checking. More... | |
struct | is_valid_iterator< Optional< T >, IterType > |
class | Array |
Array, container representing a contiguous sequence of ObjectRefs. More... | |
struct | ObjectHash |
String-aware ObjectRef equal functor. More... | |
struct | ObjectEqual |
String-aware ObjectRef hash functor. More... | |
class | InplaceArrayBase |
Base template for classes with array like memory layout. More... | |
class | IterAdapter |
iterator adapter that adapts TIter to return another type. More... | |
class | ReverseIterAdapter |
iterator adapter that adapts TIter to return another type. More... | |
class | BoxNode |
class | Box |
class | MapNode |
Shared content of all specializations of hash map. More... | |
class | SmallMapNode |
A specialization of small-sized hash map. More... | |
class | DenseMapNode |
A specialization of hash map that implements the idea of array-based hash map. Another reference implementation can be found [1]. More... | |
class | Map |
Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics, which means map is mutable but copy will happen when array is referenced in more than two places. More... | |
struct | NullOptType |
Helper to represent nullptr for optional. More... | |
class | Optional |
Optional container that to represent to a Nullable variant of T. More... | |
class | ShapeTupleObj |
An object representing a shape tuple. More... | |
class | ShapeTuple |
Reference to shape tuple objects. More... | |
class | StringObj |
An object representing string. It's POD type. More... | |
class | String |
Reference to string objects. More... | |
class | Variant |
class | DataType |
Runtime primitive data type. More... | |
class | DeviceAPI |
TVM Runtime Device API, abstracts the device specific interface for memory management. More... | |
class | DiscoWorker |
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... | |
struct | ThreadLocalDiscoWorker |
A threadlocal wrapper of DiscoWorker. More... | |
class | DRefObj |
An object that exists on all workers. More... | |
class | DRef |
Managed reference to DRefObj. More... | |
class | SessionObj |
A Disco interactive session. It allows users to interact with the Disco command queue with various PackedFunc calling convention. More... | |
class | Session |
Managed reference to SessionObj. More... | |
class | DiscoChannel |
A bi-directional channel for controler-worker communication. This channel is primarily used to transfer control messages but not data. More... | |
class | WorkerZeroData |
A special communication channel between controler and worker-0, assuming they are always collocated in the same process. More... | |
class | ObjAllocatorBase |
Base class of object allocators that implements make. Use curiously recurring template pattern. More... | |
class | SimpleObjAllocator |
class | Module |
Module container of TVM. More... | |
class | ModuleNode |
Base container of module. More... | |
class | NDArray |
Managed NDArray. The array is backed by reference counted blocks. More... | |
class | NVTXScopedRange |
A class to create a NVTX range. No-op if TVM is not built against NVTX. More... | |
struct | TypeIndex |
Namespace for the list of type index. More... | |
class | Object |
base class of all object containers. More... | |
class | ObjectPtr |
A custom smart pointer for Object. More... | |
class | ObjectRef |
Base class of all object reference. More... | |
struct | ObjectPtrHash |
ObjectRef hash functor. More... | |
struct | ObjectPtrEqual |
ObjectRef equal functor. More... | |
class | TypedPackedFunc |
Please refer to TypedPackedFunc<R(Args..)>. More... | |
struct | SignaturePrinter |
class | PackedFuncObj |
Object container class that backs PackedFunc. More... | |
class | PackedFuncSubObj |
Derived object class for constructing PackedFuncObj. More... | |
class | PackedFunc |
Packed function is a type-erased function. The arguments are passed by packed format. More... | |
class | TypedPackedFunc< R(Args...)> |
A PackedFunc wrapper to provide typed function signature. It is backed by a PackedFunc internally. More... | |
class | TVMArgs |
Arguments into TVM functions. More... | |
struct | ObjectTypeChecker |
Type traits for runtime type check during FFI conversion. More... | |
struct | ObjectTypeChecker< Array< T > > |
struct | ObjectTypeChecker< Map< K, V > > |
struct | ObjectTypeChecker< Variant< OnlyVariant > > |
struct | ObjectTypeChecker< Variant< FirstVariant, RemainingVariants... > > |
class | TVMPODValue_ |
Internal base class to handle conversion to POD values. More... | |
class | TVMPODValue_CRTP_ |
A utility class that adds methods useful for each POD type. More... | |
class | TVMArgValue |
A single argument value to PackedFunc. Containing both type_code and TVMValue. More... | |
class | TVMMovableArgValue_ |
Internal auxiliary struct for TypedPackedFunc to indicate a movable argument. More... | |
class | TVMMovableArgValueWithContext_ |
Internal auxiliary struct for TypedPackedFunc to indicate a movable argument with additional context information (function name and argument index) for better error reporting. More... | |
class | TVMRetValue |
Return Value container, Unlike TVMArgValue, which only holds reference and do not delete the underlying container during destruction. More... | |
struct | PackedFuncValueConverter |
Type trait to specify special value conversion rules from TVMArgValue and TVMRetValue. More... | |
class | TVMArgsSetter |
struct | TVMArgsSetterApply |
struct | PackedFuncValueConverter<::tvm::runtime::String > |
struct | PackedFuncValueConverter< Array< T > > |
struct | PackedFuncValueConverter< Map< T, U > > |
struct | PackedFuncValueConverter< Optional< T > > |
struct | PackedFuncValueConverter< Variant< VariantTypes... > > |
class | TimerNode |
Base class for all implementations. More... | |
class | Timer |
Timer for a specific device. More... | |
class | WrappedPythonObject |
A class that wraps a Python object and preserves its ownership. More... | |
class | Registry |
Registry for global function. More... | |
struct | PackedFuncValueConverter< tvm::tir::StringImm > |
struct | PackedFuncValueConverter< PrimExpr > |
Typedefs | |
using | Int = Box< int64_t > |
Boxed version of C++ int64_t. More... | |
using | Float = Box< double > |
Boxed version of C++ double. More... | |
using | Bool = Box< bool > |
Boxed version of C++ bool. More... | |
using | IntTuple = ShapeTuple |
using | IntTupleObj = ShapeTupleObj |
using | FSig = std::string() |
Using static function to output TypedPackedFunc signature. More... | |
Enumerations | |
enum | DeviceAttrKind : int { kExist = 0 , kMaxThreadsPerBlock = 1 , kWarpSize = 2 , kMaxSharedMemoryPerBlock = 3 , kComputeVersion = 4 , kDeviceName = 5 , kMaxClockRate = 6 , kMultiProcessorCount = 7 , kMaxThreadDimensions = 8 , kMaxRegistersPerBlock = 9 , kGcnArch = 10 , kApiVersion = 11 , kDriverVersion = 12 , kL2CacheSizeBytes = 13 , kTotalGlobalMemory = 14 , kAvailableGlobalMemory = 15 , kImagePitchAlignment = 16 } |
the query type into GetAttr More... | |
enum class | ReduceKind : int32_t { kSum = 0 , kProd = 1 , kMin = 2 , kMax = 3 , kAvg = 4 } |
Possible kinds of reduction operations. More... | |
enum class | DiscoAction : int32_t { kShutDown = 0 , kKillReg = 1 , kGetGlobalFunc = 2 , kCallPacked = 3 , kSyncWorker = 4 , kCopyFromWorker0 = 5 , kCopyToWorker0 = 6 , kDebugGetFromRemote = 7 , kDebugSetRegister = 8 } |
All possible kinds of Disco commands. More... | |
enum | ModulePropertyMask : int { kBinarySerializable = 0b001 , kRunnable = 0b010 , kDSOExportable = 0b100 } |
Property of runtime module We classify the property of runtime module into the following categories. More... | |
Functions | |
std::ostream & | operator<< (std::ostream &os, const ObjectRef &n) |
std::string | AsLegacyRepr (const ObjectRef &n) |
template<typename T , typename = typename std::enable_if<std::is_base_of<ObjectRef, T>::value>::type> | |
Array< T > | Concat (Array< T > lhs, const Array< T > &rhs) |
Concat two Arrays. More... | |
template<> | |
ObjectPtr< ArrayNode > | make_object () |
template<typename K , typename V , typename = typename std::enable_if<std::is_base_of<ObjectRef, K>::value>::type, typename = typename std::enable_if<std::is_base_of<ObjectRef, V>::value>::type> | |
Map< K, V > | Merge (Map< K, V > lhs, const Map< K, V > &rhs) |
Merge two Maps. More... | |
std::ostream & | operator<< (std::ostream &os, const ShapeTuple &shape) |
String | operator+ (const String &lhs, const String &rhs) |
String | operator+ (const String &lhs, const std::string &rhs) |
String | operator+ (const std::string &lhs, const String &rhs) |
String | operator+ (const char *lhs, const String &rhs) |
String | operator+ (const String &lhs, const char *rhs) |
bool | operator< (const String &lhs, const std::string &rhs) |
bool | operator< (const std::string &lhs, const String &rhs) |
bool | operator< (const String &lhs, const String &rhs) |
bool | operator< (const String &lhs, const char *rhs) |
bool | operator< (const char *lhs, const String &rhs) |
bool | operator> (const String &lhs, const std::string &rhs) |
bool | operator> (const std::string &lhs, const String &rhs) |
bool | operator> (const String &lhs, const String &rhs) |
bool | operator> (const String &lhs, const char *rhs) |
bool | operator> (const char *lhs, const String &rhs) |
bool | operator<= (const String &lhs, const std::string &rhs) |
bool | operator<= (const std::string &lhs, const String &rhs) |
bool | operator<= (const String &lhs, const String &rhs) |
bool | operator<= (const String &lhs, const char *rhs) |
bool | operator<= (const char *lhs, const String &rhs) |
bool | operator>= (const String &lhs, const std::string &rhs) |
bool | operator>= (const std::string &lhs, const String &rhs) |
bool | operator>= (const String &lhs, const String &rhs) |
bool | operator>= (const String &lhs, const char *rhs) |
bool | operator>= (const char *lhs, const String &rhs) |
bool | operator== (const String &lhs, const std::string &rhs) |
bool | operator== (const std::string &lhs, const String &rhs) |
bool | operator== (const String &lhs, const String &rhs) |
bool | operator== (const String &lhs, const char *rhs) |
bool | operator== (const char *lhs, const String &rhs) |
bool | operator!= (const String &lhs, const std::string &rhs) |
bool | operator!= (const std::string &lhs, const String &rhs) |
bool | operator!= (const String &lhs, const String &rhs) |
bool | operator!= (const String &lhs, const char *rhs) |
bool | operator!= (const char *lhs, const String &rhs) |
std::ostream & | operator<< (std::ostream &out, const String &input) |
int | GetVectorBytes (DataType dtype) |
Get the number of bytes needed in a vector. More... | |
bool | TypeMatch (DLDataType t, int code, int bits, int lanes=1) |
Check whether type matches the given spec. More... | |
bool | TypeEqual (DLDataType lhs, DLDataType rhs) |
Check whether two types are equal . More... | |
std::string | GetCustomTypeName (uint8_t type_code) |
Runtime utility for getting custom type name from code. More... | |
bool | GetCustomTypeRegistered (uint8_t type_code) |
Runtime utility for checking whether custom type is registered. More... | |
uint8_t | ParseCustomDatatype (const std::string &s, const char **scan) |
Runtime utility for parsing string of the form "custom[<typename>]". More... | |
const char * | DLDataTypeCode2Str (DLDataTypeCode type_code) |
Convert type code to its name. More... | |
DLDataType | String2DLDataType (std::string s) |
convert a string to TVM type. More... | |
std::string | DLDataType2String (DLDataType t) |
convert a TVM type to string. More... | |
std::ostream & | operator<< (std::ostream &os, DLDataType t) |
std::ostream & | operator<< (std::ostream &os, const DataType &dtype) |
bool | IsRPCSessionDevice (Device dev) |
Return true if a Device is owned by an RPC session. More... | |
int | GetRPCSessionIndex (Device dev) |
Return the RPCSessTable index of the RPC Session that owns this device. More... | |
Device | RemoveRPCSessionMask (Device dev) |
Remove the RPC session mask from a Device. RPC clients typically do this when encoding a Device for transmission to an RPC remote. On the wire, RPCdevice are expected to be valid on the server without interpretation. More... | |
std::ostream & | operator<< (std::ostream &os, DLDevice dev) |
Device | AddRPCSessionMask (Device dev, int session_table_index) |
Add a RPC session mask to a Device. RPC clients typically do this when decoding a Device received from a RPC remote. More... | |
std::string | ReduceKind2String (ReduceKind kind) |
Converts ReduceKind to string. More... | |
Module | LoadVMModule (std::string path, Device device) |
Load a runtime Module, then create and initialize a RelaxVM. More... | |
NDArray | DiscoEmptyNDArray (ShapeTuple shape, DataType dtype, Device device) |
Create an uninitialized empty NDArray. More... | |
void | AllReduce (NDArray send, ReduceKind reduce_kind, bool in_group, NDArray recv) |
Perform an allreduce operation using the underlying communication library. More... | |
void | AllGather (NDArray send, bool in_group, NDArray recv) |
Perform an allgather operation using the underlying communication library. More... | |
void | BroadcastFromWorker0 (NDArray send, bool in_group, NDArray recv) |
Perform a broadcast operation from worker-0. More... | |
void | ScatterFromWorker0 (Optional< NDArray > send, bool in_group, NDArray recv) |
Perform a scatter operation from worker-0, chunking the given buffer into equal parts. More... | |
void | GatherToWorker0 (NDArray send, bool in_group, Optional< NDArray > recv) |
Perform a gather operation to worker-0. More... | |
void | RecvFromWorker0 (NDArray buffer) |
Receive a buffer from worker-0. No-op if the current worker is worker-0. More... | |
void | SendToNextGroup (NDArray buffer) |
Send a buffer to the corresponding worker in the next group. An error is thrown if the worker is already in the last group. More... | |
void | RecvFromPrevGroup (NDArray buffer) |
Receive a buffer from the corresponding worker in the previous group. An error is thrown if the worker is already in the first group. More... | |
void | SendToWorker (NDArray buffer, int receiver_id) |
Send a buffer to the target receiver worker (globally across all groups). More... | |
void | RecvFromWorker (NDArray buffer, int sender_id) |
Receive a buffer from the target sender worker (globally across all groups). More... | |
int | WorkerId () |
Get the local worker id. More... | |
void | SyncWorker () |
Called by the worker thread. Waiting until the worker completes all its tasks. As a specific example, on a CUDA worker, it blocks until all kernels are launched and cudaStreamSynchronize is complete. More... | |
std::string | DiscoAction2String (DiscoAction action) |
Converts the enum class DiscoAction to string. More... | |
template<typename T , typename... Args> | |
ObjectPtr< T > | make_object (Args &&... args) |
Allocate an object using default allocator. More... | |
template<typename ArrayType , typename ElemType , typename... Args> | |
ObjectPtr< ArrayType > | make_inplace_array_object (size_t num_elems, Args &&... args) |
bool | RuntimeEnabled (const String &target) |
Check if runtime module is enabled for target. More... | |
std::ostream & | operator<< (std::ostream &out, const Module &module) |
bool | SaveDLTensor (dmlc::Stream *strm, const DLTensor *tensor) |
Save a DLTensor to stream. More... | |
size_t | GetDataSize (const DLTensor &arr) |
return the size of data the DLTensor hold, in term of number of bytes More... | |
Object * | TVMArrayHandleToObjectHandle (TVMArrayHandle handle) |
Device | GetPreferredHostDevice (Device device) |
Get the preferred host device from the input device. More... | |
template<typename ObjectRefType , typename ObjectType > | |
ObjectRefType | GetRef (const ObjectType *ptr) |
Get a reference type from a raw object ptr type. More... | |
template<typename SubRef , typename BaseRef > | |
SubRef | Downcast (BaseRef ref) |
Downcast a base reference type to a more specific type. More... | |
template<typename BaseType , typename ObjectType > | |
ObjectPtr< BaseType > | GetObjectPtr (ObjectType *ptr) |
Get an object ptr type from a raw object ptr. More... | |
template<typename RefType , typename ObjType > | |
RefType | GetRef (const ObjType *ptr) |
template<typename BaseType , typename ObjType > | |
ObjectPtr< BaseType > | GetObjectPtr (ObjType *ptr) |
const char * | ArgTypeCode2Str (int type_code) |
Convert argument type code to string. More... | |
const char * | DLDeviceType2Str (int type) |
The name of DLDeviceType. More... | |
template<typename... Args> | |
void TVM_ALWAYS_INLINE | PackArgs (TVMValue *values, int *type_codes, Args &&... args) |
Timer | DefaultTimer (Device dev) |
Default timer if one does not exist for the device. More... | |
void | EnvCheckSignals () |
Check if signals have been sent to the process and if so invoke the registered signal handler in the frontend environment. More... | |
template<typename T > | |
void | parallel_for_with_threading_backend (T flambda, int64_t begin, int64_t end) |
Variables | |
template<typename T , typename IterType > | |
constexpr bool | is_valid_iterator_v = is_valid_iterator<T, IterType>::value |
template<typename T > | |
constexpr bool | is_tvm_array = false |
template<typename T > | |
constexpr bool | is_tvm_array< Array< T > > = true |
constexpr int | kAllocAlignment = 64 |
Number of bytes each allocation must align to. More... | |
constexpr int | kTempAllocaAlignment = 64 |
Number of bytes each allocation must align to in temporary allocation. More... | |
constexpr int | kMaxStackAlloca = 1024 |
Maximum size that can be allocated on stack. More... | |
constexpr int | kDefaultWorkspaceAlignment = 1 |
Number of bytes each allocation must align to by default in the workspace buffer to service intermediate tensors. More... | |
constexpr int | kRPCSessMask = 128 |
The device type bigger than this is RPC device. More... | |
constexpr uint64_t | kTVMNDArrayMagic = 0xDD5E40F096B4A13F |
Magic number for NDArray file. More... | |
using tvm::runtime::Bool = typedef Box<bool> |
Boxed version of C++ bool.
Can be used to store POD boolean values as a TVM ObjectRef. Used for FFI handling, and for storing POD types inside TVM containers.
When passing from Python to C++, TVM PackedFunc conversion follow C++ conversion rules, and allow bool->int and int->bool conversions. When passing from C++ to Python, the types are returned as bool or int. If the C++ function uses ObjectRef to hold the object, a Python to C++ to Python round trip will preserve the distinction between bool and int.
using tvm::runtime::Float = typedef Box<double> |
Boxed version of C++ double.
Can be used to store POD floating-point values as a TVM ObjectRef. Used for FFI handling, and for storing POD types inside TVM containers.
using tvm::runtime::FSig = typedef std::string() |
Using static function to output TypedPackedFunc signature.
using tvm::runtime::Int = typedef Box<int64_t> |
Boxed version of C++ int64_t.
Can be used to store POD integer values as a TVM ObjectRef. Used for FFI handling, and for storing POD types inside TVM containers.
using tvm::runtime::IntTuple = typedef ShapeTuple |
using tvm::runtime::IntTupleObj = typedef ShapeTupleObj |
enum tvm::runtime::DeviceAttrKind : int |
the query type into GetAttr
|
strong |
enum tvm::runtime::ModulePropertyMask : int |
Property of runtime module We classify the property of runtime module into the following categories.
|
strong |
Add a RPC session mask to a Device. RPC clients typically do this when decoding a Device received from a RPC remote.
dev | A Device without any RPC Session mask, valid on the RPC server. |
session_table_index | Numeric index of the RPC session in the session table. |
Perform an allgather operation using the underlying communication library.
send | The array send to perform allgather on |
in_group | Whether the allgather operation performs globally or in group as default. |
recv | The array receives the outcome of allgather |
void tvm::runtime::AllReduce | ( | NDArray | send, |
ReduceKind | reduce_kind, | ||
bool | in_group, | ||
NDArray | recv | ||
) |
Perform an allreduce operation using the underlying communication library.
send | The array send to perform allreduce on |
reduce_kind | The kind of reduction operation (e.g. sum, avg, min, max) |
in_group | Whether the allreduce operation performs globally or in group as default. |
recv | The array receives the outcome of allreduce |
|
inline |
Convert argument type code to string.
type_code | The input type code. |
|
inline |
Perform a broadcast operation from worker-0.
send | The buffer to be broadcasted |
in_group | Whether the broadcast operation performs globally or in group as default. |
recv | The buffer receives the broadcasted array |
Default timer if one does not exist for the device.
dev | The device to time on. |
Note that this timer performs synchronization between the device and CPU, which can lead to overhead in the reported results.
|
inline |
Converts the enum class DiscoAction
to string.
NDArray tvm::runtime::DiscoEmptyNDArray | ( | ShapeTuple | shape, |
DataType | dtype, | ||
Device | device | ||
) |
|
inline |
convert a TVM type to string.
t | The type to be converted. |
|
inline |
Convert type code to its name.
type_code | The type code . |
|
inline |
The name of DLDeviceType.
type | The device type. |
|
inline |
Downcast a base reference type to a more specific type.
ref | The input reference |
SubRef | The target specific reference type. |
BaseRef | the current reference type. |
void tvm::runtime::EnvCheckSignals | ( | ) |
Check if signals have been sent to the process and if so invoke the registered signal handler in the frontend environment.
When running TVM in another language (Python), the signal handler may not be immediately executed, but instead the signal is marked in the interpreter state (to ensure non-blocking of the signal handler).
This function can be explicitly invoked to check the cached signal and run the related processing if a signal is marked.
On Linux, when siginterrupt() is set, invoke this function whenever a syscall returns EINTR. When it is not set, invoke it between long-running syscalls when you will not immediately return to the frontend. On Windows, the same rules apply, but due to differences in signal processing, these are likely to only make a difference when used with Ctrl+C and socket calls.
Not inserting this function will not cause any correctness issue, but will delay invoking the Python-side signal handler until the function returns to the Python side. This means that the effect of e.g. pressing Ctrl+C or sending signals the process will be delayed until function return. When a C function is blocked on a syscall such as accept(), it needs to be called when EINTR is received. So this function is not needed in most API functions, which can finish quickly in a reasonable, deterministic amount of time.
This | function throws an exception when the frontend signal handler indicate an error happens, otherwise it returns normally. |
Perform a gather operation to worker-0.
send | The sending buffer, which must not be None. |
in_group | Whether the gather operation performs globally or in group as default. |
recv | For worker-0, it must be provided, and otherwise, the buffer must be None. The receiving buffer will be divided into equal parts and receive from each worker accordingly. |
std::string tvm::runtime::GetCustomTypeName | ( | uint8_t | type_code | ) |
Runtime utility for getting custom type name from code.
type_code | Custom type code |
bool tvm::runtime::GetCustomTypeRegistered | ( | uint8_t | type_code | ) |
Runtime utility for checking whether custom type is registered.
type_code | Custom type code |
|
inline |
return the size of data the DLTensor hold, in term of number of bytes
arr | the input DLTensor |
|
inline |
Get an object ptr type from a raw object ptr.
ptr | The object pointer |
BaseType | The reference type |
ObjectType | The object type |
|
inline |
Get the preferred host device from the input device.
|
inline |
Get a reference type from a raw object ptr type.
It is always important to get a reference type if we want to return a value as reference or keep the object alive beyond the scope of the function.
ptr | The object pointer |
RefType | The reference type |
ObjectType | The object type |
|
inline |
|
inline |
Return the RPCSessTable index of the RPC Session that owns this device.
|
inline |
Get the number of bytes needed in a vector.
dtype | The data type. |
|
inline |
Return true if a Device is owned by an RPC session.
|
inline |
|
inline |
Allocate an object using default allocator.
args | arguments to the constructor. |
T | the node type. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void TVM_ALWAYS_INLINE tvm::runtime::PackArgs | ( | TVMValue * | values, |
int * | type_codes, | ||
Args &&... | args | ||
) |
|
inline |
uint8_t tvm::runtime::ParseCustomDatatype | ( | const std::string & | s, |
const char ** | scan | ||
) |
Runtime utility for parsing string of the form "custom[<typename>]".
s | String to parse |
scan | pointer to parsing pointer, which is scanning across s |
void tvm::runtime::RecvFromPrevGroup | ( | NDArray | buffer | ) |
Receive a buffer from the corresponding worker in the previous group. An error is thrown if the worker is already in the first group.
buffer | The receiving buffer. |
void tvm::runtime::RecvFromWorker | ( | NDArray | buffer, |
int | sender_id | ||
) |
Receive a buffer from the target sender worker (globally across all groups).
buffer | The receiving buffer. |
sender_id | The global sender worker id. |
void tvm::runtime::RecvFromWorker0 | ( | NDArray | buffer | ) |
Receive a buffer from worker-0. No-op if the current worker is worker-0.
buffer | The buffer to be received |
|
inline |
Converts ReduceKind
to string.
Remove the RPC session mask from a Device. RPC clients typically do this when encoding a Device for transmission to an RPC remote. On the wire, RPCdevice are expected to be valid on the server without interpretation.
dev | A Device with non-zero RPC Session mask, valid on the RPC client. |
bool tvm::runtime::RuntimeEnabled | ( | const String & | target | ) |
Check if runtime module is enabled for target.
target | The target module name. |
|
inline |
Save a DLTensor to stream.
strm | The output stream |
tensor | The tensor to be saved. |
Perform a scatter operation from worker-0, chunking the given buffer into equal parts.
send | For worker-0, it must be provided, and otherwise, the buffer must be None. The buffer will be divided into equal parts and sent to each worker accordingly. |
in_group | Whether the scatter operation performs globally or in group as default. |
recv | The receiving buffer, which must not be None. |
void tvm::runtime::SendToNextGroup | ( | NDArray | buffer | ) |
Send a buffer to the corresponding worker in the next group. An error is thrown if the worker is already in the last group.
buffer | The sending buffer. |
void tvm::runtime::SendToWorker | ( | NDArray | buffer, |
int | receiver_id | ||
) |
Send a buffer to the target receiver worker (globally across all groups).
buffer | The sending buffer. |
receiver_id | The global receiver worker id. |
|
inline |
convert a string to TVM type.
s | The string to be converted. |
void tvm::runtime::SyncWorker | ( | ) |
Called by the worker thread. Waiting until the worker completes all its tasks. As a specific example, on a CUDA worker, it blocks until all kernels are launched and cudaStreamSynchronize is complete.
|
inline |
|
inline |
Check whether two types are equal .
lhs | The left operand. |
rhs | The right operand. |
|
inline |
Check whether type matches the given spec.
t | The type |
code | The type code. |
bits | The number of bits to be matched. |
lanes | The number of lanes in the type. |
int tvm::runtime::WorkerId | ( | ) |
Get the local worker id.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
constexpr |
Number of bytes each allocation must align to.
|
constexpr |
Number of bytes each allocation must align to by default in the workspace buffer to service intermediate tensors.
|
constexpr |
Maximum size that can be allocated on stack.
|
constexpr |
The device type bigger than this is RPC device.
|
constexpr |
Number of bytes each allocation must align to in temporary allocation.
|
constexpr |
Magic number for NDArray file.