-
Notifications
You must be signed in to change notification settings - Fork 257
compiler: Revamp fuse-task optoption #2975
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
Open
FabioLuporini
wants to merge
9
commits into
main
Choose a base branch
from
fuse-tasks-groups
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
edeb989
compiler: Generalize fuse-tasks grouping
FabioLuporini c4631a5
compiler: Replace fuse-tasks with npthreads
FabioLuporini 8ad3d2a
compiler: Polish buffering
FabioLuporini 26b03bc
compiler: Restructure SyncSpot
FabioLuporini 9b38f49
compiler: Refactor fuse-tasks lowering
FabioLuporini 7fe79ff
compiler: Simplify npthreads lowering
FabioLuporini a5a6e1f
compiler: Simplify task group collection
FabioLuporini cae7e6a
compiler: Support unguarded task groups
FabioLuporini 3afe7c7
compiler: Unify task group lowering
FabioLuporini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,11 +26,42 @@ | |
|
|
||
| class SyncOp(Pickable): | ||
|
|
||
| """ | ||
| Metadata for a synchronization operation attached to a `Cluster` or `SyncSpot`. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| handle : object | ||
| The symbolic object identifying or controlling the operation, such as | ||
| an entry in a `Lock`. May be None when no handle is required. | ||
| target : AbstractFunction | ||
| The `Function` whose access is synchronized. For buffered data movements, | ||
| this is the compiler-generated buffer. | ||
| tindex : Expr, optional | ||
| The index into `target` involved in the operation. | ||
| function : AbstractFunction, optional | ||
| The original `Function` represented by a compiler-generated `target`. It | ||
| is the source of a `SyncCopyIn` and the destination of a `SyncCopyOut`. | ||
| findex : Expr, optional | ||
| The index into `function` corresponding to `tindex`. | ||
| dim : Dimension, optional | ||
| The `Dimension` along which `tindex` and `findex` are defined. | ||
| size : int, optional | ||
| The extent associated with the operation along `dim`. Defaults to 1. | ||
| origin : Indexed, optional | ||
| The original `Indexed` access from which the operation was derived. | ||
| gid : Stamp, optional | ||
| The `Stamp` identifying the asynchronous task group to which the operation | ||
| belongs. | ||
| """ | ||
|
|
||
| __rargs__ = ('handle', 'target') | ||
| __rkwargs__ = ('tindex', 'function', 'findex', 'dim', 'size', 'origin') | ||
| __rkwargs__ = ( | ||
| 'tindex', 'function', 'findex', 'dim', 'size', 'origin', 'gid' | ||
| ) | ||
|
|
||
| def __init__(self, handle, target, tindex=None, function=None, findex=None, | ||
| dim=None, size=1, origin=None): | ||
| dim=None, size=1, origin=None, gid=None): | ||
| self.handle = handle | ||
| self.target = target | ||
|
|
||
|
|
@@ -40,6 +71,7 @@ def __init__(self, handle, target, tindex=None, function=None, findex=None, | |
| self.dim = dim | ||
| self.size = size | ||
| self.origin = origin | ||
| self.gid = gid | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. adding a docstring, but basically group id (a la Linux) |
||
|
|
||
| def __eq__(self, other): | ||
| return (type(self) is type(other) and | ||
|
|
@@ -50,11 +82,13 @@ def __eq__(self, other): | |
| self.findex == other.findex and | ||
| self.dim is other.dim and | ||
| self.size == other.size and | ||
| self.origin == other.origin) | ||
| self.origin == other.origin and | ||
| self.gid == other.gid) | ||
|
|
||
| def __hash__(self): | ||
| return hash((self.__class__, self.handle, self.target, self.tindex, | ||
| self.function, self.findex, self.dim, self.size, self.origin)) | ||
| self.function, self.findex, self.dim, self.size, self.origin, | ||
| self.gid)) | ||
|
|
||
| def __repr__(self): | ||
| return f"{self.__class__.__name__}<{self.handle.name}>" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nitpicking: might wanna throw a warning, or
oo.pop('npthreads', oo.pop('fuse-tasks', None)for "safety"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.
OK
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.
Is there any documentation that needs updating to reflect this change?
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.
yes