Is qunatization supported/possible on Windows ?(getting RuntimeError: Quantized backend not supported )

Shisho_Sama: <p>Hello everyone, hope you are having a great time .<br>
I’m trying to get the samples (Tutorials on quantization) to run on windows instead of linux.<br>
for Linux it works just fine, but for windows for example doing simply :</p>
<pre><code class="lang-auto">model_bk = models.mobilenet_v2(pretrained=True, progress=True, quantize=True)
num_ftrs=model_bk.classifier[1].in_features
</code></pre>
<p>results in :</p>
<pre><code class="lang-auto">---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
d:\Codes\Quantization\quantization.py in 
----&gt; 1 model_bk = models.mobilenet_v2(pretrained=True, progress=True, quantize=True)
      2 num_ftrs=model_mbnet_fe.classifier[1].in_features
      3 

~\Anaconda3\lib\site-packages\torchvision\models\quantization\mobilenet.py in mobilenet_v2(pretrained, progress, quantize, **kwargs)
     78         # TODO use pretrained as a string to specify the backend
     79         backend = 'qnnpack'
---&gt; 80         quantize_model(model, backend)
     81     else:
     82         assert pretrained in [True, False]

~\Anaconda3\lib\site-packages\torchvision\models\quantization\utils.py in quantize_model(model, backend)
     20     _dummy_input_data = torch.rand(1, 3, 299, 299)
     21     if backend not in torch.backends.quantized.supported_engines:
---&gt; 22         raise RuntimeError("Quantized backend not supported ")
     23     torch.backends.quantized.engine = backend
     24     model.eval()

RuntimeError: Quantized backend not supported 
</code></pre>
<p>doing :</p>
<pre><code class="lang-auto">print(*torch.__config__.show().split('\n'),sep='\n')
</code></pre>
<p>results in :</p>
<blockquote>
<p>PyTorch built with:</p>
<ul>
<li>MSVC 191125547</li>
<li>Intel(R) Math Kernel Library Version 2019.0.4 Product Build 20190411 for Intel(R) 64 architecture applications</li>
<li>OpenMP 200203</li>
<li>Build settings: BLAS=MKL, BUILD_NAMEDTENSOR=OFF, BUILD_TYPE=Release, CXX_FLAGS=/DWIN32 /D_WINDOWS  /GR  /w /EHa /MP /bigobj -openmp, DISABLE_NUMA=1, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, USE_CUDA=0, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=OFF, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=OFF, USE_OPENMP=ON, USE_STATIC_DISPATCH=OFF,</li>
</ul>
</blockquote>
<p>which clearly shows <strong>USE_NNPACK=OFF</strong>, as nnpack is not even supported on Windows.<br>
So knowing that MKDNN is supported , should it not have been the chosen backend here? (instead of nnpack) ?<br>
Or is there something else that I dont know of, which is needed to get this to work on windows!<br>
Also I noticed <code>torch.backends.quantized.supported_engines</code> returns<code> [none]</code>!</p>
<p>Any help is greatly appreciated<br>
Thank you all in advance</p>

peterjc123: <p>See <a href="https://github.com/pytorch/pytorch/issues/29327" rel="nofollow noopener">https://github.com/pytorch/pytorch/issues/29327</a> and <a href="https://github.com/pytorch/pytorch/issues/31684#issuecomment-572584403" rel="nofollow noopener">https://github.com/pytorch/pytorch/issues/31684#issuecomment-572584403</a>.</p>

Shisho_Sama: <p>Thanks a lot . that was a refereshing news really! specially knowing the fbgemm is now supported on windows. do you think  this can make it into the nighyly build in a near future ? like in the next month or even sooner?</p>

peterjc123: <p>It depends on when the fbgemm team thinks it’s ready.</p>

Shisho_Sama: <p>Thanks a lot <a class="mention" href="/u/peterjc123">@peterjc123</a> really appreciate all your hard works on the windows front</p>

Shisho_Sama: <p><a class="mention" href="/u/peterjc123">@peterjc123</a> Do you mind if I ask a question?<br>
Does MKLDNN need to be supported for the quantization to work as well, or do they just need to add support for qnnpack or fbgemm for windows regardless of the existance of MKDNN support?</p>

peterjc123: <p>I believe MKLDNN is not required for quantization and building FBGEMM.</p>