Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions buildscripts/condarecipe.local/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ build:
- lib/libiomp5.dylib # [osx]
ignore_run_exports:
# tbb-devel triggers hard dependency on tbb, this is not the case.
- tbb # [not aarch64]
- tbb # [not (aarch64 or ppc64le or win32)]

requirements:
# build and run dependencies are duplicated to avoid setuptools issues
Expand All @@ -36,11 +36,9 @@ requirements:
# On channel https://anaconda.org/numba/
- llvmlite >=0.40.0dev0,<0.40
# TBB devel version is to match TBB libs.
# 2020.3 is the last version with the "old" ABI
# NOTE: 2021.1..2021.5 are API compatible for Numba's purposes.
# NOTE: ppc64le exclusion is temporary until packages are more generally
# available.
- tbb-devel >=2021,<2021.6 # [not (aarch64 or ppc64le)]
# NOTE: ppc64le and aarch64 are pending testing so excluded for now, win32
# is not a supported parallel target.
- tbb-devel >=2021.6 # [not (aarch64 or ppc64le or win32)]
run:
- python >=3.8
# NumPy 1.22.0, 1.22.1, 1.22.2 are all broken for ufuncs, see #7756
Expand All @@ -49,8 +47,8 @@ requirements:
# On channel https://anaconda.org/numba/
- llvmlite >=0.40.0dev0,<0.40
run_constrained:
# If TBB is present it must be at least version 2021
- tbb >=2021 # [not (aarch64 or ppc64le)]
# If TBB is present it must be at least version 2021.6
- tbb >=2021.6 # [not (aarch64 or ppc64le or win32)]
# avoid confusion from openblas bugs
- libopenblas !=0.3.6 # [x86_64]
# 0.3.17 buggy on M1 silicon
Expand All @@ -75,7 +73,7 @@ test:
- ipython # [not aarch64]
# for pycc
- setuptools
- tbb >=2021 # [not (aarch64 or ppc64le)]
- tbb >=2021.6 # [not (aarch64 or ppc64le or win32)]
- llvm-openmp # [osx]
# This is for driving gdb tests
- pexpect # [linux64]
Expand Down
5 changes: 5 additions & 0 deletions buildscripts/condarecipe.local/run_test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ set NUMBA_DISABLE_ERROR_MESSAGE_HIGHLIGHTING=1
set NUMBA_CAPTURED_ERRORS=new_style
set PYTHONFAULTHANDLER=1

@rem no parallel target support for 32 bit windows and no TBB packages
if "%ARCH%"=="32" (
set NUMBA_DISABLE_TBB=1
)

@rem Check Numba executable is there
numba -h

Expand Down
2 changes: 1 addition & 1 deletion buildscripts/incremental/setup_conda_environment.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if "%BUILD_DOC%" == "yes" (%CONDA_INSTALL% sphinx sphinx_rtd_theme pygments)
@rem Install dependencies for code coverage (codecov.io)
if "%RUN_COVERAGE%" == "yes" (%PIP_INSTALL% codecov)
@rem Install TBB
%CONDA_INSTALL% -c numba tbb=2021 "tbb-devel>=2021,<2021.6"
%CONDA_INSTALL% "tbb>=2021.6" "tbb-devel>=2021.6"
if %errorlevel% neq 0 exit /b %errorlevel%

echo "DEBUG ENV:"
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/incremental/setup_conda_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if [ "$RUN_COVERAGE" == "yes" ]; then $PIP_INSTALL codecov; fi
# Install SVML
if [ "$TEST_SVML" == "yes" ]; then $CONDA_INSTALL -c numba icc_rt; fi
# Install Intel TBB parallel backend
if [ "$TEST_THREADING" == "tbb" ]; then $CONDA_INSTALL -c numba tbb=2021 "tbb-devel>=2021,<2021.6"; fi
if [ "$TEST_THREADING" == "tbb" ]; then $CONDA_INSTALL "tbb>=2021.6" "tbb-devel>=2021.6"; fi
# Install typeguard
if [ "$RUN_TYPEGUARD" == "yes" ]; then $CONDA_INSTALL "conda-forge::typeguard==3.0.1"; fi

