【pir backward】Passing the gradient output of tuple_pop between if_grad_grad and if_grad #71445
+207
−3
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
pcard-67164
if op 经过二阶微分后,二阶的if_grad_grad 前向op if_grad_1 中包含一个tuple_pop op, 该op 的输出被if_grad_1 中使用, if_grad_grad 理应产出相应的梯度,给二阶中的if_grad_2 用。 (要解决的问题)但是由于二阶的if_grad_2 和 if_grad_grad 属于无关的block, 想要获取梯度的访问权限,需要if_grad_grad 将梯度yield 出去,(设计限制) if op 要求 true_block 和false_block 需要yiled 相同的变量, 对于if_grad_grad 需要yield 的梯度,应该是两个block 的并集。 (矛盾点)但是在构造if_grad_grad 的两个block时,是无法互相访问变量,因此构造fake 的value 和type.
conf block