Caffe2 + PyTorch

vadimkantorov: <p>A few questions for core team about plans on Caffe2 + PyTorch1 co-existence:</p>
<ol>
<li>
<p>Are there plans for making Caffe2 kernels available to PyTorch? There are many vision-specific kernels in Caffe2, not currently available in PyTorch (like detectron etc).</p>
</li>
<li>
<p>Are there plans to make Caffe2 and PyTorch kernels the same thing sharing the same ATen base ops? Or they are going to be independent and only share the Tensor format?</p>
</li>
<li>
<p>Do Caffe2 and PyTorch have different optimizing compilers?</p>
</li>
<li>
<p>Are there benchmarks on performance of Caffe2 versus PyTorch (jit / nojit)?</p>
</li>
</ol>
<p>Thanks a lot <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=6" title=":slight_smile:" class="emoji" alt=":slight_smile:"> Maybe some of these were already addressed at PyTorch conference <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=6" title=":slight_smile:" class="emoji" alt=":slight_smile:"></p>
<p><a class="mention" href="/u/smth">@smth</a> <a class="mention" href="/u/apaszke">@apaszke</a> <a class="mention" href="/u/fmassa">@fmassa</a></p>

smth: <ol>
<li>They will be implicit, i.e. no you wont get all the C2 operators exposed in the torch.* namespace, but where PyTorch operators have equivalent Caffe2 operators, the backends will be merged to just use the Caffe2 kernel instead if it’s more efficient.</li>
<li>Answered in 1. And as of last week, C2 and PyTorch have the same Tensor format (c10::TensorImpl I think)</li>
<li>Not in the long term, yes in the short term</li>
<li>No</li>
</ol>

vadimkantorov: <p>Thanks <a class="mention" href="/u/smth">@smth</a> for clarifications! <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=6" title=":slight_smile:" class="emoji" alt=":slight_smile:"></p>
<ol>
<li>Really hoping for more unification <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=6" title=":slight_smile:" class="emoji" alt=":slight_smile:"> Since many detectron and other vision ops get pushed out faster in Caffe2 world</li>
</ol>
<p>Additional questions:<br>
5. How tied is the TorchScript or torch.jit to Python? I mean what happens if Julia people write bindings for PyTorch, will they be able to make use of torch.jit? If you load a model trained somewhere else, will PyTorch be able to optimize its execution as well?</p>
<ol start="6">
<li>Are there bigger plans for torch.contrib? Right now it seems to stay semi-secret <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=6" title=":slight_smile:" class="emoji" alt=":slight_smile:">
</li>
</ol>

smth: <ol start="5">
<li>torch.jit is not tied to Python. C++ API can do tracing.</li>
<li>Yes, once we get bandwidth that was all sucked up for 1.0 Preview and DevCon <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=6" title=":slight_smile:" class="emoji" alt=":slight_smile:">
</li>
</ol>

vadimkantorov: <p>Thanks for the details <a class="mention" href="/u/smth">@smth</a> <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=6" title=":slight_smile:" class="emoji" alt=":slight_smile:"> More PyTorch goodness for everyone <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=6" title=":slight_smile:" class="emoji" alt=":slight_smile:"></p>
<p>The original PyTorch 1.0 blog post was not very clear on these details, and I think it is important for users to understand general PyTorch directions, especially when TensorFlow develops eager mode, and heterogenous compilation technologies start off. Btw, any plans for TensorComprehensions / Halide tighter integration? (<a href="https://people.csail.mit.edu/tzumao/gradient_halide/gradient_halide.pdf" rel="nofollow noopener">https://people.csail.mit.edu/tzumao/gradient_halide/gradient_halide.pdf</a>)</p>

vadimkantorov: <p>Hi <span class="mention">@soumith</span> <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=9" title=":slight_smile:" class="emoji" alt=":slight_smile:"> Are there any news about a big picture view on Caffe2 and PyTorch codebases? <a href="https://github.com/pytorch/pytorch/tree/master/caffe2/operators" rel="nofollow noopener">https://github.com/pytorch/pytorch/tree/master/caffe2/operators</a> seems to still have a lot of ops and many of them match what PyTorch does, e.g. sin() : <a href="https://github.com/pytorch/pytorch/blob/master/caffe2/operators/sin_op.cu" rel="nofollow noopener">https://github.com/pytorch/pytorch/blob/master/caffe2/operators/sin_op.cu</a></p>