Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • Paddle
  • 合并请求
  • !21340

P
Paddle
  • 项目概览

PaddlePaddle / Paddle
大约 2 年 前同步成功

通知 2325
Star 20933
Fork 5424
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 1423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
P
Paddle
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 1,423
    • Issue 1,423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
    • 合并请求 543
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板

Fix Cond Bug for Nested Control Flow !21340

  • Report abuse
!21340 已合并 11月 25, 2019 由 saxon_zh@saxon_zh 创建
#<User:0x00007f7eabc02638>
  • 概览 12
  • 提交 9
  • 变更 11

Created by: zhhsplendid

This PR fixes a lot of bugs. Because it touched a lot of appending backward stuff, I also run and pass CE: http://ce.paddlepaddle.org:8080/viewLog.html?buildId=69616&tab=buildResultsDiv&buildTypeId=PaddleModesl_ModelDebug_Model11Build

Detail of bug:

  1. Executor will drop kid scopes but in conditional_block_op, we shouldn't drop kid scopes during conditional_block forward op since it can be used during backward. (But we can drop after grad_op) image

  2. Fix assigning inside gradient to outside gradient in conditional_block_op. image

  3. Fix a case that inputs may set stop_gradient and we shouldn't PADDLE_ENFORCE each input has GRAD when inferring shape image

  4. For conditional_block_op, if Cond is also one of Inputs, we should treat it as input so that GRAD of the input can be passed out. image

  5. Delete the Output of grad of condition for conditional_block_op. Cond shouldn't have gradient. image

  6. During appending backward for control flow, the old code didn't find path for sub-block. It was only done for global block and it can cause sub-block backward error. image

  7. Use different @GRAD@RENAME in different block to avoid assigning GRAD values to parent GRAD. Otherwise child scope GRAD may be assigned to parent scope and causes gradient error. For example, at parent scope, var@GRAD = var@GRAD@RENAME@0 + var@GRAD@RENAME@1, where rename 0 and rename 1 come from conditional_block_op0,1. If conditional_block_op1 is not run, then the correct var@GRAD@RENAME@1 should be 0 but bug exists if the var@GRAD@RENAME@1 is assigned in conditional_block_op0, then var@GRAD@RENAME@1 is not 0 and it is wrong. image

  8. sum_op.cu has bug when input tensors are not initialized. For example, if in_0.numel() == 0 and in_1 is initialized with values, all three cases won't run. image

Finally we can run nested control flow.

指派人
分配到
审核者
Request review from
无
里程碑
无
分配里程碑
工时统计
标识: paddlepaddle/Paddle!21340
Source branch: github/fork/zhhsplendid/cond_test_coverage
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7