[Pytorch][TVM][Relay][VM] PyTorch model compiles with relay.build() but throws error with vm.compile()

Hi,

I have Resnet-152 and a DenseNet-161 PyTorch models and I am trying to compile them with different compiling methods : relay.build() and vm.compile().

When I do an compile the models with relay.build(), the compilation is successful. I am also able to make a successful image inference and am getting the correct output.

However, when I change the compile part from relay to vm.compile(), I get the following error :

Resnet152 :

Error: The following operators are not implemented: ['aten::__isnot__', 'aten::conv2d', 'prim::min', 'aten::dim', 'aten::__is__', 'prim::unchecked_cast', 'aten::append', 'prim::SetAttr']

DenseNet161

InternalError: Check failed: (it != global_map.end()) is false: Cannot find function aten::linear_0.bias in executable

Why am I not getting any type of OpNotImplemented Error with relay.build(), and in continuation, why does the error arise only when vm.compile() is used for compiling the Relay Module?

I have attached codes for reproduction of both cases here

Please let me know what is being done wrong here.

Regards,

Krishna

@masahi @comaniac @AndrewZhaoLuo @junrushao @zxybazh