Watchdog caught collective operation timeout - Finding an ML engineer who can solve these problems

jam1: <p>I have been working on ML-related projects for about 5 years so I am fairly experienced in this space. I am currently working on a project related to building reward models. I have run into a number of errors when trying to parallelize reward model training that have been extremely challenging to debug (as it often takes 40 mins of training before the errors are encountered) and I am looking for people who have lots of experience with PyTorch who I could pay to help me debug these issues. Are there any talented devs out there who would be interested in this or anyone with referrals? Would be greatly appreciated! I am willing to pay approx $100/hr for office hour-like support.</p>
<p>Here is an example of the kind of bugs I am running into.</p>
<p>I get the following error when trying to train my model</p>
<p>watchdog caught collective operation timeout and then gives an ALL REDUCE or broadcast operation</p>
<p>Essentially it waits more than 30 mins for the GPU to perform a particular operation</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/6/8/68bba168e79b20eef7821b4860f635104918a820.png" data-download-href="https://discuss.pytorch.org/uploads/default/68bba168e79b20eef7821b4860f635104918a820" title="Screenshot 2023-05-07 at 11.50.52 PM"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/6/8/68bba168e79b20eef7821b4860f635104918a820_2_690x219.png" alt="Screenshot 2023-05-07 at 11.50.52 PM" data-base62-sha1="eWvEvNAM5gGHjarWtwizWL0w144" width="690" height="219" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/6/8/68bba168e79b20eef7821b4860f635104918a820_2_690x219.png, https://discuss.pytorch.org/uploads/default/original/3X/6/8/68bba168e79b20eef7821b4860f635104918a820.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/6/8/68bba168e79b20eef7821b4860f635104918a820.png 2x" data-dominant-color="3E3D3F"><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">Screenshot 2023-05-07 at 11.50.52 PM</span><span class="informations">861×274 113 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>This is weird for several reasons</p>
<ol>
<li>
<p>this error doesn’t work with a single GPU so it is something to do with distributed training</p>
</li>
<li>
<p>I can make this error go away with a simple change: in the forward method, instead of returning the loss that we actually compute, I just return a 0 tensor, the model doesn’t seem to freeze</p>
</li>
</ol>

eqy: <p>You may want to attach a debugger such as <code>gdb</code> to check if one or more or your processes/jobs have crashed causing the collective operation to hang. If you suspect that the NCCL communication itself is somehow broken, you could check the output with the environment variable <code>NCCL_DEBUG=INFO</code> and see if that provides more information.</p>

kumpera: <p>The error is because rank 2 is performing a broadcast while all other ranks are performing an all_reduce.</p>
<p>You need to ensure all ranks execute the same collectives.</p>

guyu23: <p><a class="mention" href="/u/kumpera">@kumpera</a> How to ensure all ranks execute the same collectives, I have same problem, do I need add some codes?</p>
<p>This happens in my specific dataset, it works in single GPU and I have checked all data, but training stuck in DDP, I use 8 A100</p>

baiyuting: <p><a class="mention" href="/u/guyu23">@guyu23</a> I have the same question. Do you solve it?</p>

Drew_Wert: <p>try</p>
<pre><code class="lang-auto">find_unused_parameters=True
</code></pre>
<p>In my case, unused parameters was the cause of the such hang-up</p>

baiyuting: <p>I have set find_unused_parameters=True, it still does not solve the problem</p>