vta
#
VTA Package is a TVM backend extension to support VTA hardware.
Besides the compiler toolchain, it also includes utility functions to configure the hardware environment and access remote device through RPC.
Subpackages#
Submodules#
Package Contents#
Classes#
Hardware configuration object. |
Functions#
Downloads a cached bitstream corresponding to the current config |
|
Returns the path to the cached bitstream corresponding to the current config |
|
|
Get the current VTA Environment. |
|
Construct a ModuleLoader implementation specialized for VTA. |
|
Upload and program bistream |
|
Reconfigure remote runtime based on current hardware spec. |
Attributes#
- class vta.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()
- property alu#
ALU pragma
- property cfg_dict#
- property dev#
Developer context
- property dma_copy#
DMA copy pragma
- property gemm#
GEMM intrinsic
- property mock#
A mock version of the Environment
The ALU, dma_copy and intrinsics will be mocked to be nop.
- property target#
- property target_host#
The target host
- property target_vta_cpu#
- DEBUG_DUMP_INSN#
- DEBUG_DUMP_UOP#
- DEBUG_SKIP_READ_BARRIER#
- DEBUG_SKIP_WRITE_BARRIER#
- MAX_XFER#
- acc_scope = 'local.acc_buffer'#
- current#
- inp_scope = 'local.inp_buffer'#
- wgt_scope = 'local.wgt_buffer'#
- vta.get_bitstream_path()[源代码]#
Returns the path to the cached bitstream corresponding to the current config
Returns#
- bit_path: str
Corresponding to the filepath of the bitstream
- vta.get_env()[源代码]#
Get the current VTA Environment.
Returns#
- envEnvironment
The current environment.
- vta.module_loader(bitstream=None)[源代码]#
Construct a ModuleLoader implementation specialized for VTA.
Parameters#
- bitsreamOptional[str]
Path to the bitstream to write prior to uploading code.
Returns#
- ModuleLoader :
The ModuleLoader instance.
- vta.program_fpga(remote, bitstream=None)[源代码]#
Upload and program bistream
Parameters#
- remoteRPCSession
The TVM RPC session
- bitstreamstr, optional
Path to a local bistream file. If unset, tries to download from cache server.