taskflow / taskflow

A General-purpose Task-parallel Programming System using Modern C++
https://taskflow.github.io
Other
10.23k stars 1.21k forks source link

Adaptive Heterogenous Task Scheduling #161

Closed robinchrist closed 4 years ago

robinchrist commented 4 years ago

I'm currently adding a GPU / Accelerator backend to one of my projects and I'm facing the following problem:

I basically need to schedule between different backends, i.e. a task (with dependencies) could be picked up by a GPU backend, or the CPU backend. Additionally, I'd like to make the CPU backend NUMA aware... I basically need some kind of hybrid micro-macro scheduling.

I'm not sure whether taskflow is the right tool for that. Do you have any hints for me, possibly to other projects?

tsung-wei-huang commented 4 years ago

Hi, our adaptiveness is defined for adapting worker threads to available task parallelism so as to avoid underutilized and oversubscribed threads. In fact, we do find very good performance on hybrid CPU-GPU tasking if your task granularity is coarse. You may read real use cases about some details.

Currently, we do not handle NUMA, but let the OS automatically decide which task to migrate to which CPU. The reason is many of our applications are compute-intensive and scheduling of tasks and workers have much more impact on performance than NUMA. However, it all depends on your applications. If you have data-intensive computing where NUMA locality is important, you may try something else like StarPU.

robinchrist commented 4 years ago

StarPU looks very promising, thanks a lot for the hint!