How to disable these two types of log output?

username: AlexLuya
cooked: <p>Hello,I got two  types of log output:</p>
<p>First type which comes from Dataloader:</p>
<pre><code class="lang-auto">INFO     process shutting down 2024-12-21 20:51:22,045
INFO     process shutting down 2024-12-21 20:51:22,045
INFO     process exiting with exitcode 0 2024-12-21 20:51:22,045
INFO     process exiting with exitcode 0 2024-12-21 20:51:22,046
INFO     process shutting down 2024-12-21 20:51:22,046
INFO     process exiting with exitcode 0 2024-12-21 20:51:22,046
INFO     process shutting down 2024-12-21 20:51:22,046
INFO     process shutting down 2024-12-21 20:51:22,046
</code></pre>
<p>Second type which comes from torch.distributed</p>
<p><code>sc:14361:15083 [0] NCCL INFO AllReduce: opCount 0 sendbuff 0x7af275e06400 recvbuff 0x7af275e06400 count 3921 datatype 7 op 0 root 0 comm 0x14e99380 [nranks=1] stream 0x13d72800</code></p>
<p>I have tried to set log level like this:</p>
<p><code>torch._logging.set_logs(all = logging.WARN)</code></p>
<p>but it doesn’t work.</p>
<p>Question is how to get rid of these two types log?</p>

username: ptrblck
cooked: <p>The NCCL log is printed since you’ve exported the <code>NCCL_DEBUG</code> env variable. <code>unset</code> it and the logs will disappear.</p>

username: AlexLuya
cooked: <aside class="quote no-group" data-username="ptrblck" data-post="2" data-topic="214492">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/48/1823_2.png" class="avatar"> ptrblck:</div>
<blockquote>
<p>NCCL_DEBUG</p>
</blockquote>
</aside>
<p>Thanks,NCCL log gone by following your suggestion,<br>
would you please give some suggestions about that Data</p>
<pre><code class="lang-auto">Loader log?
INFO     process shutting down 2024-12-21 20:51:22,045
INFO     process shutting down 2024-12-21 20:51:22,045
INFO     process exiting with exitcode 0 2024-12-21 20:51:22,045
INFO     process exiting with exitcode 0 2024-12-21 20:51:22,046
INFO     process shutting down 2024-12-21 20:51:22,046
INFO     process exiting with exitcode 0 2024-12-21 20:51:22,046
INFO     process shutting down 2024-12-21 20:51:22,046
INFO     process shutting down 2024-12-21 20:51:22,046
</code></pre>

username: ptrblck
cooked: <p>I don’t kow where these logs come from as I haven’t seen them in PyTorch. A quick forum search suggests you might have enabled them via <code>logger = multiprocessing.log_to_stderr()</code>.</p>

username: AlexLuya
cooked: <aside class="quote no-group" data-username="ptrblck" data-post="4" data-topic="214492">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/48/1823_2.png" class="avatar"> ptrblck:</div>
<blockquote>
<p>log_to_stderr</p>
</blockquote>
</aside>
<p>Thanks,these logs comes from the workers of  DataLoader</p>
<p><code>DataLoader(trainDataSet, batch_size = len(x_train), num_workers = 1)</code></p>
<p>set<br>
<code>num_workers = 1</code><br>
will print out one line, set<br>
<code>num_workers = n</code><br>
will print out n lines</p>