From a4b30a1237fd3ed5c32be1a32f6cb880bc3aac1b Mon Sep 17 00:00:00 2001 From: Qi Li Date: Thu, 1 Apr 2021 18:53:38 +0800 Subject: [PATCH] [ROCM] fix depthwise conv failure on ROCM, test=develop (#31998) --- paddle/fluid/operators/math/depthwise_conv.cu | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/math/depthwise_conv.cu b/paddle/fluid/operators/math/depthwise_conv.cu index 7439a959d3..d116b620dc 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