#sdy #debug support debugging tool to save the edge source shardings. #310
+741
−182
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.
#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'sresultAttr
. If the function has multiple results, then eachedge_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 thesdy.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.