Expand Down
4 changes: 2 additions & 2 deletions docs/source/user/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ vary with target operating system and hardware. The following lists them all
* ``llvm-openmp`` (OSX) - provides headers for compiling OpenMP support into
Numba's threading backend
* ``tbb-devel`` - provides TBB headers/libraries for compiling TBB support
into Numba's threading backend (2021 <= version < 2021.6 required).
into Numba's threading backend (version >= 2021.6 required).
* ``importlib_metadata`` (for Python versions < 3.9)

* Optional runtime are:
Expand Down Expand Up @@ -261,7 +261,7 @@ information.
+----------++--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+
| Numba | Release date | Python | NumPy | llvmlite | LLVM | TBB |
+===========+==============+===========================+============================+==============================+===================+=============================+
| 0.57.0 | TBC | 3.8.x <= version < 3.12 | 1.21 <= version < 1.25 | 0.40.x | 14.x | 2021.x |
| 0.57.0 | TBC | 3.8.x <= version < 3.12 | 1.21 <= version < 1.25 | 0.40.x | 14.x | 2021.6 <= version |
+-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+
| 0.56.4 | 2022-11-03 | 3.7.x <= version < 3.11 | 1.18 <= version < 1.24 | 0.39.x | 11.x | 2021.x |
+-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+
Expand Down
6 changes: 3 additions & 3 deletions numba/np/ufunc/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,10 @@ def _check_tbb_version_compatible():
version_func.argtypes = []
version_func.restype = c_int
tbb_iface_ver = version_func()
if tbb_iface_ver < 12010: # magic number from TBB
if tbb_iface_ver < 12060: # magic number from TBB
msg = ("The TBB threading layer requires TBB "
"version 2021 update 1 or later i.e., "
"TBB_INTERFACE_VERSION >= 12010. Found "
"version 2021 update 6 or later i.e., "
"TBB_INTERFACE_VERSION >= 12060. Found "
"TBB_INTERFACE_VERSION = %s. The TBB "
"threading layer is disabled.") % tbb_iface_ver
problem = errors.NumbaWarning(msg)
Expand Down
19 changes: 7 additions & 12 deletions numba/np/ufunc/tbbpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Implement parallel vectorize workqueue on top of Intel TBB.
#undef _XOPEN_SOURCE
#endif

#include <tbb/version.h>
#include <tbb/tbb.h>
#include <string.h>
#include <stdio.h>
Expand All @@ -20,15 +21,9 @@ Implement parallel vectorize workqueue on top of Intel TBB.

#include "gufunc_scheduler.h"

/* TBB 2019 U5 is the minimum required version as this is needed:
* https://github.com/intel/tbb/blob/18070344d755ece04d169e6cc40775cae9288cee/CHANGES#L133-L134
* and therefore
* https://github.com/intel/tbb/blob/18070344d755ece04d169e6cc40775cae9288cee/CHANGES#L128-L129
* from here:
* https://github.com/intel/tbb/blob/2019_U5/include/tbb/tbb_stddef.h#L29
*/
#if (TBB_INTERFACE_VERSION >= 12060) || (TBB_INTERFACE_VERSION < 12010)
#error "TBB version is incompatible, 2021.1 through to 2021.5 required, i.e. 12010 <= TBB_INTERFACE_VERSION < 12060"
/* TBB 2021.6 is the minimum version */
#if (TBB_INTERFACE_VERSION < 12060)
#error "TBB version is incompatible, 2021.6 or greater required, i.e. TBB_INTERFACE_VERSION >= 12060"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

manually confirmed that this check works as expected.

#endif

#define _DEBUG 0
Expand Down Expand Up @@ -235,7 +230,7 @@ static void prepare_fork(void)
{
if (!tbb::finalize(tsh, std::nothrow))
{
tbb::task_scheduler_handle::release(tsh);
tsh.release();
puts("Unable to join threads to shut down before fork(). "
"This can break multithreading in child processes.\n");
}
Expand All @@ -260,7 +255,7 @@ static void reset_after_fork(void)

if(need_reinit_after_fork)
{
tsh = tbb::task_scheduler_handle::get();
tsh = tbb::attach();
set_main_thread();
tsh_was_initialized = true;
need_reinit_after_fork = false;
Expand Down Expand Up @@ -298,7 +293,7 @@ static void launch_threads(int count)
if(count < 1)
count = tbb::task_arena::automatic;

tsh = tbb::task_scheduler_handle::get();
tsh = tbb::attach();
tsh_was_initialized = true;

tg = new tbb::task_group;
Expand Down