3 ms·
The encode/decode is almost certainly not optimized, it's using Pytorch and is a research project, a 10x speedup with a tuned implementation is probably easily
by ltbarcly3 7y ago
The encode/decode is almost certainly not optimized, it's using Pytorch and is a research project, a 10x speedup with a tuned implementation is probably easily reachable, and I wouldn't be surprised if 100x were possible even without using a GPU.
- qayxc 7y agoWhere did you get that from? PyTorch is already pretty optimised and relies on GPU acceleration. The only parts that are slow in comparison are the bits written in Python and those are just the frontend application. There's not much room for performance improvement.
- ltbarcly3 7y agopytorch has optimized generic primitives, generally optimization means including safe assumptions specific to the problem you are restricting the solution to. For example, YACC is highly optimized, but the parsers in GCC and LLVM are an order of magnitude faster because they are custom recursive-descent parsers optimized for the specific languages that those compilers actually support. GCC switched from YACC/Bison, which are each highly optimized, in version 4.0, and parsing was sped up dramatically. Additionally, a lot of the glue code in any pytorch project is python, which is astonishingly slow compared to C++. So I reiterate, a 10x speedup would be mundane when moving from a generic solution like pytorch and coding something specific for using this technique for image compression. Finally, Pytorch is optimized primarily for model training in an Nvidia GPU. Applying models doesn't need a GPU for good performance, and in fact probably isn't a net win due to the need to allocate and copy data, and the fact that consumer computers often have slow integrated GPU's that can't run nvidia gpu code, and the compatible system (OpenCL, which basically isn't used in ML in a serious way yet) is supported on many systems on the CPU only since integrated GPU's are still slower than the CPU even with OpenCL.