remove final set_value OP in combined-indexing setting #60983
Merged
+65
−14
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.
PR types
Performance optimization
PR changes
Others
Description
Pcard-66985
For combined indexing setting case of dynamic mode, e.g.
x[1, [0,1]] = value
, we will deal it as following step:x'=x[1]
set_value
.In our plan , if
x
has changed byvalue
, the backward should contain it too.But for now., in step 2, the x cannot know whether it has been changed by other operators. It will only backward to the OP which generated it instead of which modified it.
In past , the step 3 is aiming to build a backward edge between
value
andx
. But the performance suffers because of unnecessary forward overwrite.This PR is to optimize this case by remove the final
set_value_with_tensor
, only keeping the backward part , to build a edge between value and x.