daphne-eu / daphne

DAPHNE: An Open and Extensible System Infrastructure for Integrated Data Analysis Pipelines
Apache License 2.0
68 stars 62 forks source link

Basic parfor-loop support in DaphneDSL #515

Open pdamme opened 1 year ago

pdamme commented 1 year ago

Motivation: So far, DAPHNE only supports data-level parallelism by executing the same operations on different chunks of the input data. This is implemented in DAPHNE’s vectorized engine. However, task-level parallelism would be a viable alternative in certain cases. For instance, if the iterations of a for-loop do not depend on each other, they could be executed in parallel.

Task: This project is to introduce basic support for parfor-loops in DAPHNE. DaphneDSL should offer a parfor-statement (which could optionally accept additional parameters for the task-level parallelism). The DAPHNE compiler should analyze these parfor-loops to detect if there are dependencies between the iterations, and potentially to compile/optimize the code for different iterations individually. Finally, the DAPHNE runtime should be able to execute multiple different iterations of the loop in parallel. Implementation in C++.

Hints:

philipportner commented 1 month ago

In case one wants to also look into this for generated code, the SCF dialect has scf.parallel.