[AUTOTVM] SizeVar is not JSON serializable

I’m currently getting this error when running autotvm in TVM v0.8:

TypeError: Object of type 'SizeVar' is not JSON serializable

Is SizeVar class not serializable?

It is registered on this line: https://github.com/apache/tvm/blob/main/src/tir/ir/expr.cc#L138. Would you like to double check? If the problem persists, would you mind providing a minimal reproducible example? Thanks!

Hi @junrushao, thanks for the help. I confirm that SizeVarNode is registered in my version of TVM as well, but I still get that error.

Right now, I might have identified that the issue is coming from the Slice operator of ONNX frontend. If I replace Slice op in my model with some equivalent ops, then I can run autotvm just fine. Slice op in ONNX frontend actually causes another issue with the FLOPS calculation as well, so it might be something that could be improved in TVM code base in the future imho.

As a reference, you can use this model to reproduce the multiple issues reported in this thread.