vta.top#

TVM TOPI connector, eventually most of these should go to TVM repo

Submodules#

Package Contents#

Functions#

conv2d_packed(cfg, data, kernel, strides, padding, ...)

Packed conv2d function.

conv2d_transpose_packed(cfg, data, kernel, strides, ...)

Packed conv2d_transpose compute

dense_packed(cfg, data, weight[, bias, out_dtype])

Dense function declaration.

graph_pack(expr, bfactor, cfactor, weight_bits[, ...])

Pack the graph into batch&channel packed format.

group_conv2d_packed(cfg, data, kernel, strides, ...)

Packed group conv2d nchw function.

schedule_conv2d_packed(cfg, outs)

Schedule packed conv2d

schedule_conv2d_transpose_packed(cfg, outs)

Schedule packed conv2d_transpose

schedule_dense_packed(cfg, outs)

Packed dense schedule.

schedule_group_conv2d_packed(cfg, outs)

Schedule the packed conv2d.

vta.top.conv2d_packed(cfg, data, kernel, strides, padding, dilation, layout, out_dtype)[源代码]#

Packed conv2d function.

vta.top.conv2d_transpose_packed(cfg, data, kernel, strides, padding, out_dtype, output_padding=(0, 0))[源代码]#

Packed conv2d_transpose compute

vta.top.dense_packed(cfg, data, weight, bias=None, out_dtype=None)[源代码]#

Dense function declaration.

vta.top.graph_pack(expr, bfactor, cfactor, weight_bits, start_name='nn.max_pool2d', stop_name='nn.global_avg_pool2d', start_name_idx=None, stop_name_idx=None, count_meta=False, device_annot=False, annot_start_name='nn.conv2d', annot_end_name='annotation.stop_fusion')[源代码]#

Pack the graph into batch&channel packed format.

Parameters#

exprrelay.Expr

The input program.

bfactorint

The packing factor in batch

cfactorint

The packing factor in channel

weight_bits: int

The bit-width of the weights.

start_name: str, optional

Start packing from certain known node when start_name_idx is None.

stop_name: str, optional

Stop packing from certain known node when stop_name_idx is None.

start_name_idx: int, optional

When start_name_idx not None, start packing only when node name equal start_name and node idx equals start_name_idx.

stop_name_idx: int, optional

When stop_name_idx not None, stop packing only when node name equal stop_name and node index equals stop_name_idx.

count_meta:boolean, optional

When count_meta is False, the operator increase logic would not count the meta that have the type ‘relay.expr.Constant’, start_name_idx and stop_name_idx follow the index from ‘expr.astext(show_meta_data=False)’. When count_meta is True, the operator increase logic would count the meta.

device_annot: boolean, optional

if we want to annoate the device_type

annot_start_name: str, optional

device annotation start node, from which we mark the nodes as ext_dev

annot_end_name: str, optional

device annotation end node, after which we mark the nodes as ‘cpu’

Returns#

exprExpr

The transformed expression.

vta.top.group_conv2d_packed(cfg, data, kernel, strides, padding, dilation, group, out_dtype)[源代码]#

Packed group conv2d nchw function.

vta.top.schedule_conv2d_packed(cfg, outs)[源代码]#

Schedule packed conv2d

vta.top.schedule_conv2d_transpose_packed(cfg, outs)[源代码]#

Schedule packed conv2d_transpose

vta.top.schedule_dense_packed(cfg, outs)[源代码]#

Packed dense schedule.

vta.top.schedule_group_conv2d_packed(cfg, outs)[源代码]#

Schedule the packed conv2d.