Skip to content

Conversation

@philip-paul-mueller
Copy link
Contributor

@philip-paul-mueller philip-paul-mueller commented Nov 10, 2025

Makes gt_split_access_nodes() deterministic by processing it in the order of AccessNodes.
However, this means that the name of the data must be predictable and stable.


ToDo

@philip-paul-mueller
Copy link
Contributor Author

Performance seems to be okay:

bench_blueline_stencil_compute

@philip-paul-mueller philip-paul-mueller marked this pull request as ready for review November 11, 2025 12:02
Copy link
Contributor

@edopao edopao left a 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
Copy link
Contributor

@edopao edopao Jan 15, 2026

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))
Copy link
Contributor

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.

Comment on lines +343 to +348
# 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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Comment on lines +382 to +383
# Allocate the return `dict` the order is important, first the reordered split
# description followed by the `None` key.
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants