How to install this?

username: Hannibal046
cooked: <p>Hello, I’m using docker image from Nvidia:<code>nvcr.io/nvidia/pytorch:21.06-py3</code>, where I found the torch version is <code>torch==1.11.0a0+b6df043</code>, I am wondering how can I install this package locally rather than  in docker ? thanks so much</p>

username: ptrblck
cooked: <p>You could clone the repository, <code>git checkout</code> the commit mentioned in the version, and build PyTorch locally.</p>

username: Hannibal046
cooked: <p>Hi, thanks so much for your reply.<br>
I did clone the repository  and using <code>git log</code> to find the commitment id starting with b6df043. But after install pytorch from source, I find it is still not the exact version I want. This is what I got from git:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/0/d/0d7da59da249a9a2ddae235ececde2b40d79e841.png" data-download-href="https://discuss.pytorch.org/uploads/default/0d7da59da249a9a2ddae235ececde2b40d79e841" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/0/d/0d7da59da249a9a2ddae235ececde2b40d79e841_2_690x60.png" alt="image" data-base62-sha1="1Vlp4Eoq2tcD4n9NmgghUizttCh" width="690" height="60" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/0/d/0d7da59da249a9a2ddae235ececde2b40d79e841_2_690x60.png, https://discuss.pytorch.org/uploads/default/optimized/3X/0/d/0d7da59da249a9a2ddae235ececde2b40d79e841_2_1035x90.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/0/d/0d7da59da249a9a2ddae235ececde2b40d79e841.png 2x" data-dominant-color="16F812"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1064×94 20.7 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
But in the docker, I got<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/9/6/964759d015995bdda3d76943b2f5bf9c56668e36.png" data-download-href="https://discuss.pytorch.org/uploads/default/964759d015995bdda3d76943b2f5bf9c56668e36" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/9/6/964759d015995bdda3d76943b2f5bf9c56668e36_2_690x219.png" alt="image" data-base62-sha1="lrqujMOd3Ikc9eeTZxOAJ6QcONM" width="690" height="219" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/9/6/964759d015995bdda3d76943b2f5bf9c56668e36_2_690x219.png, https://discuss.pytorch.org/uploads/default/optimized/3X/9/6/964759d015995bdda3d76943b2f5bf9c56668e36_2_1035x328.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/9/6/964759d015995bdda3d76943b2f5bf9c56668e36.png 2x" data-dominant-color="103C0E"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1076×342 53.2 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>And one of the different between this two is that they got different function signature of <code>torch.nn.functional.gelu</code>:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/f/6/f62b8a1e479af0b3ad065e846c584d54b410a767.png" data-download-href="https://discuss.pytorch.org/uploads/default/f62b8a1e479af0b3ad065e846c584d54b410a767" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/f/6/f62b8a1e479af0b3ad065e846c584d54b410a767_2_690x213.png" alt="image" data-base62-sha1="z7IJVn4poaDGEYiMZndKFSbRXgj" width="690" height="213" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/f/6/f62b8a1e479af0b3ad065e846c584d54b410a767_2_690x213.png, https://discuss.pytorch.org/uploads/default/optimized/3X/f/6/f62b8a1e479af0b3ad065e846c584d54b410a767_2_1035x319.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/f/6/f62b8a1e479af0b3ad065e846c584d54b410a767_2_1380x426.png 2x" data-dominant-color="0A9808"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1904×588 69.8 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/7/7/779f885830ede1a1c34018f5ee26e42aee53946a.png" data-download-href="https://discuss.pytorch.org/uploads/default/779f885830ede1a1c34018f5ee26e42aee53946a" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/7/7/779f885830ede1a1c34018f5ee26e42aee53946a_2_690x227.png" alt="image" data-base62-sha1="h4eCbSsJXKn35fZzwsyArtSkayC" width="690" height="227" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/7/7/779f885830ede1a1c34018f5ee26e42aee53946a_2_690x227.png, https://discuss.pytorch.org/uploads/default/optimized/3X/7/7/779f885830ede1a1c34018f5ee26e42aee53946a_2_1035x340.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/7/7/779f885830ede1a1c34018f5ee26e42aee53946a_2_1380x454.png 2x" data-dominant-color="0CC80B"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">2042×672 100 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>could you please help me out ? thanks so much !</p>

username: ptrblck
cooked: <p>The <code>gelu</code> difference is an internal cherry-pick to allow <code>nvfuser</code> as the JIT backend to fuse this operation.<br>
I would recommend to rebuild from the current <code>master</code> branch, as these changes were already merged (with some refactoring).</p>

username: Hannibal046
cooked: <p>Hi, I rebuild from the <code>master</code> branch, and using  <code>approximate='tanh'</code> rather than <code>True</code>. And it works. Thanks so much for your proficiency and detailed reply !!</p>