fix bug when the cuda kernel config exceeds dims max #33748
Merged
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.