[Dy2St][PIR] Re-create ShadowOutput OP in split forward-backward #63764
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 Category
Execute Infrastructure
PR Types
Bug fixes
Description
我们在添加反向之前的原始 program 就添加了 shadow output OP 以定位输出是哪些
在原来的逻辑中,在前反向切分时候仍然会将这些 OP 一并 clone 到新的前向 Program 中,对于这些 OP,我们没有必要重新添加 shadow output,因此在为输出添加 shadow output 时候就需要判断是否已经添加,但现在的判断逻辑是不鲁棒的,用于生成 name 的 counter 是完全对不上的
因此本 PR 在前反向切分时 clone OP 时跳过 shadow output,这样为输出创建 shadow output 时就没有必要再使用奇怪的逻辑去跳过了
PCard-66972