Skip to content
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

#sdy #debug support debugging tool to save the edge source shardings. #310

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

copybara-service[bot]
Copy link

#sdy #debug support debugging tool to save the edge source shardings.

This works by having each Operation* save a source/target edge, which is always composed of at least one operand. This is because results can be used several times, but an operand only ever has one defining op. So these edges always look "backwards" - never forwards towards a use of a result.

As such, the FuncOp args don't contain edge source information: only the ops that use them.

Similarly, since only the uses save the edge, for FuncOp results which have been updated, we save the edges in each result's resultAttr. If the function has multiple results, then each edge_source on the func result attributes will have index 0. This is because of how propagation works with running propagation on each returned result. Having them have the right index would make sense if the sdy.edge_sources were saved as a top level attribute on the func, but since one is saved per result, then an index of 0 makes most sense.

This works by having each `Operation*` save a source/target edge, which is always composed of at least one operand. This is because results can be used several times, but an operand only ever has one defining op. So these edges always look "backwards" - never forwards towards a use of a result.

As such, the `FuncOp` args don't contain edge source information: only the ops that use them.

Similarly, since only the uses save the edge, for `FuncOp` results which have been updated, we save the edges in each result's `resultAttr`. If the function has multiple results, then each `edge_source` on the func result attributes will have index 0. This is because of how propagation works with running propagation on each returned result. Having them have the right index would make sense if the `sdy.edge_sources` were saved as a top level attribute on the func, but since one is saved per result, then an index of 0 makes most sense.

PiperOrigin-RevId: 709122522
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.

1 participant