Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
0603777b
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2292
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0603777b
编写于
5月 12, 2023
作者:
R
RuohengMa
提交者:
GitHub
5月 12, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PHI] update xpu api version; bind reduce_any_bool xpu kernel; remove unnecessary header (#53716)
上级
348565b0
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
57 addition
and
3 deletion
+57
-3
cmake/external/xpu.cmake
cmake/external/xpu.cmake
+1
-1
paddle/phi/backends/xpu/xpu2_op_list.cc
paddle/phi/backends/xpu/xpu2_op_list.cc
+1
-0
paddle/phi/kernels/reduce_any_kernel.cc
paddle/phi/kernels/reduce_any_kernel.cc
+4
-0
paddle/phi/kernels/xpu/reduce_any_kernel.cc
paddle/phi/kernels/xpu/reduce_any_kernel.cc
+51
-0
paddle/phi/kernels/xpu/scatter_grad_kernel.cc
paddle/phi/kernels/xpu/scatter_grad_kernel.cc
+0
-2
未找到文件。
cmake/external/xpu.cmake
浏览文件 @
0603777b
...
...
@@ -8,7 +8,7 @@ set(XPU_API_LIB_NAME "libxpuapi.so")
set
(
XPU_RT_LIB_NAME
"libxpurt.so"
)
set
(
XPU_XFT_LIB_NAME
"libxft.so"
)
set
(
XPU_BASE_DATE
"20230
427
"
)
set
(
XPU_BASE_DATE
"20230
510
"
)
set
(
XPU_XCCL_BASE_VERSION
"1.0.49.2"
)
set
(
XPU_XFT_BASE_VERSION
"latest"
)
...
...
paddle/phi/backends/xpu/xpu2_op_list.cc
浏览文件 @
0603777b
...
...
@@ -574,6 +574,7 @@ XPUOpMap& get_kl2_ops() {
{
"reciprocal"
,
XPUKernelSet
({
phi
::
DataType
::
FLOAT32
})},
{
"reciprocal_grad"
,
XPUKernelSet
({
phi
::
DataType
::
FLOAT32
,
phi
::
DataType
::
FLOAT16
})},
{
"reduce_any"
,
XPUKernelSet
({
phi
::
DataType
::
BOOL
})},
{
"reduce_max_grad"
,
XPUKernelSet
({
phi
::
DataType
::
FLOAT32
})},
{
"reduce_max"
,
XPUKernelSet
({
phi
::
DataType
::
FLOAT32
,
phi
::
DataType
::
INT32
})},
...
...
paddle/phi/kernels/reduce_any_kernel.cc
浏览文件 @
0603777b
...
...
@@ -40,3 +40,7 @@ PD_REGISTER_KERNEL(any, GPU, ALL_LAYOUT, phi::AnyKernel, bool) {}
#if defined(PADDLE_WITH_XPU_KP)
PD_REGISTER_KERNEL
(
any
,
KPS
,
ALL_LAYOUT
,
phi
::
AnyKernel
,
bool
)
{}
#endif
#if defined(PADDLE_WITH_XPU)
PD_REGISTER_KERNEL
(
any
,
XPU
,
ALL_LAYOUT
,
phi
::
AnyKernel
,
bool
)
{}
#endif
paddle/phi/kernels/xpu/reduce_any_kernel.cc
0 → 100644
浏览文件 @
0603777b
// Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/phi/kernels/reduce_any_kernel.h"
#include "paddle/phi/backends/xpu/enforce_xpu.h"
#include "paddle/phi/backends/xpu/xpu_context.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/xpu/reduce.h"
namespace
phi
{
template
<
typename
T
,
typename
Context
>
void
AnyRawKernel
(
const
Context
&
dev_ctx
,
const
DenseTensor
&
x
,
const
std
::
vector
<
int64_t
>&
dims
,
bool
keep_dim
,
bool
reduce_all
,
DenseTensor
*
out
)
{
reduce_all
=
recompute_reduce_all
(
x
,
dims
,
reduce_all
);
using
XPUType
=
typename
XPUTypeTrait
<
T
>::
Type
;
auto
f
=
[](
xpu
::
Context
*
ctx
,
const
T
*
x
,
T
*
y
,
const
std
::
vector
<
int
>&
xdims
,
const
std
::
vector
<
int
>&
reduce_dims
)
{
return
xpu
::
reduce_any
<
XPUType
>
(
ctx
,
reinterpret_cast
<
const
XPUType
*>
(
x
),
reinterpret_cast
<
XPUType
*>
(
y
),
xdims
,
reduce_dims
);
};
int
r
=
XPUReduce
<
Context
,
T
>
(
dev_ctx
,
x
,
dims
,
keep_dim
,
reduce_all
,
out
,
f
);
PADDLE_ENFORCE_XDNN_SUCCESS
(
r
,
"reduce_any"
);
}
}
// namespace phi
PD_REGISTER_KERNEL
(
any_raw
,
XPU
,
ALL_LAYOUT
,
phi
::
AnyRawKernel
,
bool
)
{}
paddle/phi/kernels/xpu/scatter_grad_kernel.cc
浏览文件 @
0603777b
...
...
@@ -17,8 +17,6 @@
#include "paddle/phi/backends/xpu/enforce_xpu.h"
#include "paddle/phi/core/kernel_registry.h"
#include "glog/logging.h"
namespace
phi
{
template
<
typename
T
,
typename
Context
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录