> about 2-3 times faster compared to the current PyTorch implementation
This is surprising to me. Is this about CPU only? Then it would make sense.
Also, is there a particular reason why the whole code is basically 2 massive files (3k and 8k lines respectively)?