Skip to content

Pin TBB support with respect to incompatible 2021.6 API. - #8109

Merged
sklam merged 1 commit into
numba:mainfrom
stuartarchibald:wip/restrict_tbb_lt_2021_6
May 26, 2022
Merged

sklam merged 1 commit into
numba:mainfrom
stuartarchibald:wip/restrict_tbb_lt_2021_6

Conversation

@stuartarchibald

Copy link
Copy Markdown
Contributor

As title. Numba is not yet compatible with TBB 2021.6 API, but the
ABI seems ok.

@stuartarchibald
stuartarchibald marked this pull request as ready for review May 25, 2022 08:26
@stuartarchibald
stuartarchibald requested review from esc and sklam as code owners May 25, 2022 08:26
@stuartarchibald stuartarchibald added this to the Numba 0.56 RC milestone May 25, 2022
As title. Numba is not yet compatible with TBB 2021.6 API, but the
ABI seems ok.
@stuartarchibald
stuartarchibald force-pushed the wip/restrict_tbb_lt_2021_6 branch from 4fadc68 to ef555a6 Compare May 25, 2022 09:40

@esc esc left a comment

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.

I reviewed this by visually inspecting the version numbers and documentation upgrades. I also tried to build Numba in a conda environment with pip installed tbb==2021.6.0 and tbb-devel=2021.6.0 and watched the compilation fail.

numba/np/ufunc/tbbpool.cpp:31:2: error: #error "TBB version is incompatible, 2021.1 through to 2021.5 required, i.e. 12010 <= TBB_INTERFACE_VERSION < 12060"
   31 | #error "TBB version is incompatible, 2021.1 through to 2021.5 required, i.e. 12010 <= TBB_INTERFACE_VERSION < 12060"
      |  ^~~~~
numba/np/ufunc/tbbpool.cpp: In function 'void prepare_fork()':
numba/np/ufunc/tbbpool.cpp:229:52: error: no matching function for call to 'tbb::detail::d1::task_scheduler_handle::release(tbb::detail::d1::task_scheduler_handle&)'
  229 |                 tbb::task_scheduler_handle::release(tsh);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from /home/ci/miniconda3/envs/test-tbb-too-new/include/oneapi/tbb.h:50,
                 from /home/ci/miniconda3/envs/test-tbb-too-new/include/tbb/tbb.h:17,
                 from numba/np/ufunc/tbbpool.cpp:15:
/home/ci/miniconda3/envs/test-tbb-too-new/include/oneapi/tbb/global_control.h:145:10: note: candidate: 'void tbb::detail::d1::task_scheduler_handle::release()'
  145 |     void release() {
      |          ^~~~~~~
/home/ci/miniconda3/envs/test-tbb-too-new/include/oneapi/tbb/global_control.h:145:10: note:   candidate expects 0 arguments, 1 provided
numba/np/ufunc/tbbpool.cpp: In function 'void reset_after_fork()':
numba/np/ufunc/tbbpool.cpp:254:43: error: 'get' is not a member of 'tbb::detail::d1::task_scheduler_handle'
  254 |         tsh = tbb::task_scheduler_handle::get();
      |                                           ^~~
numba/np/ufunc/tbbpool.cpp: In function 'void launch_threads(int)':
numba/np/ufunc/tbbpool.cpp:292:39: error: 'get' is not a member of 'tbb::detail::d1::task_scheduler_handle'
  292 |     tsh = tbb::task_scheduler_handle::get();

Patch looks good.

@esc esc added 5 - Ready to merge Review and testing done, is ready to merge and removed 3 - Ready for Review labels May 25, 2022

@gmarkall gmarkall left a comment

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.

Just to confirm what was said OOB, the preprocessor version check on TBB_INTERFACE_VERSION appears to correctly constrain the set of acceptable versions. For example, I get:

$ g++ -E -DTBB_INTERFACE_VERSION=12060 version.cpp 
# 0 "version.cpp"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "version.cpp"
version.cpp:4:2: error: #error "TBB version is incompatible, 2021.1 through to 2021.5 required, i.e. 12010 <= TBB_INTERFACE_VERSION < 12060"
    4 | #error "TBB version is incompatible, 2021.1 through to 2021.5 required, i.e. 12010 <= TBB_INTERFACE_VERSION < 12060"
      |  ^~~~~

1 gmarkall@blixen 09:39:29 (main) ~/numbadev/issues/8109
$ g++ -E -DTBB_INTERFACE_VERSION=12059 version.cpp 
# 0 "version.cpp"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "version.cpp"

0 gmarkall@blixen 09:39:35 (main) ~/numbadev/issues/8109
$ g++ -E -DTBB_INTERFACE_VERSION=12010 version.cpp 
# 0 "version.cpp"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "version.cpp"

0 gmarkall@blixen 09:39:40 (main) ~/numbadev/issues/8109
$ g++ -E -DTBB_INTERFACE_VERSION=12009 version.cpp 
# 0 "version.cpp"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "version.cpp"
version.cpp:4:2: error: #error "TBB version is incompatible, 2021.1 through to 2021.5 required, i.e. 12010 <= TBB_INTERFACE_VERSION < 12060"
    4 | #error "TBB version is incompatible, 2021.1 through to 2021.5 required, i.e. 12010 <= TBB_INTERFACE_VERSION < 12060"
      |  ^~~~~

where version.cpp is:

#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"
#endif

@stuartarchibald

Copy link
Copy Markdown
Contributor Author

Thanks for checking this @esc and @gmarkall, much appreciated.

stuartarchibald added a commit to stuartarchibald/numba that referenced this pull request May 25, 2022
….6 API.

As title. Numba is not yet compatible with TBB 2021.6 API, but the
ABI seems ok.

Conflicts:
	buildscripts/condarecipe.local/meta.yaml
	docs/source/user/installing.rst
stuartarchibald added a commit to stuartarchibald/numba that referenced this pull request May 25, 2022
….6 API.

As title. Numba is not yet compatible with TBB 2021.6 API, but the
ABI seems ok.
esc added a commit to sklam/numba that referenced this pull request May 25, 2022
… into misc/backport0.55_combine

* numba/pull/8103:
  also remove run_constrained for NumPy
  Backport numba#8102: Combine numpy run_constrained in meta.yaml to the run requirements

* numba/pull/8114:
  Backport numba#8109 Pin TBB support with respect to incompatible 2021.6 API.
esc added a commit that referenced this pull request May 25, 2022
Backport #8109 Pin TBB support with respect to incompatible 2021.6 API.
@sklam
sklam merged commit 290a693 into numba:main May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to merge Review and testing done, is ready to merge Effort - short Short size effort needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants