Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
迷途归一
Paddle
提交
753fa844
P
Paddle
项目概览
迷途归一
/
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
753fa844
编写于
3月 01, 2023
作者:
M
mayang002
提交者:
GitHub
3月 01, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[xpu] fix bugs of split/embedding_with_wltwise_add/beam_search_decode kernel (#51052)
上级
a348a423
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
1 deletion
+17
-1
paddle/fluid/operators/beam_search_decode_op_xpu.cc
paddle/fluid/operators/beam_search_decode_op_xpu.cc
+2
-0
paddle/phi/kernels/fusion/xpu/embedding_with_eltwise_add_xpu_kernel.cc
...rnels/fusion/xpu/embedding_with_eltwise_add_xpu_kernel.cc
+12
-1
paddle/phi/kernels/xpu/split_kernel.cc
paddle/phi/kernels/xpu/split_kernel.cc
+3
-0
未找到文件。
paddle/fluid/operators/beam_search_decode_op_xpu.cc
浏览文件 @
753fa844
...
...
@@ -101,6 +101,8 @@ class BeamSearchDecodeXPUKernel : public framework::OpKernel<T> {
xpu
::
Error_t
::
SUCCESS
,
platform
::
errors
::
External
(
"Execute function CopyTensorByXPU failed by [%d]"
,
r
));
sentenceIds_temp
->
set_lod
(
sentenceIds
->
lod
());
sentenceScores_temp
->
set_lod
(
sentenceScores
->
lod
());
}
}
};
...
...
paddle/phi/kernels/fusion/xpu/embedding_with_eltwise_add_xpu_kernel.cc
浏览文件 @
753fa844
...
...
@@ -53,8 +53,19 @@ void EmbeddingWithEltwiseAddXpuKernel(
std
::
vector
<
int
>
(
idx_len
,
0
));
std
::
vector
<
xpu
::
VectorParam
<
int
>>
arg_ids
;
for
(
int
i
=
0
;
i
<
emb_layer_num
;
i
++
)
{
PADDLE_ENFORCE_EQ
(
ids
[
i
]
->
dtype
()
==
phi
::
DataType
::
INT64
||
ids
[
i
]
->
dtype
()
==
phi
::
DataType
::
INT32
,
true
,
errors
::
InvalidArgument
(
"The data type of ids should be int64 or int32, but got %s."
,
ids
[
i
]
->
dtype
()));
for
(
int
j
=
0
;
j
<
idx_len
;
j
++
)
{
int_idx
[
i
][
j
]
=
static_cast
<
int
>
(
ids
[
i
]
->
data
<
int64_t
>
()[
j
]);
if
(
ids
[
i
]
->
dtype
()
==
phi
::
DataType
::
INT64
)
{
int_idx
[
i
][
j
]
=
static_cast
<
int
>
(
ids
[
i
]
->
data
<
int64_t
>
()[
j
]);
}
else
if
(
ids
[
i
]
->
dtype
()
==
phi
::
DataType
::
INT32
)
{
int_idx
[
i
][
j
]
=
ids
[
i
]
->
data
<
int
>
()[
j
];
}
}
arg_ids
.
push_back
(
xpu
::
VectorParam
<
int
>
{
int_idx
[
i
].
data
(),
idx_len
,
nullptr
});
...
...
paddle/phi/kernels/xpu/split_kernel.cc
浏览文件 @
753fa844
...
...
@@ -36,6 +36,9 @@ void SplitKernel(const Context& dev_ctx,
out_ptrs
.
push_back
(
reinterpret_cast
<
XPUType
*>
(
outs
[
j
]
->
data
<
T
>
()));
split_lists
.
push_back
(
outs
[
j
]
->
dims
()[
axis
]);
}
if
(
x
.
numel
()
==
0
)
{
return
;
}
int
r
=
xpu
::
split
<
XPUType
>
(
dev_ctx
.
x_context
(),
reinterpret_cast
<
const
XPUType
*>
(
x
.
data
<
T
>
()),
out_ptrs
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录