[ BUG ] NameError: name 'stride_h' is not defined when compile arm_cpu convolution

hello.

In order to run Arm cpu on the rk3399 board, I wrote and ran the code as below.

target_arm_cpu = tvm.target.arm_cpu()
ctx_arm_cpu =  tvm.runtime.cpu()

dtype='float32'
batch_size = 1 
num_class = 1000
image_shape = (3, 224, 224)
data_shape = (batch_size,) + image_shape
out_shape = (batch_size, num_class)
mod, paramsO = relay.testing.vgg.get_workload(
    num_layers=16, batch_size=batch_size, image_shape=image_shape)
opt_level = 3 

#arm_cpu 
with relay.build_config(opt_level = opt_level):
    graph, lib, params = relay.build_module.build( mod, target_arm_cpu , params = paramsO )

data = tvm.nd.array( np.random.uniform(-1, 1, size=data_shape ).astype("float32") , ctx_arm_cpu )
module = graph_runtime.create(graph, lib, ctx_arm_cpu)
module.set_input("data", data)
module.set_input(**params)

timer = module.module.time_evaluator('run',ctx_arm_cpu,number=1,repeat=10)
prof_res = np.array( timer().results )*1000
print("arm GPU -> Mean inference time (std dev): %.2f ms (%.2f ms)" %(np.mean(prof_res), np.std(prof_res)))

After updating TVM to version 0.7, the following error occurs.

  File "/home/firefly/Desktop/TVM/tvm/python/tvm/relay/op/strategy/arm_cpu.py", line 166, in conv2d_winograd_without_weight_transfrom_strategy_arm_cpu
    assert kh == 3 and kw == 3 and stride_h == 1 and stride_w == 1
NameError: name 'stride_h' is not defined

I remember that code worked in older versions of TVM, but I am having problems after updating. Is there a problem with my code? Or is it an internal problem in the update process?

This is a bug.

After https://github.com/apache/incubator-tvm/blob/master/python/tvm/relay/op/strategy/arm_cpu.py#L154

add

stride_h, stride_w = strides

Welcome pr.

1 Like

Thanks for the quick response!