<h2 dir="auto"><g-emoji class="g-emoji" alias="rocket" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f680.png">🚀</g-emoji> Feature</h2>
<p dir="auto">The MKLDNN is enabled by default for linux based packages (both pip and conda). However, on windows it is disabled by default and we are instructed to compile it from source code.<br>
Is there any technical reason behind  this, that made it disabled by default under windows and not linux? or is it just an unintentional bug?</p>
<h2 dir="auto">Motivation</h2>
<p dir="auto">MKLDNN has a profound affect on performance specially when used in CPU only mode. The inclusion of it by default in Windows based packages will then help a lot.<br>
It may also be the reason behind the performance difference between the two platforms (Linux being much faster than its windows counter part)</p>
<h2 dir="auto">Pitch</h2>
<p dir="auto">Enable MKLDNN by default for pip/conda packages under Windows just like Linux</p>
<h2 dir="auto">Bug</h2>
<p dir="auto">In MKLDNN cmake, MSVS build are disabled explicitly.<br>
</p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/pytorch/pytorch/blob/12e0ed55b4327d41052651ddbae58506c5957ab8/cmake/Modules/FindMKLDNN.cmake#L16-L19">pytorch/cmake/Modules/FindMKLDNN.cmake</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 16 to 19
      in
      <a data-pjax="true" class="commit-tease-sha" href="/pytorch/pytorch/commit/12e0ed55b4327d41052651ddbae58506c5957ab8">12e0ed5</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L16" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="16"></td>
          <td id="LC16" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">IF</span>(MSVC) </td>
        </tr>

        <tr class="border-0">
          <td id="L17" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="17"></td>
          <td id="LC17" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   <span class="pl-c1">MESSAGE</span>(STATUS <span class="pl-s">"MKL-DNN needs omp 3+ which is not supported in MSVC so far"</span>) </td>
        </tr>

        <tr class="border-0">
          <td id="L18" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="18"></td>
          <td id="LC18" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   <span class="pl-k">RETURN</span>() </td>
        </tr>

        <tr class="border-0">
          <td id="L19" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="19"></td>
          <td id="LC19" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">ENDIF</span>(MSVC) </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">I think this is no longer the case as we can build mkldnn directly with Visual Studio 2017 and MKLDNN's official cmake doesn't complain about that<br>
<a href="https://github.com/intel/mkl-dnn/blob/4bdffc2cb1c3d47df9604d35d2c7e5e47a13f1a6/cmake/OpenMP.cmake#L78-L81">https://github.com/intel/mkl-dnn/blob/4bdffc2cb1c3d47df9604d35d2c7e5e47a13f1a6/cmake/OpenMP.cmake#L78-L81</a></p>
<p dir="auto">But, after commenting out the <code class="notranslate">RETURN()</code>, the issue I'm encountering is about ideep.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pytorch\third_party\ideep\include\ideep\allocators.hpp(151): error C2039: 'posix_memalign': is not a member of '`global namespace''
pytorch\third_party\ideep\include\ideep\allocators.hpp(151): error C3861: 'posix_memalign': identifier not found"><pre class="notranslate"><code class="notranslate">pytorch\third_party\ideep\include\ideep\allocators.hpp(151): error C2039: 'posix_memalign': is not a member of '`global namespace''
pytorch\third_party\ideep\include\ideep\allocators.hpp(151): error C3861: 'posix_memalign': identifier not found
</code></pre></div>
<h2 dir="auto">Environment</h2>
<ul dir="auto">
<li>PyTorch Version (e.g., 1.0): master</li>
<li>OS (e.g., Linux): Win10</li>
<li>How you installed PyTorch (<code class="notranslate">conda</code>, <code class="notranslate">pip</code>, source): source</li>
<li>Build command you used (if compiling from source): cmake + ninja</li>
<li>Python version: 3.7.2</li>
<li>CUDA/cuDNN version: 10.0/7</li>
<li>GPU models and configuration: 1080Ti</li>
</ul>