-
Notifications
You must be signed in to change notification settings - Fork 1.1k
R2 RFC for task_group dynamic dependencies #1664
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
R2 RFC for task_group dynamic dependencies #1664
Conversation
Co-authored-by: Aleksei Fedotov <aleksei.fedotov@intel.com>
Co-authored-by: Aleksei Fedotov <aleksei.fedotov@intel.com>
Co-authored-by: Aleksei Fedotov <aleksei.fedotov@intel.com>
Co-authored-by: Aleksei Fedotov <aleksei.fedotov@intel.com>
Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
Co-authored-by: Alexandra <alexandra.epanchinzeva@intel.com>
Co-authored-by: Alexey Kukanov <alexey.kukanov@intel.com> Co-authored-by: Konstantin Boyarinov <konstantin.boyarinov@intel.com>
* Remove concrete proposals from the RFC * Apply review comments
…k_group_dynamic_dependencies
// Number of elements in the grid on each level of division | ||
// On the first level - 4 subtasks total (2 on each dimension) | ||
// on the second level - 16 subtasks total (4 on each dimension), etc. | ||
std::size_t n_grid = (2 << n_division); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems from the description, depending on the value of n_division
, which I assume could be any value from a natural number set, the n_grid
variable should been having values equal to the power of two, i.e. 2, 4, 8, 16, 32, etc. However, the description says they are 4, 16, 64, 256, and so on.
So what are the values that n_grid
variable can store?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
n_grid
stores the number of elements in each dimension of the grid on the particular level of division.
So, the previous version of the implementation is not correct:) Thanks for catching that!
During the first division, we have 2x2 grid of subtasks (n_grid
= 2). On the second - 4x4 (n_grid
= 4).
I have rewritten this part and corrected the comment
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
Alternative approach is to keep tracking ``current`` and ``target`` together after transferring. This requires introducing a special state | ||
of ``task_tracker` - a kind of `proxy` state. If the executing task calls `transfer_successors_to` from the body, all trackers, initially created | ||
to track this task are changing the state to `proxy`. | ||
Tracker to the ``current`` and ``target`` are sharing the single merged list of successors if ``current`` tracker is in `proxy` state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my point of view, introducing another entity for essentially the same thing from the user-perspective complicates the design. The user will need to keep them separate in mind and remember what they are good for and what they are not.
As far as I understand, implementation-wise task_tracker
represents this kind of shared-ownership, as it still needs to have a pointer to representation of at least the task state and the list of successors shared among task_tracker
instances pointing to the same task. In this sense, it differs from the task_handle
only in impossibility to be submitted for execution.
To avoid possible confusion about acting on moved task_handle
, can we just deprecate the move semantics and add only lvalue signatures? After all, the same function object can be submitted several times into task_group
.
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
…cs.md Co-authored-by: Alexey Kukanov <alexey.kukanov@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the detailed proposal now looks good to me.
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Found a couple of possible discrepancies due to recent renamings.
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
rfcs/proposed/task_group_dynamic_dependencies/extended_semantics.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Aleksei Fedotov <aleksei.fedotov@intel.com>
ce61e41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
That said, I think there should be a link to the sub-RFC from the main RFC. README.md is automatically previewed in github and so it may be easy to overlook the extended_semantics.md if a link does not appear in README.md. I'd suggest putting it immediately before the Open Questions section.
Thanks for catching that. Applied. I think we will need to think on how to merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more approve to be able to merge the PR.
Description
Add RFC describing the semantics for concrete task_group dynamic dependencies APIs
Fixes # - issue number(s) if exists
Type of change
Choose one or multiple, leave empty if none of the other choices apply
Add a respective label(s) to PR if you have permissions
Tests
Documentation
Breaks backward compatibility
Notify the following users
List users with
@
to send notificationsOther information