Exception while running channel pruning using Pytorch

@akhobare @quic_sundarr Thank you for your responses.

@akhobare: The model exports well with torch.jit.trace(). You may want to investigate more about the error that I am getting.

Pytorch v1.1 has issue with onnx export for models that have Upsample layers (or functions). They fixed it in later versions of Pytorch. So this is a deadlock situtation - Pytorch cant get onnx export issue fixed with v1.1 and Aimet cant work with higher versions. I reckon Aimet should be upgraded to support latest Pytorch version. Otherwise, this issue should be mentioned as limitation in the documentation.

I did write code that ignore channel pruning for upsampling related layers. However it didnt work either. Any thoughts on this?

@quic_sundarr suggested to amend model to make it onnx exporteable for Pytorch v1.1. This will involve retraining the model and is a long process. At this point of time, this is not feasible for us.

@akhobare, Yes. That is correct.

@amitdedhia, Recently, we have recently updated AIMET to PyTorch version 1.4. Have you tried with the latest AIMET which supports PyTorch 1.4? If not, please try and update us.

Often, the latest error you are getting refers to an issue in the forward function. In this case it is likely pointing to an issue in decoder1’s forward(). The model print as you have shared doesn’t help to debug these kind of issues. With out the source code for your entire model including the forward function, it is hard to identify the root cause.

Are you getting any errors during connected graph construction? Could you include the complete AIMET logs?

@quic_sundarr The model exports well with torch.jit.trace()

Using the latest AIMET which supports PyTorch 1.4? Could you confirm the PyTorch version?

@quic_sundarr I used torch 1.1.0. I now see that an installation guide for google colab has been put up on the AIMET web site which uses torch 1.4.0. I will try it later (when my schedule permits) and let you know. Hopefully that should resolve this issue.

Hi @amitdedhia. Forgot to update you but the latest AIMET code now supports PyTorch 1.4

Thanks for the update @akhobare

1 Like