Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
8c154880
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
8c154880
编写于
8月 30, 2023
作者:
R
ronnywang
提交者:
GitHub
8月 30, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ROCM] Remove the constraint with a maximum number of threads per block of 256, P4 (#56702)
上级
59b2ad39
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
1 addition
and
38 deletion
+1
-38
paddle/phi/kernels/funcs/layer_norm_impl.cu.h
paddle/phi/kernels/funcs/layer_norm_impl.cu.h
+1
-6
paddle/phi/kernels/gpu/send_ue_recv_grad_kernel.cu
paddle/phi/kernels/gpu/send_ue_recv_grad_kernel.cu
+0
-4
paddle/phi/kernels/gpu/send_ue_recv_kernel.cu
paddle/phi/kernels/gpu/send_ue_recv_kernel.cu
+0
-4
paddle/phi/kernels/gpu/sigmoid_cross_entropy_with_logits.h
paddle/phi/kernels/gpu/sigmoid_cross_entropy_with_logits.h
+0
-4
paddle/phi/kernels/gpu/unpool_grad_kernel.cu
paddle/phi/kernels/gpu/unpool_grad_kernel.cu
+0
-8
paddle/phi/kernels/gpu/unpool_kernel.cu
paddle/phi/kernels/gpu/unpool_kernel.cu
+0
-8
paddle/phi/kernels/gpudnn/softmax_gpudnn.h
paddle/phi/kernels/gpudnn/softmax_gpudnn.h
+0
-4
未找到文件。
paddle/phi/kernels/funcs/layer_norm_impl.cu.h
浏览文件 @
8c154880
...
...
@@ -42,11 +42,10 @@ template <typename T>
using
LayerNormParamType
=
typename
CudnnDataType
<
T
>::
BatchNormParamType
;
inline
static
int
GetDesiredBlockDim
(
int64_t
block_dim
)
{
const
int
kMaxBlockDim
=
512
;
#ifdef __HIPCC__
const
int
kMaxBlockDim
=
256
;
const
int
lwarpSize
=
64
;
#else
const
int
kMaxBlockDim
=
512
;
const
int
lwarpSize
=
32
;
#endif
return
block_dim
>=
kMaxBlockDim
?
kMaxBlockDim
:
lwarpSize
;
...
...
@@ -1875,11 +1874,7 @@ static void LayerNormBackward(
int64_t
feature_size
,
const
phi
::
GPUContext
&
dev_ctx
)
{
auto
stream
=
dev_ctx
.
stream
();
#ifdef __HIPCC__
const
int
kMaxBlockDim
=
256
;
#else
const
int
kMaxBlockDim
=
512
;
#endif
const
int
kMaxBlockNum
=
128
;
int
gradient_flag
=
((
d_x
!=
nullptr
?
1
:
0
)
<<
2
)
|
((
d_scale
!=
nullptr
?
1
:
0
)
<<
1
)
|
...
...
paddle/phi/kernels/gpu/send_ue_recv_grad_kernel.cu
浏览文件 @
8c154880
...
...
@@ -113,11 +113,7 @@ void CalculateXGrad(const Context& ctx,
const
DenseTensor
&
out_grad_tensor
,
const
DenseTensor
*
dst_count
=
nullptr
,
const
DenseTensor
*
out
=
nullptr
)
{
#ifdef PADDLE_WITH_HIP
int
block
=
256
;
#else
int
block
=
1024
;
#endif
int64_t
n
=
slice_size
*
index_size
;
int
max_grid_dimx
=
ctx
.
GetCUDAMaxGridDimSize
()[
0
];
int64_t
grid_tmp
=
(
n
+
block
-
1
)
/
block
;
...
...
paddle/phi/kernels/gpu/send_ue_recv_kernel.cu
浏览文件 @
8c154880
...
...
@@ -101,11 +101,7 @@ void GraphSendUERecvOpCUDAKernelLaunchHelper(const Context& ctx,
const
dim3
grid
(
nbx
,
nby
);
const
dim3
block
(
ntx
,
nty
);
int64_t
input_size
=
x
.
dims
()[
0
];
#ifdef PADDLE_WITH_HIP
int
block_
=
256
;
#else
int
block_
=
1024
;
#endif
if
(
reduce_op
==
"SUM"
||
reduce_op
==
"MEAN"
)
{
GraphSendUERecvSumCUDAFunctor
<
T
>
sum_functor
;
if
(
message_op
==
"ADD"
)
{
...
...
paddle/phi/kernels/gpu/sigmoid_cross_entropy_with_logits.h
浏览文件 @
8c154880
...
...
@@ -35,11 +35,7 @@ namespace cub = hipcub;
namespace
phi
{
#ifdef __HIPCC__
static
constexpr
int
kNumCUDAThreads
=
256
;
#else
static
constexpr
int
kNumCUDAThreads
=
512
;
#endif
static
constexpr
int
kNumMaxinumNumBlocks
=
4096
;
static
inline
int
NumBlocks
(
const
int
N
)
{
...
...
paddle/phi/kernels/gpu/unpool_grad_kernel.cu
浏览文件 @
8c154880
...
...
@@ -88,11 +88,7 @@ class Unpool2dMaxGradFunctor {
const
T
*
output_data
=
output
.
data
<
T
>
();
const
T
*
output_grad_data
=
output_grad
.
data
<
T
>
();
T
*
input_grad_data
=
dev_ctx
.
template
Alloc
<
T
>(
input_grad
);
#ifdef __HIPCC__
int
threads
=
256
;
#else
int
threads
=
1024
;
#endif
int
grid
=
(
input
.
numel
()
+
threads
-
1
)
/
threads
;
KernelUnpool2dMaxGrad
<
T
>
<<<
grid
,
threads
,
0
,
dev_ctx
.
stream
()
>>>
(
input
.
numel
(),
...
...
@@ -131,11 +127,7 @@ class Unpool3dMaxGradFunctor {
const
T
*
output_data
=
output
.
data
<
T
>
();
const
T
*
output_grad_data
=
output_grad
.
data
<
T
>
();
T
*
input_grad_data
=
dev_ctx
.
template
Alloc
<
T
>(
input_grad
);
#ifdef __HIPCC__
int
threads
=
256
;
#else
int
threads
=
1024
;
#endif
int
grid
=
(
input
.
numel
()
+
threads
-
1
)
/
threads
;
KernelUnpool3dMaxGrad
<
T
>
<<<
grid
,
threads
,
0
,
dev_ctx
.
stream
()
>>>
(
input
.
numel
(),
...
...
paddle/phi/kernels/gpu/unpool_kernel.cu
浏览文件 @
8c154880
...
...
@@ -80,11 +80,7 @@ class Unpool2dMaxFunctor {
const
T
*
input_data
=
input
.
data
<
T
>
();
const
int
*
indices_data
=
indices
.
data
<
int
>
();
T
*
output_data
=
dev_ctx
.
template
Alloc
<
T
>(
output
);
#ifdef __HIPCC__
int
threads
=
256
;
#else
int
threads
=
1024
;
#endif
int
grid
=
(
input
.
numel
()
+
threads
-
1
)
/
threads
;
KernelUnpool2dMax
<
T
>
<<<
grid
,
threads
,
0
,
dev_ctx
.
stream
()
>>>
(
input
.
numel
(),
...
...
@@ -117,11 +113,7 @@ class Unpool3dMaxFunctor {
const
T
*
input_data
=
input
.
data
<
T
>
();
const
int
*
indices_data
=
indices
.
data
<
int
>
();
T
*
output_data
=
dev_ctx
.
template
Alloc
<
T
>(
output
);
#ifdef __HIPCC__
int
threads
=
256
;
#else
int
threads
=
1024
;
#endif
int
grid
=
(
input
.
numel
()
+
threads
-
1
)
/
threads
;
KernelUnpool3dMax
<
T
>
<<<
grid
,
threads
,
0
,
dev_ctx
.
stream
()
>>>
(
input
.
numel
(),
...
...
paddle/phi/kernels/gpudnn/softmax_gpudnn.h
浏览文件 @
8c154880
...
...
@@ -870,11 +870,7 @@ static void GetGridDim(
}
static
void
GetBlockDim
(
int
mid_dim
,
int
low_dim
,
dim3
*
block
)
{
#ifdef __HIPCC__
constexpr
int
max_num_threads
=
256
;
#else
constexpr
int
max_num_threads
=
1024
;
#endif
int
block_x
=
1
<<
Log2Ceil
(
low_dim
);
int
block_y
=
1
<<
Log2Ceil
(
mid_dim
);
block
->
x
=
std
::
min
(
block_x
,
32
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录