Hello, I found that in topi.nn.sparse
there is sparse_dense
operation which supports CSR format matrix multiplication.
I tried to configure its config_space and autotune,
but autotvm raises error like
Traceback (most recent call last):
File "sparse.py", line 207, in <module>
main()
File "sparse.py", line 149, in main
task = autotvm.task.create(sparse_mm, args=(N, K, nnz, M), target=target)
File "/home/ktaebum/Program/tvm/python/tvm/autotvm/task/task.py", line 195, in create
ret.flop = ret.config_space.flop or compute_flop(sch)
File "/home/ktaebum/Program/tvm/python/tvm/autotvm/task/task.py", line 399, in compute_flop
ret = traverse(sch.outputs)
File "/home/ktaebum/Program/tvm/python/tvm/autotvm/task/task.py", line 388, in traverse
ret += num_element * _count_flop(exp)
File "/home/ktaebum/Program/tvm/python/tvm/autotvm/task/task.py", line 340, in _count_flop
num_iter = _prod_length(exp.axis)
File "/home/ktaebum/Program/tvm/python/tvm/autotvm/task/task.py", line 332, in _prod_length
num_iter = int(np.prod([get_const_int(axis.dom.extent) for axis in axes]))
File "/home/ktaebum/Program/tvm/python/tvm/autotvm/task/task.py", line 332, in <listcomp>
num_iter = int(np.prod([get_const_int(axis.dom.extent) for axis in axes]))
File "/home/ktaebum/Program/tvm/python/tvm/autotvm/util.py", line 159, in get_const_int
exp = ir_pass.Simplify(expr)
File "/home/ktaebum/Program/tvm/python/tvm/_ffi/_ctypes/function.py", line 204, in __call__
values, tcodes, num_args = _make_tvm_args(args, temp_args)
File "/home/ktaebum/Program/tvm/python/tvm/_ffi/_ctypes/function.py", line 170, in _make_tvm_args
raise TypeError("Don't know how to handle type %s" % type(arg))
TypeError: Don't know how to handle type <class 'module'>
Since I noticed that it is an error due to autotvm cannot get FLOPS statically, I used config.add_flop()
.
Nevertheless, it cannot tune through config space with
Check failed: code == RPCCode: :kReturn: code=4',),), error_no=4,
Is there any way to handle this problem?