<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 9, 2016 at 8:59 PM, Pete Cooper <span dir="ltr"><<a href="mailto:peter_cooper@apple.com" target="_blank">peter_cooper@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Sean<div><br></div><div>I think you’ve summed it up really well here.</div><div><br></div><div>Personally I don’t think we should accept backends for which there is no way to run the code.  The burden (however small) on the community to having an in-tree backend they can’t use is too high IMO.</div><div><br></div><div>As you point out ‘no way to run the code’ may mean not having access to HW, or having HW but no API.</div><div><br></div><div>NVPTX is a good example.  Now you can take the output from LLVM and run it on HW.  It may or may not be how Nvidia do it in their code, but that doesn’t matter, you can do it.  Same for AMDGPU.</div></div></blockquote><div><br></div><div>One thing to note is that all the leg work for getting CUDA working with the open source toolchain (e.g. <a href="http://llvm.org/docs/CompileCudaWithLLVM.html">http://llvm.org/docs/CompileCudaWithLLVM.html</a>) was done by Googlers (Jingyue Wu, Artem Belevich, and probably others I don't remember off the top of my head). In my experience with LLVM, the Google folks have been first-rate open source citizens. Unless Jacques' team contributing here is from a drastically different organization/culture within google (idk, are they?), I have full faith that this is meant with the best intentions and won't go the way of a "code drop".<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>So -1 from me to having backends we can’t make use of.</div></div></blockquote><div><br></div><div>I'm not sure I agree on that. Assume for a second that we are in a hypothetical world where the reasons for keeping the Apple GPU backends private vanished (but the actual driver stack was still locked down; i.e. CanIRunTheCode is still "No"). I would personally say that it would be beneficial for LLVM to have those backends developed upstream if only so that we can have Owen's team participating upstream more, as their expertise is a huge asset to the community.</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>Finally, one option is to have perpetually experimental backends.  Then all the code is in tree but no-one in tree should ever be expected to update it.  That does have the big advantage that all of the code is there to discuss and the maintainers can make contributions to common code and gain/provide help in the community.  They can also be involved in discussions which impact them such as changes to common code.</div><div><br></div><div>Cheers,</div><div>Pete<span class=""><br><div><blockquote type="cite"><div>On Feb 9, 2016, at 4:18 PM, Sean Silva via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">One data point (IIRC) is that the NVPTX backend sat in tree for a long time without a way to actually use them. But lately this has been opening up (e.g. <a href="http://llvm.org/docs/CompileCudaWithLLVM.html" target="_blank">http://llvm.org/docs/CompileCudaWithLLVM.html</a>). However, the obstacle for NVPTX was mostly a software proprietary-ness (no way to plug it into the driver stack really, except via nvidia's own proprietary software), whereas the actual hardware was available. For the Lanai stuff, it seems like the hardware is fundamentally not available for purchase.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">The reverse situation is with e.g. Apple's GPU backends, where the devices are readily available, but (AFAIK) even if the backend were open-source you couldn't run the code produced by the open-source compiler.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Or to put it in matrix form (this is all heavily prefixed by "AFAIK"; corrections welcome):</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font face="monospace, monospace">AMDGPU:      InTree:Yes DevicesAvailable:Yes CanIRunTheCode:Yes</font></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font face="monospace, monospace">NVPTX:       InTree:Yes DevicesAvailable:Yes </font><span style="font-family:monospace,monospace">CanIRunTheCode</span><font face="monospace, monospace">:Yes</font></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font face="monospace, monospace">Lanai:       InTree:?   DevicesAvailable:No  </font><span style="font-family:monospace,monospace">CanIRunTheCode</span><font face="monospace, monospace">:No</font></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font face="monospace, monospace">Apple GPU's: InTree:No  DevicesAvailable:Yes </font><span style="font-family:monospace,monospace">CanIRunTheCode</span><font face="monospace, monospace">:No</font></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"> </div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">I couldn't come up with a good name for "Can I Run The Code" column. Basically it means: "assuming the backend were in open source, could I actually run the code produced by the open source backend somehow?".</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">I had a quick look at lib/Target and it seems like every backend we have has "CanIRunTheCode:Yes" in theory.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">IIRC, the NVPTX stuff used to actually be "No" though?</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Anyway, just a random thought. Not sure what the conclusion is.</div></div></blockquote></div><br></span></div></div></blockquote></div><br></div></div>