vta.environment

目录

vta.environment#

Configurable VTA Hareware Environment scope.

Classes#

DevContext

Internal development context

Environment

Hardware configuration object.

Functions#

_init_env()

Initialize the default global env

get_env()

Get the current VTA Environment.

get_vta_hw_path()

Get the VTA HW path.

pkg_config(cfg)

Returns PkgConfig pkg config object.

Module Contents#

class vta.environment.DevContext(env)[源代码]#

Bases: object

Internal development context

This contains all the non-user facing compiler internal context that is hold by the Environment.

Parameters#

envEnvironment

The environment hosting the DevContext

Note#

This class is introduced so we have a clear separation of developer related, and user facing attributes.

get_task_qid(qid)[源代码]#

Get transformed queue index.

ALU_OPCODE_ADD = 2[源代码]#
ALU_OPCODE_MAX = 1[源代码]#
ALU_OPCODE_MIN = 0[源代码]#
ALU_OPCODE_MUL = 4[源代码]#
ALU_OPCODE_SHR = 3[源代码]#
DEBUG_NO_SYNC = False[源代码]#
MEM_ID_ACC = 3[源代码]#
MEM_ID_ACC_8BIT = 5[源代码]#
MEM_ID_INP = 2[源代码]#
MEM_ID_OUT = 4[源代码]#
MEM_ID_UOP = 0[源代码]#
MEM_ID_WGT = 1[源代码]#
QID_COMPUTE = 2[源代码]#
QID_LOAD_INP = 1[源代码]#
QID_LOAD_OUT = 2[源代码]#
QID_LOAD_WGT = 1[源代码]#
QID_STORE_OUT = 3[源代码]#
command_handle[源代码]#
gemm[源代码]#
vta_axis[源代码]#
vta_push_uop[源代码]#
class vta.environment.Environment(cfg)[源代码]#

Bases: object

Hardware configuration object.

This object contains all the information needed for compiling to a specific VTA backend.

Parameters#

cfgdict of str to value.

The configuration parameters.

Example#

# the following code reconfigures the environment
# temporarily to attributes specified in new_cfg.json
new_cfg = json.load(json.load(open("new_cfg.json")))
with vta.Environment(new_cfg):
    # env works on the new environment
    env = vta.get_env()
__enter__()[源代码]#
__exit__(ptype, value, trace)[源代码]#
ACC_BUFF_SIZE[源代码]#
ACC_ELEM_BITS[源代码]#
ACC_ELEM_BYTES[源代码]#
ACC_WIDTH[源代码]#
BATCH[源代码]#
BITSTREAM[源代码]#
BLOCK_IN[源代码]#
BLOCK_OUT[源代码]#
DEBUG_DUMP_INSN[源代码]#
DEBUG_DUMP_UOP[源代码]#
DEBUG_SKIP_READ_BARRIER[源代码]#
DEBUG_SKIP_WRITE_BARRIER[源代码]#
INP_BUFF_SIZE[源代码]#
INP_ELEM_BITS[源代码]#
INP_ELEM_BYTES[源代码]#
INP_WIDTH[源代码]#
MAX_XFER[源代码]#
MODEL[源代码]#
OUT_BUFF_SIZE[源代码]#
OUT_ELEM_BITS[源代码]#
OUT_ELEM_BYTES[源代码]#
OUT_WIDTH[源代码]#
UOP_BUFF_SIZE[源代码]#
WGT_BUFF_SIZE[源代码]#
WGT_ELEM_BITS[源代码]#
WGT_ELEM_BYTES[源代码]#
WGT_WIDTH[源代码]#
_dev_ctx = None[源代码]#
_last_env = None[源代码]#
_mock_env = None[源代码]#
acc_dtype[源代码]#
acc_scope = 'local.acc_buffer'[源代码]#
property alu[源代码]#

ALU pragma

property cfg_dict[源代码]#
current = None[源代码]#
property dev[源代码]#

Developer context

property dma_copy[源代码]#

DMA copy pragma

property gemm[源代码]#

GEMM intrinsic

inp_dtype[源代码]#
inp_scope = 'local.inp_buffer'[源代码]#
property mock[源代码]#

A mock version of the Environment

The ALU, dma_copy and intrinsics will be mocked to be nop.

mock_mode = False[源代码]#
out_dtype[源代码]#
pkg[源代码]#
property target[源代码]#
property target_host[源代码]#

The target host

property target_vta_cpu[源代码]#
wgt_dtype[源代码]#
wgt_scope = 'local.wgt_buffer'[源代码]#
vta.environment._init_env()[源代码]#

Initialize the default global env

vta.environment.get_env()[源代码]#

Get the current VTA Environment.

Returns#

envEnvironment

The current environment.

vta.environment.get_vta_hw_path()[源代码]#

Get the VTA HW path.

vta.environment.pkg_config(cfg)[源代码]#

Returns PkgConfig pkg config object.