TOPI and tophub lookups


when I create a topi operation as

conv_out_t = topi.nn.conv2d(inp_t, weight_t, stride, padding, dilation, layout=layout, out_dtype='float32')
s1 = topi.generic.schedule_conv2d_nchw([conv_out_t])

When I don’t specify out_dtype='float32' it will look up with 0 in place of 'float32'. If one wants lookups to succeed it might be nicer to use if properties would be derived when the arguments are not specified.

(I previously thought I also had funny effects w.r.t. workload names (conv2d vs. topi_nn_conv2d) - both show up in the tophub files but that might have been the above actually and only the conv2d is actually used.)

Best regards


As I remember, if the output type is unset, then it will be inferred by InferType pass when building a model, and that pass is invoked after Tophub lookups. Maybe we could try to infer the output type in TOPI compute as you suggested for Tophub lookup, and error out if the inferred type doesn’t match the result of InferType pass.

FYI: The zero comes from this line, and the default output type is defined here.

1 Like