Skip to content

Commit e1bcbbf

Browse files
Xia-Weiwenpytorchmergebot
authored andcommitted
[Quant] make x86 the default quantization backend (qengine) (#91235)
**Summary** Make x86 the default quantization backend (qengine) for X86 CPU platforms. X86 is a unified quantization backend combining goodness of fbgemm and onednn. For more details please see #83888 **Test plan** python test/test_quantization.py Pull Request resolved: #91235 Approved by: https://github.com/jgong5, https://github.com/XiaobingSuper, https://github.com/malfet
1 parent 5766764 commit e1bcbbf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

aten/src/ATen/Context.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,12 @@ at::QEngine Context::qEngine() const {
302302

303303
#ifdef USE_FBGEMM
304304
if (fbgemm::fbgemmSupportedCPU()) {
305-
qengine = at::kFBGEMM;
305+
/* X86 is enabled if and only if fbgemm is available.
306+
* It combines goodness of fbgemm and onednn by dispatching.
307+
* If onednn not available, always dispatch to fbgemm.
308+
* Make it default qengine for X86 CPU platforms.
309+
*/
310+
qengine = at::kX86;
306311
}
307312
#endif
308313
return qengine;

0 commit comments

Comments
 (0)