You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TBB backend not working on Win due to wrong dll name #7600
I have included a self contained code sample to reproduce the problem.
i.e. it's possible to run as 'python bug.py'.
Hi,
It seems that compiling with NUMBA_THREADING_LAYER=tbb doesn't work on windows at all. The attempt to load the dll is done in _check_tbb_version_compatible but it fails since on Windows it's named: "tbb12.dll" now:
import numpy as np
from numba import njit, prange
@njit(parallel=True)
def test_impl(arr):
return arr.sum()
data = np.arange(1000)
print(test_impl(data))
Now it fails with:
numba.core.errors.LoweringError: Failed in nopython mode pipeline (step: native lowering)
No threading layer could be loaded.
HINT:
Intel TBB is required, try:
$ conda/pip install tbb
File "numba\parfors\parfor.py", line 256:
def sum_1(in_arr):
val = zero
for i in numba.parfors.parfor.internal_prange(len(in_arr)):
^
During: lowering "id=0[LoopNest(index_variable = parfor_index.33, range = (0, arr_size0.32, 1))]{42: <ir.Block at C:\Users\akozlov\AppData\Local\Continuum\anaconda3\numba_master\numba\numba\parfors\parfor.py (256)>}Var(parfor_index.33, parfor.py:256)" at C:\Users\akozlov\AppData\Local\Continuum\anaconda3\numba_master\numba\numba\parfors\parfor.py (256)
The following patch should fix this (also changes lib name on MacOS, as tbb package on conda-forge suggests this name was also incorrect):
diff --git a/numba/np/ufunc/parallel.py b/numba/np/ufunc/parallel.py
index 5d85bca9f..9c744fa83 100644
--- a/numba/np/ufunc/parallel.py+++ b/numba/np/ufunc/parallel.py@@ -344,9 +344,9 @@ def _check_tbb_version_compatible():
try:
# first check that the TBB version is new enough
if _IS_WINDOWS:
- libtbb_name = 'tbb'+ libtbb_name = 'tbb12.dll'
elif _IS_OSX:
- libtbb_name = 'libtbb.dylib'+ libtbb_name = 'libtbb.12.dylib'
elif _IS_LINUX:
libtbb_name = 'libtbb.so.12'
else:
On OSX the tbbpool.<version stuff>.so linkage looks ok, it's @rpath/libtbb.12.dylib, which suggests the issue is indeed in the version compatibility check. The command numba -s reports TBB support based on whether it can load the tbbpool.<>.so DSO, and in this case it can, but the check is failing at runtime. I think the version compatibility check might also need to go into the numba -s command for consistency.
Activity
stuartarchibald commentedon Nov 29, 2021
Thanks for the report. I can reproduce on OSX with:
stuartarchibald commentedon Nov 29, 2021
On OSX the
tbbpool.<version stuff>.solinkage looks ok, it's@rpath/libtbb.12.dylib, which suggests the issue is indeed in the version compatibility check. The commandnumba -sreports TBB support based on whether it can load thetbbpool.<>.soDSO, and in this case it can, but the check is failing at runtime. I think the version compatibility check might also need to go into thenumba -scommand for consistency.gmarkall commentedon Nov 29, 2021
I can reproduce on Windows, also just using Stuart's environment setup:
Changing
libtbb_nametotbb12.dlldoes work around the issue for me.Fix TBB 2021 DSO names on OSX/Win and make TBB state reporting consis…
Fix TBB 2021 DSO names on OSX/Win and make TBB reporting consistent
stuartarchibald commentedon Nov 29, 2021
Thanks for confirming @gmarkall.