3 ms·
I’d love to see this in torch. What are the odds?
by Gimpei 3y ago
I’d love to see this in torch. What are the odds?
- Y_Y 3y agoImplementing a custom layer isn't hard[0], that said if it were me I'd rather add it in the runtime, e.g. via a TensorRT plugin. [0] e.g. https://jamesmccaffrey.wordpress.com/2021/09/02/example-of-a-pytorch-custom-layer/ https://jamesmccaffrey.wordpress.com/2021/09/02/example-of-a...
- mathisfun123 3y agoThat tut only shows you how to remix existing operators. That obviously won't work here (not what's required). You need to do this https://pytorch.org/tutorials/advanced/dispatcher.html https://pytorch.org/tutorials/advanced/dispatcher.html More complex but still not that hard.
- uoaei 3y agoWhat? https://pytorch.org/docs/stable/generated/torch.fft.fftn.html#torch.fft.fftn https://pytorch.org/docs/stable/generated/torch.fft.fftn.htm...
- earthnail 3y agoBut not backed by VkFFT. The implication of the comment is that it would make FFTs on various backends easier if it was implemented on VkFFT in the first place. Not sure that's true though, as I don't know how much code the various backends share. Edit: as an example that I experienced first-hand, coremltools, which converts PyTorch to CoreML models, only gained FFT support very recently. It's also not really a PyTorch backend but a PyTorch code converter, though, so wouldn't benefit at all from PyTorch's FFT being backed by VkFFT. Still, good example that one shouldn't take FFTs for granted.
- Gimpei 3y agoOf course, but CuFFT is half the speed of VkFFT.