Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctc grad scale same with espnet #34729

Merged
merged 26 commits into from
Aug 17, 2021
Merged

ctc grad scale same with espnet #34729

merged 26 commits into from
Aug 17, 2021

Conversation

zh794390558
Copy link
Contributor

@zh794390558 zh794390558 commented Aug 9, 2021

PR types

New features

PR changes

OPs

Describe

  1. CTC 算 loss有两种norm方式,一种是 batch_size 的 reduce,一种是 element_wise 的reduce。
    这个PR是修正这两种 norm 方式下 ctc grad 的计算。

  2. 目前 paddle 的 norm 方式和 espnet 是有差异的,而且现在实现的方式并不常用。
    所以新增两种 norm 方式,具体实现同 https://github.com/espnet/warp-ctc/blob/pytorch_bindings/pytorch_binding/warpctc_pytorch/__init__.py#L39

  3. 具体使用时需要用户自己根据使用的norm方式选在对应的选项对 grad 做处理。

  4. 修改文件过多是因为 ctc 实现了 LodTensor。

  5. doc fix ctc api for #34729 docs#3709

  6. grad支持GPU操作

espnet:
image

paddle:
image

paddle-gpu:
image

paddle-cpu vs paddle-gpu
测试case和espnet不同
ctc_grad_gpu_pr

@paddle-bot-old
Copy link

paddle-bot-old bot commented Aug 9, 2021

Hi, It's a test PR, it will not trigger CI. If you want to trigger CI, please remove notest in your commit message.

Shixiaowei02
Shixiaowei02 previously approved these changes Aug 11, 2021
Copy link
Member

@ZeyuChen ZeyuChen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

与ESPNet行为进一步验证,命名风格需统一。

paddle/fluid/operators/warpctc_op.h Outdated Show resolved Hide resolved
paddle/fluid/operators/math/sequence_padding.cc Outdated Show resolved Hide resolved
paddle/fluid/operators/warpctc_op.h Outdated Show resolved Hide resolved
paddle/fluid/operators/warpctc_op.h Outdated Show resolved Hide resolved
paddle/fluid/operators/warpctc_op.h Outdated Show resolved Hide resolved
python/paddle/fluid/layers/loss.py Outdated Show resolved Hide resolved
Copy link
Contributor

@zhangting2020 zhangting2020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for skip_check_grad_ci

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@ZeyuChen ZeyuChen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ZeyuChen ZeyuChen merged commit 10f9644 into PaddlePaddle:develop Aug 17, 2021
@zh794390558 zh794390558 deleted the ctc branch October 11, 2021 11:48
zh794390558 added a commit to zh794390558/Paddle that referenced this pull request Oct 26, 2021
zh794390558 added a commit to zh794390558/Paddle that referenced this pull request Oct 27, 2021
ZeyuChen pushed a commit that referenced this pull request Oct 28, 2021
* Revert "Align CTC grad scale same with ESPNet (#34729)"

This reverts commit 10f9644.

* ctc grad compute on gpu
ZeyuChen pushed a commit that referenced this pull request Oct 28, 2021
* Revert "Align CTC grad scale same with ESPNet (#34729)"

This reverts commit 10f9644.

* ctc grad compute on gpu
ghost pushed a commit to piotrekobi/Paddle that referenced this pull request Nov 3, 2021
* Revert "Align CTC grad scale same with ESPNet (PaddlePaddle#34729)"

This reverts commit 10f9644.

* ctc grad compute on gpu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants