With the recent tutorial added by @jwfromm around a Transformer using sparsity, I was curious about how to get this working for a CNN.
I adapted the example to use a small CIFAR-10 classifier, the ONNX model used can be downloaded here. The adapted notebook can be downloaded from this Gist.
However, I fail when converting the graph with simplify_fc_transpose
with the error:
an internal invariant was violated while typechecking your program [10:04:26] ../src/relay/op/nn/pad.cc:126: Check failed: data->shape.size() == param->pad_width.size(): There should be as many pad width pairs as shape dimensions but the shape has 4 dimensions and there are 5 pad width pairs.
I guess that because the CNN is using packing for convolution, converting FC operations to sparse ones might not work? In that case I would need to implement a GEMM Convolution approach, and make sure it was tagged correctly for the sparse operation replacement?
Or does it seem that this error is connected to something else? Especially since the error is to do with the padding layer getting the wrong number of tuples.