Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wmsofts
Paddle
提交
e3e92c9a
P
Paddle
项目概览
wmsofts
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e3e92c9a
编写于
9月 01, 2022
作者:
L
Leo Chen
提交者:
GitHub
9月 01, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update alloc usage (#45654)
上级
def71d38
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
8 deletion
+28
-8
paddle/fluid/operators/fused/fused_gemm_epilogue_op.cu
paddle/fluid/operators/fused/fused_gemm_epilogue_op.cu
+12
-4
paddle/fluid/operators/math/eigen_values_vectors.h
paddle/fluid/operators/math/eigen_values_vectors.h
+8
-2
paddle/fluid/operators/sparse_attention_op.cu
paddle/fluid/operators/sparse_attention_op.cu
+8
-2
未找到文件。
paddle/fluid/operators/fused/fused_gemm_epilogue_op.cu
浏览文件 @
e3e92c9a
...
@@ -150,8 +150,10 @@ class FusedGemmEpilogueKernel : public framework::OpKernel<T> {
...
@@ -150,8 +150,10 @@ class FusedGemmEpilogueKernel : public framework::OpKernel<T> {
// "enough". I just followed the settings from the NVIDIA MLPerf BERT code.
// "enough". I just followed the settings from the NVIDIA MLPerf BERT code.
size_t
workspace_size
=
static_cast
<
size_t
>
(
4
)
*
1024
*
1024
;
size_t
workspace_size
=
static_cast
<
size_t
>
(
4
)
*
1024
*
1024
;
cudaStream_t
stream
=
dev_ctx
.
stream
();
cudaStream_t
stream
=
dev_ctx
.
stream
();
memory
::
allocation
::
AllocationPtr
workspace
=
memory
::
allocation
::
AllocationPtr
workspace
=
memory
::
Alloc
(
memory
::
Alloc
(
dev_ctx
,
workspace_size
);
dev_ctx
.
GetPlace
(),
workspace_size
,
phi
::
Stream
(
reinterpret_cast
<
phi
::
StreamId
>
(
dev_ctx
.
stream
())));
double
alpha64
=
1.0
,
beta64
=
0.0
;
double
alpha64
=
1.0
,
beta64
=
0.0
;
float
alpha32
=
1.0
f
,
beta32
=
0.0
f
;
float
alpha32
=
1.0
f
,
beta32
=
0.0
f
;
...
@@ -486,7 +488,10 @@ class FusedGemmEpilogueGradKernel : public framework::OpKernel<T> {
...
@@ -486,7 +488,10 @@ class FusedGemmEpilogueGradKernel : public framework::OpKernel<T> {
sizeof
(
aux_ld
)));
sizeof
(
aux_ld
)));
}
}
auto
dx_workspace
=
memory
::
Alloc
(
dev_ctx
,
workspace_size
);
auto
dx_workspace
=
memory
::
Alloc
(
dev_ctx
.
GetPlace
(),
workspace_size
,
phi
::
Stream
(
reinterpret_cast
<
phi
::
StreamId
>
(
dev_ctx
.
stream
())));
auto
*
dx_data
=
dx
->
mutable_data
<
T
>
(
ctx
.
GetPlace
());
auto
*
dx_data
=
dx
->
mutable_data
<
T
>
(
ctx
.
GetPlace
());
const
auto
*
y_data
=
y
->
data
<
T
>
();
const
auto
*
y_data
=
y
->
data
<
T
>
();
...
@@ -605,7 +610,10 @@ class FusedGemmEpilogueGradKernel : public framework::OpKernel<T> {
...
@@ -605,7 +610,10 @@ class FusedGemmEpilogueGradKernel : public framework::OpKernel<T> {
sizeof
(
dbias_data
)));
sizeof
(
dbias_data
)));
}
}
auto
dy_workspace
=
memory
::
Alloc
(
dev_ctx
,
workspace_size
);
auto
dy_workspace
=
memory
::
Alloc
(
dev_ctx
.
GetPlace
(),
workspace_size
,
phi
::
Stream
(
reinterpret_cast
<
phi
::
StreamId
>
(
dev_ctx
.
stream
())));
auto
*
dy_data
=
dy
->
mutable_data
<
T
>
(
ctx
.
GetPlace
());
auto
*
dy_data
=
dy
->
mutable_data
<
T
>
(
ctx
.
GetPlace
());
const
auto
*
dout_data
=
dout
->
data
<
T
>
();
const
auto
*
dout_data
=
dout
->
data
<
T
>
();
const
auto
*
x_data
=
x
->
data
<
T
>
();
const
auto
*
x_data
=
x
->
data
<
T
>
();
...
...
paddle/fluid/operators/math/eigen_values_vectors.h
浏览文件 @
e3e92c9a
...
@@ -207,7 +207,10 @@ struct MatrixEighFunctor<phi::GPUContext, T> {
...
@@ -207,7 +207,10 @@ struct MatrixEighFunctor<phi::GPUContext, T> {
auto
vector_stride
=
dims
[
dim_size
-
1
]
*
dims
[
dim_size
-
2
];
auto
vector_stride
=
dims
[
dim_size
-
1
]
*
dims
[
dim_size
-
2
];
auto
values_stride
=
dims
[
dim_size
-
1
];
auto
values_stride
=
dims
[
dim_size
-
1
];
int
lwork
=
0
;
int
lwork
=
0
;
auto
info
=
memory
::
Alloc
(
dev_ctx
,
sizeof
(
int
)
*
batch_size
);
auto
info
=
memory
::
Alloc
(
dev_ctx
.
GetPlace
(),
sizeof
(
int
)
*
batch_size
,
phi
::
Stream
(
reinterpret_cast
<
phi
::
StreamId
>
(
dev_ctx
.
stream
())));
auto
*
info_ptr
=
reinterpret_cast
<
int
*>
(
info
->
ptr
());
auto
*
info_ptr
=
reinterpret_cast
<
int
*>
(
info
->
ptr
());
// When the input type is float32, and the feature value input dimension is
// When the input type is float32, and the feature value input dimension is
...
@@ -240,7 +243,10 @@ struct MatrixEighFunctor<phi::GPUContext, T> {
...
@@ -240,7 +243,10 @@ struct MatrixEighFunctor<phi::GPUContext, T> {
out_value
,
out_value
,
&
lwork
);
&
lwork
);
}
}
auto
work
=
memory
::
Alloc
(
dev_ctx
,
sizeof
(
T
)
*
lwork
);
auto
work
=
memory
::
Alloc
(
dev_ctx
.
GetPlace
(),
sizeof
(
T
)
*
lwork
,
phi
::
Stream
(
reinterpret_cast
<
phi
::
StreamId
>
(
dev_ctx
.
stream
())));
auto
*
work_ptr
=
reinterpret_cast
<
T
*>
(
work
->
ptr
());
auto
*
work_ptr
=
reinterpret_cast
<
T
*>
(
work
->
ptr
());
for
(
auto
i
=
0
;
i
<
batch_size
;
i
++
)
{
for
(
auto
i
=
0
;
i
<
batch_size
;
i
++
)
{
auto
*
input_data
=
input_vector
+
i
*
vector_stride
;
auto
*
input_data
=
input_vector
+
i
*
vector_stride
;
...
...
paddle/fluid/operators/sparse_attention_op.cu
浏览文件 @
e3e92c9a
...
@@ -522,7 +522,10 @@ void DotSdd(const phi::GPUContext& ctx,
...
@@ -522,7 +522,10 @@ void DotSdd(const phi::GPUContext& ctx,
gpu_type
,
gpu_type
,
CUSPARSE_SDDMM_ALG_DEFAULT
,
CUSPARSE_SDDMM_ALG_DEFAULT
,
&
buffer_size
);
&
buffer_size
);
auto
d_buffer_ptr
=
paddle
::
memory
::
Alloc
(
ctx
,
buffer_size
);
auto
d_buffer_ptr
=
paddle
::
memory
::
Alloc
(
ctx
.
GetPlace
(),
buffer_size
,
phi
::
Stream
(
reinterpret_cast
<
phi
::
StreamId
>
(
ctx
.
stream
())));
void
*
d_buffer
=
static_cast
<
void
*>
(
d_buffer_ptr
->
ptr
());
void
*
d_buffer
=
static_cast
<
void
*>
(
d_buffer_ptr
->
ptr
());
platform
::
dynload
::
cusparseSDDMM
(
handle
,
platform
::
dynload
::
cusparseSDDMM
(
handle
,
...
@@ -616,7 +619,10 @@ void DotDsd(const phi::GPUContext& ctx,
...
@@ -616,7 +619,10 @@ void DotDsd(const phi::GPUContext& ctx,
gpu_type
,
gpu_type
,
CUSPARSE_SPMM_ALG_DEFAULT
,
CUSPARSE_SPMM_ALG_DEFAULT
,
&
buffer_size
);
&
buffer_size
);
auto
d_buffer_ptr
=
paddle
::
memory
::
Alloc
(
ctx
,
buffer_size
);
auto
d_buffer_ptr
=
paddle
::
memory
::
Alloc
(
ctx
.
GetPlace
(),
buffer_size
,
phi
::
Stream
(
reinterpret_cast
<
phi
::
StreamId
>
(
ctx
.
stream
())));
void
*
d_buffer
=
static_cast
<
void
*>
(
d_buffer_ptr
->
ptr
());
void
*
d_buffer
=
static_cast
<
void
*>
(
d_buffer_ptr
->
ptr
());
platform
::
dynload
::
cusparseSpMM
(
handle
,
platform
::
dynload
::
cusparseSpMM
(
handle
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录