Pytorch 1.0 vs Caffe 2

Now that pytorch and caffe 2 share the same backend code, what is the difference between the two? ( i.e. why are there two libraries? ) Is there a performance benefit of using Caffe2 compared to Pytorch 1.0? I assume Caffe2 would have the upperhand since it compiles, where as Pytorch interprets ( please correct me if I’m wrong ).

Thanks

PyTorch has the Python API, and also it has dynamic graphs whereas Caffe2 uses static graphs etc. I think the main reason for compiled graphs is rather deployment (e.g., running code on mobile devices) rather than substantial speed advantages on workstations.

Is there a performance benefit of using Caffe2 compared to Pytorch 1.0? I assume Caffe2 would have the upperhand since it compiles, where as Pytorch interprets ( please correct me if I’m wrong ).

Not sure about benchmarks and whether it will be noticeable. I think CUDA and CuDNN are the main bottlenecks so I am not sure if it makes a big difference whether the code is run from Python or C++ (based on past benchmarks, e.g., TensorFlow was usually slower than PyTorch while the first one used compiled and optimized graphs). Would be curious to hear about benchmarks.

1 Like