performer-pytorch icon indicating copy to clipboard operation
performer-pytorch copied to clipboard

torch_tensorrt compilation fails

Open FredHaa opened this issue 3 years ago • 0 comments

Hi

Thank you for contributing this amazing repo!

I've tried to compile the model with the new torch_tensorrt torchscript compiler. However, it does not seem to support a variable number of arguments which is heavily used for the various forward() functions in the model definition:

torch.jit.frontend.NotSupportedError: Compiled functions can't take variable number of arguments or use keyword-only arguments with defaults:
File "/home/frederik/.local/lib/python3.8/site-packages/performer_pytorch/performer_pytorch.py", line 576
    def forward(self, x, **kwargs):
                          ~~~~~~~ <--- HERE
        if self.auto_check_redraw:
            self.proj_updater.redraw_projections()

If I were to make a pull request which removes the **kwargs in order to provide TensorRT and torchscript support, would it be merged?

FredHaa avatar Dec 20 '21 10:12 FredHaa