diff --git a/paddle/fluid/operators/math/depthwise_conv.cu b/paddle/fluid/operators/math/depthwise_conv.cu index 7439a959d382852b631b1a7359387ed9764810d0..d116b620dc1e13973560480a674fe27437dfbefc 100644 --- a/paddle/fluid/operators/math/depthwise_conv.cu +++ b/paddle/fluid/operators/math/depthwise_conv.cu @@ -613,6 +613,9 @@ class DepthwiseConvFunctor 512 && output_width <= 1024) thread = output_width; +#ifdef __HIPCC__ + thread = std::min(thread, 256); +#endif int blocks = std::min(std::max(thread / output_width, 1), output_height); dim3 threads(std::min(output_width, thread), blocks, 1); dim3 grid(output_channels, batch_size, 1); @@ -620,7 +623,13 @@ class DepthwiseConvFunctor