Conflicting OMP implementations linked when building with MKLDNN #126211
Labels
module: build
Build system issues
module: mkldnn
Related to Intel IDEEP or oneDNN (a.k.a. mkldnn) integration
module: openmp
Related to OpenMP (omp) support in PyTorch
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
🐛 Describe the bug
Custom builds with MKLDNN can link to both libomp and libgomp, which could cause invalid or slow behavior if some symbols are missing from one.
This happens because the MKLDNN extension always builds with libgomp, whereas pytorch by default prefers libomp.
Assuming libomp is present on the system, this can be replicated via a custom build with
Producing things like this:
I suspect the fix here would be to always use libgomp in FindOpenMP.cmake when USE_MKLDNN is true, but perhaps there's a way to make MKLDNN use whatever OMP we've discovered?
Versions
I think this has been the case for a while.
cc @malfet @seemethere @gujinghui @PenghuiCheng @XiaobingSuper @jianyuh @jgong5 @mingfeima @sanchitintel @ashokei @jingxu10 @min-jean-cho @yanbing-j @Guobing-Chen @Xia-Weiwen @snadampal
The text was updated successfully, but these errors were encountered: