Skip to content

re-submit softmax_with_cross_entropy hard label#35283

Merged
JiaXiao243 merged 1 commit intoPaddlePaddle:developfrom
xingfeng01:develop-hardlabel
Sep 10, 2021
Merged

re-submit softmax_with_cross_entropy hard label#35283
JiaXiao243 merged 1 commit intoPaddlePaddle:developfrom
xingfeng01:develop-hardlabel

Conversation

@xingfeng01
Copy link
Contributor

@xingfeng01 xingfeng01 commented Aug 31, 2021

PR types

Performance optimization

PR changes

Ops

Describe

Op softmax_with_cross_entropy optimization hard label. This PR includes:

hard label forward kernel: use same idea of softmax's implementation: SoftmaxWithCrossEntropyHardLabel
hard label backward kernel: merge multiple kernels to one kernel: SoftmaxWithCrossEntropyGradHardLabel

This PR re-submit PR 32290, which was reverted by PR 33340. The difference is from manual written kernel and cudnn implementation (log softmax)

  • Current implementation: L636 - L649
  • PR implementation: L450 - L468

This PR also modifies the absolute error check of "parallel_margin_cross_entropy". The owner (Guoxia Wang) is approved.

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

integral_grad.numpy(),
rtol=1e-5)
rtol=1e-5,
atol=1e-7)
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM for atol=1e-7

loss_a.numpy(),
loss_b.numpy(),
rtol=1e-5,
atol=1e-7)
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM for atol=1e-7

Copy link

@JiaXiao243 JiaXiao243 left a comment

Choose a reason for hiding this comment

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

LGTM, ResNet50 result is:
a60d34a99ab3bd203d4b79b6a6fe0ad5

@JiaXiao243 JiaXiao243 merged commit a4b67f7 into PaddlePaddle:develop Sep 10, 2021
@xingfeng01 xingfeng01 deleted the develop-hardlabel branch September 10, 2021 10:45
AnnaTrainingG pushed a commit to AnnaTrainingG/Paddle that referenced this pull request Sep 29, 2021
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.

3 participants