Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
cdab3a44
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
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看板
未验证
提交
cdab3a44
编写于
12月 20, 2022
作者:
S
ShenLiang
提交者:
GitHub
12月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix nullptr to TestFuseGemmEpilogueReluBWDFP* (#48997) (#49090)
Co-authored-by:
N
Ming-Xu Huang
<
mingh@nvidia.com
>
上级
ddcd1b61
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
15 addition
and
11 deletion
+15
-11
paddle/fluid/operators/fused/fused_gemm_epilogue_op.cc
paddle/fluid/operators/fused/fused_gemm_epilogue_op.cc
+2
-3
paddle/fluid/operators/fused/fused_gemm_epilogue_op.cu
paddle/fluid/operators/fused/fused_gemm_epilogue_op.cu
+13
-8
未找到文件。
paddle/fluid/operators/fused/fused_gemm_epilogue_op.cc
浏览文件 @
cdab3a44
...
...
@@ -139,9 +139,8 @@ class FusedGemmEpilogueOp : public framework::OperatorWithKernel {
}
ctx
->
SetOutputDim
(
"Out"
,
phi
::
make_ddim
(
out_dims
));
// Note (Ming Huang): Reserve space of relu is a bit-mask,
// which cannot pass nan_and_inf checking if shape is set.
if
(
activation
==
"gelu"
&&
ctx
->
HasOutput
(
"ReserveSpace"
))
{
if
(
ctx
->
HasOutput
(
"ReserveSpace"
))
{
ctx
->
SetOutputDim
(
"ReserveSpace"
,
phi
::
make_ddim
(
out_dims
));
}
}
...
...
paddle/fluid/operators/fused/fused_gemm_epilogue_op.cu
浏览文件 @
cdab3a44
...
...
@@ -107,15 +107,21 @@ class FusedGemmEpilogueKernel : public framework::OpKernel<T> {
sizeof
(
bias_data
)));
if
(
enable_auxiliary
&&
activation
!=
"none"
)
{
size_t
reserve_space_size
=
0
;
// Note (Ming Huang): The initialization of ReseveSpace is happened in the
// dev_ctx.Alloc. Therefore, we set real date type up here.
if
(
activation
==
"relu"
)
{
// Count in bits.
reserve_space_size
=
phi
::
product
(
out
->
dims
())
/
8
;
paddle
::
experimental
::
DataType
rs_type
=
paddle
::
experimental
::
DataType
::
BOOL
;
size_t
reserve_space_size
=
phi
::
product
(
reserve_space
->
dims
())
*
SizeOf
(
rs_type
);
dev_ctx
.
Alloc
(
reserve_space
,
rs_type
,
reserve_space_size
);
}
else
{
reserve_space_size
=
phi
::
product
(
out
->
dims
())
*
sizeof
(
T
);
size_t
reserve_space_size
=
phi
::
product
(
reserve_space
->
dims
())
*
sizeof
(
T
);
dev_ctx
.
Alloc
<
T
>
(
reserve_space
,
reserve_space_size
);
}
dev_ctx
.
Alloc
(
reserve_space
,
out
->
type
(),
reserve_space_size
);
void
*
aux_data
=
re
interpret_cast
<
void
*>
(
reserve_space
->
data
<
T
>
()
);
void
*
aux_data
=
re
serve_space
->
data
(
);
PADDLE_ENFORCE_GPU_SUCCESS
(
platform
::
dynload
::
cublasLtMatmulDescSetAttribute
(
...
...
@@ -185,7 +191,6 @@ class FusedGemmEpilogueKernel : public framework::OpKernel<T> {
stream
,
workspace
->
ptr
(),
workspace_size
);
PADDLE_ENFORCE_GPU_SUCCESS
(
platform
::
dynload
::
cublasLtMatmul
(
lt_handle
,
operation_desc
,
...
...
@@ -478,7 +483,7 @@ class FusedGemmEpilogueGradKernel : public framework::OpKernel<T> {
sizeof
(
epiloque_func_for_dx
)));
if
(
activation_grad
!=
"none"
)
{
auto
*
aux_data
=
reserve_space
->
data
<
T
>
();
auto
*
aux_data
=
reserve_space
->
data
();
PADDLE_ENFORCE_GPU_SUCCESS
(
platform
::
dynload
::
cublasLtMatmulDescSetAttribute
(
dx_operation_desc
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录