<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto">CPU usage tops at 100% when running models on macOS</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Steps to reproduce the behavior:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.get_num_threads()
1
&gt;&gt;&gt; torch.torch.set_num_threads(4)
&gt;&gt;&gt; torch.get_num_threads()
1
&gt;&gt;&gt; import mkl
&gt;&gt;&gt; mkl.get_max_threads()
4"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.get_num_threads()
1
&gt;&gt;&gt; torch.torch.set_num_threads(4)
&gt;&gt;&gt; torch.get_num_threads()
1
&gt;&gt;&gt; import mkl
&gt;&gt;&gt; mkl.get_max_threads()
4
</code></pre></div>
<p dir="auto">Intel MKL allows 4 threads but cannot make torch go multithreaded.</p>
<p dir="auto">Environment variables are set as</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export MKL_NUM_THREADS=4
export OMP_NUM_THREADS=4"><pre class="notranslate"><code class="notranslate">export MKL_NUM_THREADS=4
export OMP_NUM_THREADS=4
</code></pre></div>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">CPU usage &gt; 100% and torch.get_num_threads()&gt;1</p>
<h2 dir="auto">Environment</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
 - PyTorch Version (e.g., 1.0): 1.2.0
 - OS (e.g., Linux): macOS
 - How you installed PyTorch (`conda`, `pip`, source): pip
 - Build command you used (if compiling from source):
 - Python version: 3.7.0
 - CUDA/cuDNN version: NA
 - GPU models and configuration: NA
 - Any other relevant information: Quad core CPU MacBook pro
"><pre class="notranslate"><code class="notranslate">
 - PyTorch Version (e.g., 1.0): 1.2.0
 - OS (e.g., Linux): macOS
 - How you installed PyTorch (`conda`, `pip`, source): pip
 - Build command you used (if compiling from source):
 - Python version: 3.7.0
 - CUDA/cuDNN version: NA
 - GPU models and configuration: NA
 - Any other relevant information: Quad core CPU MacBook pro

</code></pre></div>
<h2 dir="auto">Additional context</h2>
<p dir="auto">Also tried to manually reinstall intel MKL with no avail.</p>
<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto">The pip package does not ship MKL with it and MKL is required for fft support on cpu.</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Steps to reproduce the behavior:</p>
<ol dir="auto">
<li>Run the following code with Pytorch installed with pip</li>
</ol>
<p dir="auto">import torch<br>
from kymatio import Scattering2D</p>
<p dir="auto">scattering = Scattering2D(J=2, shape=(32, 32))<br>
x = torch.randn(1, 1, 32, 32)<br>
Sx = scattering(x)<br>
print(Sx.size())</p>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/26926814/55683542-43fe5b00-5941-11e9-86f3-0cc5475e86ba.png"><img width="1019" alt="Screenshot 2019-04-07 at 14 26 59" src="https://user-images.githubusercontent.com/26926814/55683542-43fe5b00-5941-11e9-86f3-0cc5475e86ba.png" style="max-width: 100%;"></a></p>
<h2 dir="auto">Environment</h2>
<ul dir="auto">
<li>PyTorch Version (e.g., 1.0): 1.0.1.post2</li>
<li>OS (e.g., Linux): Mac OS Mojave version 10.14.3</li>
<li>How you installed PyTorch (<code class="notranslate">conda</code>, <code class="notranslate">pip</code>, source): pip</li>
<li>Build command you used (if compiling from source): None</li>
<li>Python version: 3.6.1</li>
<li>CUDA/cuDNN version: None</li>
<li>GPU models and configuration: None</li>
<li>Any other relevant information: None</li>
</ul>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ezyang/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ezyang">@ezyang</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gchanan/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gchanan">@gchanan</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zou3519/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zou3519">@zou3519</a></p>