Install particular pytorch nightly

thorstenwagner: <p>Hi there,</p>
<p>I need to use a nightly build of pytorch because the stable release has a compilation bug.</p>
<p>Now I have tested everything with the latest nightly build, but I’m afraid that something will break with a later one and I won’t notice. Is there any way to pin my software to a specific nightly build? I noticed that only the latest nightly is available in the conda channel.</p>
<p>Best,<br>
Thorsten</p>

ptrblck: <p>I’m unsure how the <code>conda</code> nightly channel is used currently, but you can manually download the corresponding nightly pip wheels and install it locally.</p>

marksaroufim: <p>Something like this should work <code>pip3 install torch==2.1.0.dev20230814+cu118 --index-url https://download.pytorch.org/whl/nightly/cu118</code></p>
<p>So feel free to put in the version, date and cuda version you need, you can check and see if you can conda install the wheels directly from the index file I provided</p>

youkaichao1: <p>When I try to install <code>pip install "torch==2.2.0.dev20231015+cu121" --index-url https://download .pytorch.org/whl/nightly/cu121</code>, I got the following error:</p>
<pre><code class="lang-plaintext">ERROR: Could not find a version that satisfies the requirement torch==2.2.0.dev20231015+cu121 (from versions: 2.2.0.dev20231010+cu121, 2.3.0.dev20240117+cu121, 2.3.0.dev20240118+cu121, 2.3.0.dev20240119+cu121, 2.3.0.dev20240120+cu121, 2.3.0.dev20240121+cu121, 2.3.0.dev20240122+cu121, 2.3.0.dev20240123+cu121, 2.3.0.dev20240124+cu121, 2.3.0.dev20240125+cu121, 2.3.0.dev20240126+cu121, 2.3.0.dev20240127+cu121, 2.3.0.dev20240128+cu121, 2.3.0.dev20240129+cu121, 2.3.0.dev20240130+cu121, 2.3.0.dev20240131+cu121, 2.3.0.dev20240201+cu121, 2.3.0.dev20240202+cu121, 2.3.0.dev20240203+cu121, 2.3.0.dev20240204+cu121, 2.3.0.dev20240205+cu121, 2.3.0.dev20240206+cu121, 2.3.0.dev20240207+cu121, 2.3.0.dev20240208+cu121, 2.3.0.dev20240209+cu121, 2.3.0.dev20240210+cu121, 2.3.0.dev20240211+cu121, 2.3.0.dev20240212+cu121, 2.3.0.dev20240213+cu121, 2.3.0.dev20240214+cu121, 2.3.0.dev20240215+cu121, 2.3.0.dev20240216+cu121, 2.3.0.dev20240217+cu121, 2.3.0.dev20240218+cu121, 2.3.0.dev20240219+cu121, 2.3.0.dev20240220+cu121, 2.3.0.dev20240221+cu121, 2.3.0.dev20240222+cu121, 2.3.0.dev20240223+cu121, 2.3.0.dev20240224+cu121, 2.3.0.dev20240225+cu121, 2.3.0.dev20240226+cu121, 2.3.0.dev20240227+cu121, 2.3.0.dev20240228+cu121, 2.3.0.dev20240229+cu121, 2.3.0.dev20240301+cu121, 2.3.0.dev20240302+cu121, 2.3.0.dev20240303+cu121, 2.3.0.dev20240304+cu121, 2.3.0.dev20240305+cu121, 2.3.0.dev20240306+cu121, 2.3.0.dev20240307+cu121, 2.3.0.dev20240308+cu121, 2.3.0.dev20240309+cu121, 2.3.0.dev20240310+cu121, 2.3.0.dev20240311+cu121, 2.3.0.dev20240312+cu121, 2.3.0.dev20240313+cu121, 2.3.0.dev20240314+cu121, 2.3.0.dev20240315+cu121, 2.4.0.dev20240316+cu121)
</code></pre>
<p>It seems only one nightly build for 2.2.0 (<code>2.2.0.dev20231010+cu121</code>) is available, while the rest are gone. How do I search for other nightly binaries in 2.2.0?</p>

ptrblck: <p>Check <a href="https://discuss.pytorch.org/t/how-long-are-nightly-whls-available/185508/3">this post</a>. For your wheel, this should work:</p>
<pre data-code-wrap="python"><code class="lang-python">curl -OL https://download.pytorch.org/whl/nightly/cu121/torch-2.2.0.dev20231015%2Bcu121-cp310-cp310-linux_x86_64.whl
</code></pre>

youkaichao1: <p>Can we somehow list the wheels that can be downloaded? That would greatly help!</p>
<p>In addition, how do package dependencies work then? e.g. is the corresponding <code>torch-triton</code> included in the wheel?</p>

youkaichao1: <p>Okay, here is the magic:</p>
<pre data-code-wrap="sh"><code class="lang-sh">pip install https://download.pytorch.org/whl/nightly/pytorch_triton-2.1.0%2B6e4932cda8-cp39-cp39-linux_x86_64.whl
pip install https://download.pytorch.org/whl/nightly/cu121/torch-2.2.0.dev20231015%2Bcu121-cp39-cp39-linux_x86_64.whl
# verify basic cuda functionality
python -c "import torch; print(torch.randn(5, 5, 5).cuda().sum())"
# verify pt2 stack
python -c "import torch; print(torch.compile(lambda x: x + 1)(torch.randn(5, 5, 5).cuda()).sum())"
</code></pre>
<p>With this, I can install previous nightly version now. Just need to try many urls manually <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=12" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>

youkaichao1: <p>In case anyone is interested, I created a script to spell out all the available urls: <a href="https://github.com/youkaichao/list_pytorch_nightly" class="inline-onebox" rel="noopener nofollow ugc">GitHub - youkaichao/list_pytorch_nightly: List recently available pytorch nightly version, for every day</a> .</p>