DistilHubert: PyTorch to ONNX conversion issue

Hello there!

My team has trained a model whose upstream model was DistilHuBERT. We’re happy with the outcomes, and we’d like to convert it to ONNX in order to deploy to multiple platforms.

We obtain the following error when we try the conversion with torch.onnx.export():

RuntimeError: ONNX export failed: Couldn't export Python operator GradMultiply

Has anyone else run into this issue? What’s the best practice - ask the ONNX team to implement GradMultiply, or is there already some workarounds we can apply?

@merve @mervenoyan suggested me to drop the question here. Many Thanks!

Welcome to our forum!
Pinging @lewtun here :hugs:

Hey @Onur, thanks for your message! For this kind of error, it would be best to open an issue on the PyTorch side since the op in question doesn’t seem to be supported yet. Once they’ve done that, feel free to open an issue / PR on transformers to support the ONNX conversion directly in the library :slight_smile:

Thank you @lewtun and @merve for quick response! I’ll take it to PyTorch first.

1 Like