fix bug when the cuda kernel config exceeds dims max#33748
Merged
zhiqiu merged 1 commit intoPaddlePaddle:developfrom Jun 24, 2021
Merged
fix bug when the cuda kernel config exceeds dims max#33748zhiqiu merged 1 commit intoPaddlePaddle:developfrom
zhiqiu merged 1 commit intoPaddlePaddle:developfrom
Conversation
|
Thanks for your contribution! |
0b5ea5e to
617e3ed
Compare
zhiqiu
added a commit
to zhiqiu/Paddle
that referenced
this pull request
Jul 1, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 types
Bug fixes
PR changes
OPs
Describe
fix bug when the cuda kernel config exceeds dims max
close PaddlePaddle/PaddleClas#685, #33107
When use 3D dim3 config for the blocks of cuda kernel, the limit of each dim is (1024, 1024, 64). For example
The condition shouble be: x <=1024, y <=1024, z <=64, otherwise, "cudaErrorInvalidConfiguration" will be raised.
In layer_norm_grad, it uses 3D dim3 (1, batch_size, 1) as blocks config. While, batch_size may > 1024.
This PR change
3D dim3 (1, batch_size, 1)to1D dim3 (batch_size)to solve the problem.