-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage of deprecated and removed tbb::task_scheduler_init and task API (Intel oneTBB) #72
Comments
Thanks for the heads up ... that's a very unpleasant surprise. This is a serious issue because controlling the # of threads is a feature that I require to satisfy the needs of MATLAB. SPQR must follow the # of threads set by the MATLAB maxNumCompThreads (see https://www.mathworks.com/help/matlab/ref/maxnumcompthreads.html). TBB seems to be disallowing any control over the # of threads used. This function is used in x=A\b inside MATLAB, and this deprecation breaks it. Intel's recommendation is an overstatement. I need to limit the task schedule in ways that no task scheduler inside TBB can predict, unless it can somehow glean the maxNumCompThreads itself from MATLAB. I'm happy to let TBB create its own tasks and threads but I have to have control over an upper bound on the number of threads it is permitted to use. It would be free to use any number of threads it likes, between 1 and my provided upper bound. But TBB has no mechanism for this. At least none that I can find. With this deprecation and removal of task_schedule_init, TBB has become unusable to me. There seems to be no workaround. I will see about transitioning SuiteSparseQR to OpenMP tasking, and dropping the use of TBB entirely. I only use TBB within this single file, to execute a simple task tree. It shouldn't be too hard to switch to OpenMP tasks instead. If there's a method for providing a max upper bound on the # of threads TBB is permitted to use, can you point it out to me? |
You'll note in my code that default is to let TBB pick the # of threads to use. It's in the non-default case that I require control. |
|
global_control would be fine in MATLAB, since it's an application, but not inside a library like SPQR. Intel doesn't recommend global_control inside a library. I need to control the # of threads used when I combine my parallel library with the parallel BLAS. For that, I need specific control, such as mkl_set_num_threads_local ( https://software.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/support-functions/threading-control/mkl-set-num-threads-local.html ). global_control would be a sledge hammer, compared to a finer control like that function. So I don't think I can use global_control. |
Maybe you can use task_arena? |
It's not safe to switch to another feature of TBB. This is not a minor change to TBB. I was using a core part of TBB, and now all features I was using in TBB are entirely gone. If Intel is willing to deprecate x=A\b in MATLAB, there's no guarantee task_arena will be around in 10 years either. The solution is to switch to OpenMP tasking instead, and jettison all uses of TBB. |
SuiteSparse is not compatible with the latest version of TBB. See DrTimothyAldenDavis/SuiteSparse#72. We didn't encounter any problems in CI about this because the build just carried on as if TBB were not installed. We can use `tbb@2020`, but this causes issues for dependents that currently depend on `tbb`. Since the formula isn't using the `tbb` dependency currently, and upstream plans to drop it at some point, let's just remove the dependency.
SuiteSparse is not compatible with the latest version of TBB. See DrTimothyAldenDavis/SuiteSparse#72. We didn't encounter any problems in CI about this because the build just carried on as if TBB were not installed. We can use `tbb@2020`, but this causes issues for dependents that currently depend on `tbb`. Since the formula isn't using the `tbb` dependency currently, and upstream plans to drop it at some point, let's just remove the dependency. Closes #87485. Signed-off-by: Sean Molenaar <1484494+SMillerDev@users.noreply.github.com> Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
git-svn-id: file:///srv/repos/svn-packages/svn@428978 eb2447ed-0c53-47e4-bac8-5bc4a241df78
git-svn-id: file:///srv/repos/svn-packages/svn@428978 eb2447ed-0c53-47e4-bac8-5bc4a241df78
See DrTimothyAldenDavis/SuiteSparse#72 suite-sparse depends on task_schedule_init to control the number of threads when e.g. interfacing with MATLAB. However, Intel dropped task_schedule_init in the 2021.x releases of TBB (it has been deprecated since TBB 4.3.5). We just raise a spack conflict when using tbb @2021.x and +tbb Because tbb is a virtual package and is not versioned, I have instead checked for either intel-oneapi-tbb@2021: or intel-tbb@2021:, not the most elegant but should do the job
* suite-sparse: Fix check for +/- tbb variant Changed 'tbb' in spec to '+tbb' in spec The former would configure suite-sparse to use tbb if any dependency package (e.g. intel-oneapi-mkl) depends on tbb, even if suite-sparse~tbb was specified. * suite-sparse: conflict when trying to use 2021.x versions of tbb See DrTimothyAldenDavis/SuiteSparse#72 suite-sparse depends on task_schedule_init to control the number of threads when e.g. interfacing with MATLAB. However, Intel dropped task_schedule_init in the 2021.x releases of TBB (it has been deprecated since TBB 4.3.5). We just raise a spack conflict when using tbb @2021.x and +tbb Because tbb is a virtual package and is not versioned, I have instead checked for either intel-oneapi-tbb@2021: or intel-tbb@2021:, not the most elegant but should do the job * suite-sparse: fix style issues
@DrTimothyAldenDavis it was 15 years from first version of TBB till the revamp (oneTBB, which removed |
Fixed in the draft SuiteSparse v5.11.0 (TBB is removed). |
tbb::task_scheduler_init
has been deprecated since Intel TBB 4.3 Update 5 and in the new Intel oneTBB 2021.x releases it is finally completely gone.According to documentation,
and Intel does not recommend specifying the number of threads anywhere:
Please remove the usage of
tbb::task_scheduler_init
and thetbb/task_scheduler_init.h
header, or at least detect their existence in the build system if you want to preserve the behavior with older TBB versions.SuiteSparse/SPQR/Source/spqr_parallel.cpp
Lines 91 to 92 in 1869379
Actually the whole
tbb::task
API is gone. task_group is suggested as a replacement.The text was updated successfully, but these errors were encountered: