-
Notifications
You must be signed in to change notification settings - Fork 54
feat[dace][next]: Deterministic gt_split_access_nodes()
#2383
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
base: main
Are you sure you want to change the base?
feat[dace][next]: Deterministic gt_split_access_nodes()
#2383
Conversation
edopao
left a comment
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, only some minor comments/questions.
| ) | ||
|
|
||
| # Since the transformation only applies to single use data, the order in which the | ||
| # states are processed is irrelevant. Furthermore, the fragments generated through |
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.
"Furthermore, the fragments generated..." I don't see how this is relevant. Are you considering the case in which gt_split_access_nodes() is called multiple times?
| # NOTE: Turning them into a string is the best solution is probably the only way | ||
| # to achieve some stability. The only downside is that the order now depends | ||
| # on the specialization level that is used, i.e. to we have numbers or symbols. | ||
| split_description = sorted(split_description, key=lambda split: str(split)) |
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.
split_description is a Sequence, so it is already sorted. As alternative, we could ensure the deterministic order in the place where the sequence is created.
| # Bring the split description in a deterministic order. | ||
| # NOTE: See note in `split_node()` why the sorting is done in this way. | ||
| # NOTE: The main benefit of bringing `split_description` into a deterministic | ||
| # order is that the output of this function is deterministic as well. I am | ||
| # not sure if there is any benefit beside that. | ||
| split_description = sorted(split_description, key=lambda split: str(split)) |
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.
Same
| # Allocate the return `dict` the order is important, first the reordered split | ||
| # description followed by the `None` key. |
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.
Can you also explain why it is important?

Makes
gt_split_access_nodes()deterministic by processing it in the order ofAccessNodes.However, this means that the name of the data must be predictable and stable.
ToDo
gt_auto_optimization()gt_split_access_nodes(). C2SM/icon4py#937