Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
4d5a3ad6
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,发现更多精彩内容 >>
未验证
提交
4d5a3ad6
编写于
4月 18, 2023
作者:
张
张春乔
提交者:
GitHub
4月 18, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove mlu(#53007)
上级
240e13a2
变更
37
隐藏空白更改
内联
并排
Showing
37 changed file
with
11 addition
and
114 deletion
+11
-114
cmake/operators.cmake
cmake/operators.cmake
+3
-7
paddle/fluid/eager/amp_auto_cast.h
paddle/fluid/eager/amp_auto_cast.h
+0
-1
paddle/fluid/eager/amp_utils.h
paddle/fluid/eager/amp_utils.h
+0
-1
paddle/fluid/eager/eager_amp_auto_cast.h
paddle/fluid/eager/eager_amp_auto_cast.h
+0
-1
paddle/fluid/framework/library_type.h
paddle/fluid/framework/library_type.h
+0
-2
paddle/fluid/framework/tensor_util.cc
paddle/fluid/framework/tensor_util.cc
+0
-3
paddle/fluid/imperative/CMakeLists.txt
paddle/fluid/imperative/CMakeLists.txt
+1
-2
paddle/fluid/imperative/amp_auto_cast.cc
paddle/fluid/imperative/amp_auto_cast.cc
+0
-2
paddle/fluid/imperative/reducer.cc
paddle/fluid/imperative/reducer.cc
+0
-3
paddle/fluid/operators/collective/c_comm_init_op.cc
paddle/fluid/operators/collective/c_comm_init_op.cc
+1
-2
paddle/fluid/operators/generator/get_expected_kernel_func.cc
paddle/fluid/operators/generator/get_expected_kernel_func.cc
+0
-1
paddle/fluid/operators/interpolate_op.h
paddle/fluid/operators/interpolate_op.h
+2
-4
paddle/fluid/operators/reader/buffered_reader.cc
paddle/fluid/operators/reader/buffered_reader.cc
+0
-3
paddle/fluid/operators/reader/buffered_reader.h
paddle/fluid/operators/reader/buffered_reader.h
+0
-1
paddle/fluid/operators/reduce_ops/reduce_op.h
paddle/fluid/operators/reduce_ops/reduce_op.h
+0
-1
paddle/fluid/operators/softmax_op.cc
paddle/fluid/operators/softmax_op.cc
+0
-2
paddle/fluid/operators/tile_op_functor.h
paddle/fluid/operators/tile_op_functor.h
+0
-2
paddle/fluid/platform/CMakeLists.txt
paddle/fluid/platform/CMakeLists.txt
+0
-1
paddle/fluid/platform/device_context.cc
paddle/fluid/platform/device_context.cc
+0
-2
paddle/fluid/platform/device_context.h
paddle/fluid/platform/device_context.h
+0
-1
paddle/fluid/platform/monitor.cc
paddle/fluid/platform/monitor.cc
+0
-18
paddle/fluid/platform/monitor.h
paddle/fluid/platform/monitor.h
+0
-18
paddle/fluid/platform/place.cc
paddle/fluid/platform/place.cc
+0
-6
paddle/fluid/platform/place.h
paddle/fluid/platform/place.h
+0
-1
paddle/fluid/platform/profiler/chrometracing_logger.cc
paddle/fluid/platform/profiler/chrometracing_logger.cc
+0
-1
paddle/fluid/platform/profiler/profiler.h
paddle/fluid/platform/profiler/profiler.h
+0
-1
paddle/fluid/platform/profiler/utils.cc
paddle/fluid/platform/profiler/utils.cc
+1
-2
paddle/fluid/pybind/place.cc
paddle/fluid/pybind/place.cc
+0
-3
paddle/fluid/pybind/tensor.cc
paddle/fluid/pybind/tensor.cc
+1
-1
paddle/fluid/pybind/tensor_py.h
paddle/fluid/pybind/tensor_py.h
+1
-2
paddle/phi/common/backend.h
paddle/phi/common/backend.h
+0
-7
paddle/phi/common/place.cc
paddle/phi/common/place.cc
+0
-2
paddle/phi/core/compat/convert_utils.cc
paddle/phi/core/compat/convert_utils.cc
+0
-2
python/paddle/distributed/spawn.py
python/paddle/distributed/spawn.py
+0
-2
python/paddle/nn/functional/loss.py
python/paddle/nn/functional/loss.py
+1
-3
python/paddle/profiler/profiler.py
python/paddle/profiler/profiler.py
+0
-2
tools/get_pr_ut.py
tools/get_pr_ut.py
+0
-1
未找到文件。
cmake/operators.cmake
浏览文件 @
4d5a3ad6
...
@@ -62,7 +62,6 @@ function(op_library TARGET)
...
@@ -62,7 +62,6 @@ function(op_library TARGET)
set
(
hip_cc_srcs
)
set
(
hip_cc_srcs
)
set
(
xpu_cc_srcs
)
set
(
xpu_cc_srcs
)
set
(
xpu_kp_cc_srcs
)
set
(
xpu_kp_cc_srcs
)
set
(
mlu_cc_srcs
)
set
(
cudnn_cu_cc_srcs
)
set
(
cudnn_cu_cc_srcs
)
set
(
miopen_cu_cc_srcs
)
set
(
miopen_cu_cc_srcs
)
set
(
cudnn_cu_srcs
)
set
(
cudnn_cu_srcs
)
...
@@ -307,9 +306,8 @@ function(op_library TARGET)
...
@@ -307,9 +306,8 @@ function(op_library TARGET)
# Unity Build relies on global option `WITH_UNITY_BUILD` and local option `UNITY`.
# Unity Build relies on global option `WITH_UNITY_BUILD` and local option `UNITY`.
if
(
WITH_UNITY_BUILD AND op_library_UNITY
)
if
(
WITH_UNITY_BUILD AND op_library_UNITY
)
# Combine the cc source files.
# Combine the cc source files.
compose_unity_target_sources
(
compose_unity_target_sources
(
${
UNITY_TARGET
}
cc
${
cc_srcs
}
${
UNITY_TARGET
}
cc
${
cc_srcs
}
${
mkldnn_cc_srcs
}
${
xpu_cc_srcs
}
${
mkldnn_cc_srcs
}
${
xpu_cc_srcs
}
)
${
mlu_cc_srcs
}
)
if
(
TARGET
${
UNITY_TARGET
}
)
if
(
TARGET
${
UNITY_TARGET
}
)
# If `UNITY_TARGET` exists, add source files to `UNITY_TARGET`.
# If `UNITY_TARGET` exists, add source files to `UNITY_TARGET`.
target_sources
(
${
UNITY_TARGET
}
PRIVATE
${
unity_target_cc_sources
}
)
target_sources
(
${
UNITY_TARGET
}
PRIVATE
${
unity_target_cc_sources
}
)
...
@@ -325,7 +323,7 @@ function(op_library TARGET)
...
@@ -325,7 +323,7 @@ function(op_library TARGET)
else
()
else
()
cc_library
(
cc_library
(
${
TARGET
}
${
TARGET
}
SRCS
${
cc_srcs
}
${
mkldnn_cc_srcs
}
${
xpu_cc_srcs
}
${
mlu_cc_srcs
}
SRCS
${
cc_srcs
}
${
mkldnn_cc_srcs
}
${
xpu_cc_srcs
}
DEPS
${
op_library_DEPS
}
${
op_common_deps
}
)
DEPS
${
op_library_DEPS
}
${
op_common_deps
}
)
endif
()
endif
()
endif
()
endif
()
...
@@ -337,7 +335,6 @@ function(op_library TARGET)
...
@@ -337,7 +335,6 @@ function(op_library TARGET)
list
(
LENGTH mkldnn_cc_srcs mkldnn_cc_srcs_len
)
list
(
LENGTH mkldnn_cc_srcs mkldnn_cc_srcs_len
)
list
(
LENGTH xpu_cc_srcs xpu_cc_srcs_len
)
list
(
LENGTH xpu_cc_srcs xpu_cc_srcs_len
)
list
(
LENGTH miopen_cu_cc_srcs miopen_cu_cc_srcs_len
)
list
(
LENGTH miopen_cu_cc_srcs miopen_cu_cc_srcs_len
)
list
(
LENGTH mlu_cc_srcs mlu_cc_srcs_len
)
# Define operators that don't need pybind here.
# Define operators that don't need pybind here.
foreach
(
foreach
(
...
@@ -562,7 +559,6 @@ function(register_operators)
...
@@ -562,7 +559,6 @@ function(register_operators)
"*_op.cc"
)
"*_op.cc"
)
string
(
REPLACE
"_mkldnn"
""
OPS
"
${
OPS
}
"
)
string
(
REPLACE
"_mkldnn"
""
OPS
"
${
OPS
}
"
)
string
(
REPLACE
"_xpu"
""
OPS
"
${
OPS
}
"
)
string
(
REPLACE
"_xpu"
""
OPS
"
${
OPS
}
"
)
string
(
REPLACE
"_mlu"
""
OPS
"
${
OPS
}
"
)
string
(
REPLACE
".cc"
""
OPS
"
${
OPS
}
"
)
string
(
REPLACE
".cc"
""
OPS
"
${
OPS
}
"
)
list
(
REMOVE_DUPLICATES OPS
)
list
(
REMOVE_DUPLICATES OPS
)
list
(
LENGTH register_operators_DEPS register_operators_DEPS_len
)
list
(
LENGTH register_operators_DEPS register_operators_DEPS_len
)
...
...
paddle/fluid/eager/amp_auto_cast.h
浏览文件 @
4d5a3ad6
...
@@ -27,7 +27,6 @@ static inline bool NeedCast(const paddle::Tensor& tensor,
...
@@ -27,7 +27,6 @@ static inline bool NeedCast(const paddle::Tensor& tensor,
if
(
paddle
::
platform
::
is_gpu_place
(
place
)
||
if
(
paddle
::
platform
::
is_gpu_place
(
place
)
||
paddle
::
platform
::
is_cuda_pinned_place
(
place
)
||
paddle
::
platform
::
is_cuda_pinned_place
(
place
)
||
paddle
::
platform
::
is_xpu_place
(
place
)
||
paddle
::
platform
::
is_xpu_place
(
place
)
||
paddle
::
platform
::
is_mlu_place
(
place
)
||
paddle
::
platform
::
is_npu_place
(
place
)
||
paddle
::
platform
::
is_npu_place
(
place
)
||
paddle
::
platform
::
is_npu_pinned_place
(
place
)
||
paddle
::
platform
::
is_npu_pinned_place
(
place
)
||
paddle
::
platform
::
is_custom_place
(
place
))
{
paddle
::
platform
::
is_custom_place
(
place
))
{
...
...
paddle/fluid/eager/amp_utils.h
浏览文件 @
4d5a3ad6
...
@@ -96,7 +96,6 @@ inline phi::DataType GetDtypeWithPlace(
...
@@ -96,7 +96,6 @@ inline phi::DataType GetDtypeWithPlace(
is_right_place
=
(
paddle
::
platform
::
is_gpu_place
(
place
)
||
is_right_place
=
(
paddle
::
platform
::
is_gpu_place
(
place
)
||
paddle
::
platform
::
is_cuda_pinned_place
(
place
)
||
paddle
::
platform
::
is_cuda_pinned_place
(
place
)
||
paddle
::
platform
::
is_xpu_place
(
place
)
||
paddle
::
platform
::
is_xpu_place
(
place
)
||
paddle
::
platform
::
is_mlu_place
(
place
)
||
paddle
::
platform
::
is_npu_place
(
place
)
||
paddle
::
platform
::
is_npu_place
(
place
)
||
paddle
::
platform
::
is_npu_pinned_place
(
place
)
||
paddle
::
platform
::
is_npu_pinned_place
(
place
)
||
paddle
::
platform
::
is_custom_place
(
place
));
paddle
::
platform
::
is_custom_place
(
place
));
...
...
paddle/fluid/eager/eager_amp_auto_cast.h
浏览文件 @
4d5a3ad6
...
@@ -27,7 +27,6 @@ static inline bool NeedCast(const paddle::Tensor& tensor,
...
@@ -27,7 +27,6 @@ static inline bool NeedCast(const paddle::Tensor& tensor,
if
(
paddle
::
platform
::
is_gpu_place
(
place
)
||
if
(
paddle
::
platform
::
is_gpu_place
(
place
)
||
paddle
::
platform
::
is_cuda_pinned_place
(
place
)
||
paddle
::
platform
::
is_cuda_pinned_place
(
place
)
||
paddle
::
platform
::
is_xpu_place
(
place
)
||
paddle
::
platform
::
is_xpu_place
(
place
)
||
paddle
::
platform
::
is_mlu_place
(
place
)
||
paddle
::
platform
::
is_npu_place
(
place
)
||
paddle
::
platform
::
is_npu_place
(
place
)
||
paddle
::
platform
::
is_npu_pinned_place
(
place
)
||
paddle
::
platform
::
is_npu_pinned_place
(
place
)
||
paddle
::
platform
::
is_custom_place
(
place
)
||
paddle
::
platform
::
is_custom_place
(
place
)
||
...
...
paddle/fluid/framework/library_type.h
浏览文件 @
4d5a3ad6
...
@@ -72,8 +72,6 @@ inline LibraryType StringToLibraryType(const char* ctype) {
...
@@ -72,8 +72,6 @@ inline LibraryType StringToLibraryType(const char* ctype) {
return
LibraryType
::
kPlain
;
return
LibraryType
::
kPlain
;
}
else
if
(
s
==
std
::
string
(
"CUDA"
))
{
}
else
if
(
s
==
std
::
string
(
"CUDA"
))
{
return
LibraryType
::
kPlain
;
return
LibraryType
::
kPlain
;
}
else
if
(
s
==
std
::
string
(
"MLU"
))
{
return
LibraryType
::
kPlain
;
}
else
{
}
else
{
PADDLE_THROW
(
platform
::
errors
::
Unimplemented
(
PADDLE_THROW
(
platform
::
errors
::
Unimplemented
(
"Unknown LibraryType string (%s), only support library type string "
"Unknown LibraryType string (%s), only support library type string "
...
...
paddle/fluid/framework/tensor_util.cc
浏览文件 @
4d5a3ad6
...
@@ -276,7 +276,6 @@ void TensorCopyImpl(const TENSOR& src,
...
@@ -276,7 +276,6 @@ void TensorCopyImpl(const TENSOR& src,
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
const
platform
::
DeviceContext
*
dev_ctx
;
const
platform
::
DeviceContext
*
dev_ctx
;
if
(
platform
::
is_gpu_place
(
dst_place
)
||
platform
::
is_npu_place
(
dst_place
)
||
if
(
platform
::
is_gpu_place
(
dst_place
)
||
platform
::
is_npu_place
(
dst_place
)
||
platform
::
is_mlu_place
(
dst_place
)
||
platform
::
is_custom_place
(
dst_place
))
{
platform
::
is_custom_place
(
dst_place
))
{
dev_ctx
=
pool
.
Get
(
dst_place
);
dev_ctx
=
pool
.
Get
(
dst_place
);
}
else
{
}
else
{
...
@@ -615,7 +614,6 @@ void TensorFromStream(std::istream& is,
...
@@ -615,7 +614,6 @@ void TensorFromStream(std::istream& is,
size_t
size
=
tensor
->
numel
()
*
framework
::
SizeOfType
(
desc
.
data_type
());
size_t
size
=
tensor
->
numel
()
*
framework
::
SizeOfType
(
desc
.
data_type
());
if
(
platform
::
is_gpu_place
(
dev_ctx
.
GetPlace
())
||
if
(
platform
::
is_gpu_place
(
dev_ctx
.
GetPlace
())
||
platform
::
is_xpu_place
(
dev_ctx
.
GetPlace
())
||
platform
::
is_xpu_place
(
dev_ctx
.
GetPlace
())
||
platform
::
is_mlu_place
(
dev_ctx
.
GetPlace
())
||
platform
::
is_npu_place
(
dev_ctx
.
GetPlace
())
||
platform
::
is_npu_place
(
dev_ctx
.
GetPlace
())
||
platform
::
is_custom_place
(
dev_ctx
.
GetPlace
()))
{
platform
::
is_custom_place
(
dev_ctx
.
GetPlace
()))
{
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) || \
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) || \
...
@@ -691,7 +689,6 @@ void TensorFromStream(std::istream& is,
...
@@ -691,7 +689,6 @@ void TensorFromStream(std::istream& is,
size_t
size
=
tensor
->
numel
()
*
framework
::
SizeOfType
(
desc
.
data_type
());
size_t
size
=
tensor
->
numel
()
*
framework
::
SizeOfType
(
desc
.
data_type
());
if
(
platform
::
is_gpu_place
(
dev_ctx
.
GetPlace
())
||
if
(
platform
::
is_gpu_place
(
dev_ctx
.
GetPlace
())
||
platform
::
is_xpu_place
(
dev_ctx
.
GetPlace
())
||
platform
::
is_xpu_place
(
dev_ctx
.
GetPlace
())
||
platform
::
is_mlu_place
(
dev_ctx
.
GetPlace
())
||
platform
::
is_npu_place
(
dev_ctx
.
GetPlace
())
||
platform
::
is_npu_place
(
dev_ctx
.
GetPlace
())
||
platform
::
is_custom_place
(
dev_ctx
.
GetPlace
()))
{
platform
::
is_custom_place
(
dev_ctx
.
GetPlace
()))
{
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) || \
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) || \
...
...
paddle/fluid/imperative/CMakeLists.txt
浏览文件 @
4d5a3ad6
...
@@ -166,5 +166,4 @@ cc_library(
...
@@ -166,5 +166,4 @@ cc_library(
var_type_traits
var_type_traits
layer
layer
math_function
math_function
phi_tensor
phi_tensor
)
${
MLU_DEPS
}
)
paddle/fluid/imperative/amp_auto_cast.cc
浏览文件 @
4d5a3ad6
...
@@ -52,7 +52,6 @@ OpSupportedInfos(const std::string& place,
...
@@ -52,7 +52,6 @@ OpSupportedInfos(const std::string& place,
{
"CPU"
,
&
platform
::
is_cpu_place
},
{
"CPU"
,
&
platform
::
is_cpu_place
},
{
"XPU"
,
&
platform
::
is_xpu_place
},
{
"XPU"
,
&
platform
::
is_xpu_place
},
{
"NPU"
,
&
platform
::
is_npu_place
},
{
"NPU"
,
&
platform
::
is_npu_place
},
{
"MLU"
,
&
platform
::
is_mlu_place
},
};
};
PADDLE_ENFORCE_NE
(
is_target_place
.
count
(
query_place
),
PADDLE_ENFORCE_NE
(
is_target_place
.
count
(
query_place
),
0
,
0
,
...
@@ -245,7 +244,6 @@ inline bool NeedCast(const std::shared_ptr<VarType>& var) {
...
@@ -245,7 +244,6 @@ inline bool NeedCast(const std::shared_ptr<VarType>& var) {
if
(
paddle
::
platform
::
is_gpu_place
(
place
)
||
if
(
paddle
::
platform
::
is_gpu_place
(
place
)
||
paddle
::
platform
::
is_cuda_pinned_place
(
place
)
||
paddle
::
platform
::
is_cuda_pinned_place
(
place
)
||
paddle
::
platform
::
is_xpu_place
(
place
)
||
paddle
::
platform
::
is_xpu_place
(
place
)
||
paddle
::
platform
::
is_mlu_place
(
place
)
||
paddle
::
platform
::
is_custom_place
(
place
)
||
paddle
::
platform
::
is_custom_place
(
place
)
||
paddle
::
platform
::
is_npu_place
(
place
)
||
paddle
::
platform
::
is_npu_place
(
place
)
||
paddle
::
platform
::
is_npu_pinned_place
(
place
))
{
paddle
::
platform
::
is_npu_pinned_place
(
place
))
{
...
...
paddle/fluid/imperative/reducer.cc
浏览文件 @
4d5a3ad6
...
@@ -66,9 +66,6 @@ void Group::DivNRanks(const platform::DeviceContext &context, int64_t nranks) {
...
@@ -66,9 +66,6 @@ void Group::DivNRanks(const platform::DeviceContext &context, int64_t nranks) {
#ifdef PADDLE_WITH_XPU_BKCL
#ifdef PADDLE_WITH_XPU_BKCL
// TODO(liuyuhui) support xpu about div nranks in the future
// TODO(liuyuhui) support xpu about div nranks in the future
#endif
#endif
}
else
if
(
platform
::
is_mlu_place
(
tensor
->
place
()))
{
// TODO(zhangna)
VLOG
(
4
)
<<
"divnrank for mlu not support yet"
;
}
}
}
}
...
...
paddle/fluid/operators/collective/c_comm_init_op.cc
浏览文件 @
4d5a3ad6
...
@@ -61,8 +61,7 @@ class CCommInitOp : public framework::OperatorBase {
...
@@ -61,8 +61,7 @@ class CCommInitOp : public framework::OperatorBase {
#endif
#endif
PADDLE_ENFORCE_EQ
(
PADDLE_ENFORCE_EQ
(
platform
::
is_gpu_place
(
place
)
||
platform
::
is_xpu_place
(
place
)
||
platform
::
is_gpu_place
(
place
)
||
platform
::
is_xpu_place
(
place
),
platform
::
is_mlu_place
(
place
),
true
,
true
,
platform
::
errors
::
PreconditionNotMet
(
platform
::
errors
::
PreconditionNotMet
(
"CCommInitOp can run on gpu or xpu or mlu place only."
));
"CCommInitOp can run on gpu or xpu or mlu place only."
));
...
...
paddle/fluid/operators/generator/get_expected_kernel_func.cc
浏览文件 @
4d5a3ad6
...
@@ -76,7 +76,6 @@ phi::KernelKey GetReduceExpectedKernelType(
...
@@ -76,7 +76,6 @@ phi::KernelKey GetReduceExpectedKernelType(
PADDLE_ENFORCE_EQ
(
PADDLE_ENFORCE_EQ
(
platform
::
is_gpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_gpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_npu_place
(
ctx
.
GetPlace
())
||
platform
::
is_npu_place
(
ctx
.
GetPlace
())
||
platform
::
is_mlu_place
(
ctx
.
GetPlace
())
||
platform
::
is_xpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_xpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_custom_place
(
ctx
.
GetPlace
()),
platform
::
is_custom_place
(
ctx
.
GetPlace
()),
true
,
true
,
...
...
paddle/fluid/operators/interpolate_op.h
浏览文件 @
4d5a3ad6
...
@@ -41,8 +41,7 @@ inline std::vector<int> get_new_shape(
...
@@ -41,8 +41,7 @@ inline std::vector<int> get_new_shape(
"The shape of dimension tensor should be [1],"
"The shape of dimension tensor should be [1],"
"but received d%."
,
"but received d%."
,
tensor
->
dims
()));
tensor
->
dims
()));
if
(
platform
::
is_gpu_place
(
tensor
->
place
())
||
if
(
platform
::
is_gpu_place
(
tensor
->
place
()))
{
platform
::
is_mlu_place
(
tensor
->
place
()))
{
phi
::
DenseTensor
temp
;
phi
::
DenseTensor
temp
;
paddle
::
framework
::
TensorCopySync
(
*
tensor
,
platform
::
CPUPlace
(),
&
temp
);
paddle
::
framework
::
TensorCopySync
(
*
tensor
,
platform
::
CPUPlace
(),
&
temp
);
vec_new_shape
.
push_back
(
static_cast
<
int32_t
>
(
*
temp
.
data
<
int32_t
>
()));
vec_new_shape
.
push_back
(
static_cast
<
int32_t
>
(
*
temp
.
data
<
int32_t
>
()));
...
@@ -60,8 +59,7 @@ inline std::vector<T> get_new_data_from_tensor(
...
@@ -60,8 +59,7 @@ inline std::vector<T> get_new_data_from_tensor(
std
::
vector
<
T
>
vec_new_data
;
std
::
vector
<
T
>
vec_new_data
;
auto
*
new_data
=
new_data_tensor
->
data
<
T
>
();
auto
*
new_data
=
new_data_tensor
->
data
<
T
>
();
phi
::
DenseTensor
cpu_starts_tensor
;
phi
::
DenseTensor
cpu_starts_tensor
;
if
(
platform
::
is_gpu_place
(
new_data_tensor
->
place
())
||
if
(
platform
::
is_gpu_place
(
new_data_tensor
->
place
()))
{
platform
::
is_mlu_place
(
new_data_tensor
->
place
()))
{
paddle
::
framework
::
TensorCopySync
(
paddle
::
framework
::
TensorCopySync
(
*
new_data_tensor
,
platform
::
CPUPlace
(),
&
cpu_starts_tensor
);
*
new_data_tensor
,
platform
::
CPUPlace
(),
&
cpu_starts_tensor
);
new_data
=
cpu_starts_tensor
.
data
<
T
>
();
new_data
=
cpu_starts_tensor
.
data
<
T
>
();
...
...
paddle/fluid/operators/reader/buffered_reader.cc
浏览文件 @
4d5a3ad6
...
@@ -99,7 +99,6 @@ BufferedReader::BufferedReader(
...
@@ -99,7 +99,6 @@ BufferedReader::BufferedReader(
cpu_buffer_
.
resize
(
buffer_size
);
cpu_buffer_
.
resize
(
buffer_size
);
cuda_buffer_
.
resize
(
buffer_size
);
cuda_buffer_
.
resize
(
buffer_size
);
npu_buffer_
.
resize
(
buffer_size
);
npu_buffer_
.
resize
(
buffer_size
);
mlu_buffer_
.
resize
(
buffer_size
);
xpu_buffer_
.
resize
(
buffer_size
);
xpu_buffer_
.
resize
(
buffer_size
);
custom_device_buffer_
.
resize
(
buffer_size
);
custom_device_buffer_
.
resize
(
buffer_size
);
ReadTillBufferFullAsync
();
ReadTillBufferFullAsync
();
...
@@ -387,8 +386,6 @@ void BufferedReader::ReadNextImpl(paddle::framework::LoDTensorArray *out) {
...
@@ -387,8 +386,6 @@ void BufferedReader::ReadNextImpl(paddle::framework::LoDTensorArray *out) {
*
out
=
std
::
move
(
cuda_buffer_
[
i
]);
*
out
=
std
::
move
(
cuda_buffer_
[
i
]);
}
else
if
(
platform
::
is_npu_place
(
place_
))
{
}
else
if
(
platform
::
is_npu_place
(
place_
))
{
*
out
=
std
::
move
(
npu_buffer_
[
i
]);
*
out
=
std
::
move
(
npu_buffer_
[
i
]);
}
else
if
(
platform
::
is_mlu_place
(
place_
))
{
*
out
=
std
::
move
(
mlu_buffer_
[
i
]);
}
else
if
(
platform
::
is_xpu_place
(
place_
))
{
}
else
if
(
platform
::
is_xpu_place
(
place_
))
{
*
out
=
std
::
move
(
xpu_buffer_
[
i
]);
*
out
=
std
::
move
(
xpu_buffer_
[
i
]);
}
else
if
(
platform
::
is_custom_place
(
place_
))
{
}
else
if
(
platform
::
is_custom_place
(
place_
))
{
...
...
paddle/fluid/operators/reader/buffered_reader.h
浏览文件 @
4d5a3ad6
...
@@ -78,7 +78,6 @@ class BufferedReader : public framework::DecoratedReader {
...
@@ -78,7 +78,6 @@ class BufferedReader : public framework::DecoratedReader {
std
::
vector
<
TensorVec
>
cpu_buffer_
;
std
::
vector
<
TensorVec
>
cpu_buffer_
;
std
::
vector
<
TensorVec
>
cuda_buffer_
;
std
::
vector
<
TensorVec
>
cuda_buffer_
;
std
::
vector
<
TensorVec
>
npu_buffer_
;
std
::
vector
<
TensorVec
>
npu_buffer_
;
std
::
vector
<
TensorVec
>
mlu_buffer_
;
std
::
vector
<
TensorVec
>
xpu_buffer_
;
std
::
vector
<
TensorVec
>
xpu_buffer_
;
std
::
vector
<
TensorVec
>
custom_device_buffer_
;
std
::
vector
<
TensorVec
>
custom_device_buffer_
;
size_t
prev_pos_
{
-
1UL
};
size_t
prev_pos_
{
-
1UL
};
...
...
paddle/fluid/operators/reduce_ops/reduce_op.h
浏览文件 @
4d5a3ad6
...
@@ -625,7 +625,6 @@ class ReduceBaseOp : public framework::OperatorWithKernel {
...
@@ -625,7 +625,6 @@ class ReduceBaseOp : public framework::OperatorWithKernel {
PADDLE_ENFORCE_EQ
(
PADDLE_ENFORCE_EQ
(
platform
::
is_gpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_gpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_npu_place
(
ctx
.
GetPlace
())
||
platform
::
is_npu_place
(
ctx
.
GetPlace
())
||
platform
::
is_mlu_place
(
ctx
.
GetPlace
())
||
platform
::
is_xpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_xpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_custom_place
(
ctx
.
GetPlace
()),
platform
::
is_custom_place
(
ctx
.
GetPlace
()),
true
,
true
,
...
...
paddle/fluid/operators/softmax_op.cc
浏览文件 @
4d5a3ad6
...
@@ -45,7 +45,6 @@ class SoftmaxOp : public framework::OperatorWithKernel {
...
@@ -45,7 +45,6 @@ class SoftmaxOp : public framework::OperatorWithKernel {
platform
::
is_gpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_gpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_npu_place
(
ctx
.
GetPlace
())
||
platform
::
is_npu_place
(
ctx
.
GetPlace
())
||
platform
::
is_xpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_xpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_mlu_place
(
ctx
.
GetPlace
())
||
platform
::
is_custom_place
(
ctx
.
GetPlace
()),
platform
::
is_custom_place
(
ctx
.
GetPlace
()),
true
,
true
,
platform
::
errors
::
InvalidArgument
(
platform
::
errors
::
InvalidArgument
(
...
@@ -131,7 +130,6 @@ class SoftmaxOpGrad : public framework::OperatorWithKernel {
...
@@ -131,7 +130,6 @@ class SoftmaxOpGrad : public framework::OperatorWithKernel {
if
(
!
(
platform
::
is_gpu_place
(
ctx
.
GetPlace
())
||
if
(
!
(
platform
::
is_gpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_npu_place
(
ctx
.
GetPlace
())
||
platform
::
is_npu_place
(
ctx
.
GetPlace
())
||
platform
::
is_xpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_xpu_place
(
ctx
.
GetPlace
())
||
platform
::
is_mlu_place
(
ctx
.
GetPlace
())
||
platform
::
is_custom_place
(
ctx
.
GetPlace
())))
platform
::
is_custom_place
(
ctx
.
GetPlace
())))
PADDLE_THROW
(
platform
::
errors
::
InvalidArgument
(
PADDLE_THROW
(
platform
::
errors
::
InvalidArgument
(
"float16 can only be used on GPU/NPU/XPU/MLU and custom place"
));
"float16 can only be used on GPU/NPU/XPU/MLU and custom place"
));
...
...
paddle/fluid/operators/tile_op_functor.h
浏览文件 @
4d5a3ad6
...
@@ -30,7 +30,6 @@ inline std::vector<int> get_repeat_times(
...
@@ -30,7 +30,6 @@ inline std::vector<int> get_repeat_times(
phi
::
DenseTensor
cpu_repeat_tensor
;
phi
::
DenseTensor
cpu_repeat_tensor
;
if
(
platform
::
is_gpu_place
(
repeat_tensor
->
place
())
||
if
(
platform
::
is_gpu_place
(
repeat_tensor
->
place
())
||
platform
::
is_xpu_place
(
repeat_tensor
->
place
())
||
platform
::
is_xpu_place
(
repeat_tensor
->
place
())
||
platform
::
is_mlu_place
(
repeat_tensor
->
place
())
||
platform
::
is_npu_place
(
repeat_tensor
->
place
()))
{
platform
::
is_npu_place
(
repeat_tensor
->
place
()))
{
paddle
::
framework
::
TensorCopySync
(
paddle
::
framework
::
TensorCopySync
(
*
repeat_tensor
,
platform
::
CPUPlace
(),
&
cpu_repeat_tensor
);
*
repeat_tensor
,
platform
::
CPUPlace
(),
&
cpu_repeat_tensor
);
...
@@ -50,7 +49,6 @@ inline std::vector<int> get_repeat_times(
...
@@ -50,7 +49,6 @@ inline std::vector<int> get_repeat_times(
auto
tensor
=
list_repeat_times_tensor
[
i
];
auto
tensor
=
list_repeat_times_tensor
[
i
];
if
(
platform
::
is_gpu_place
(
tensor
->
place
())
||
if
(
platform
::
is_gpu_place
(
tensor
->
place
())
||
platform
::
is_xpu_place
(
tensor
->
place
())
||
platform
::
is_xpu_place
(
tensor
->
place
())
||
platform
::
is_mlu_place
(
tensor
->
place
())
||
platform
::
is_npu_place
(
tensor
->
place
()))
{
platform
::
is_npu_place
(
tensor
->
place
()))
{
phi
::
DenseTensor
temp
;
phi
::
DenseTensor
temp
;
paddle
::
framework
::
TensorCopySync
(
*
tensor
,
platform
::
CPUPlace
(),
&
temp
);
paddle
::
framework
::
TensorCopySync
(
*
tensor
,
platform
::
CPUPlace
(),
&
temp
);
...
...
paddle/fluid/platform/CMakeLists.txt
浏览文件 @
4d5a3ad6
...
@@ -129,7 +129,6 @@ cc_library(
...
@@ -129,7 +129,6 @@ cc_library(
dlpack
dlpack
cudnn_workspace_helper
cudnn_workspace_helper
${
XPU_CTX_DEPS
}
${
XPU_CTX_DEPS
}
${
MLU_CTX_DEPS
}
phi_backends
phi_backends
phi_device_context
phi_device_context
generator
generator
...
...
paddle/fluid/platform/device_context.cc
浏览文件 @
4d5a3ad6
...
@@ -47,8 +47,6 @@ DeviceType Place2DeviceType(const platform::Place& place) {
...
@@ -47,8 +47,6 @@ DeviceType Place2DeviceType(const platform::Place& place) {
return
platform
::
DeviceType
::
IPU
;
return
platform
::
DeviceType
::
IPU
;
}
else
if
(
platform
::
is_npu_place
(
place
))
{
}
else
if
(
platform
::
is_npu_place
(
place
))
{
return
platform
::
DeviceType
::
NPU
;
return
platform
::
DeviceType
::
NPU
;
}
else
if
(
platform
::
is_mlu_place
(
place
))
{
return
platform
::
DeviceType
::
MLU
;
}
else
if
(
platform
::
is_custom_place
(
place
))
{
}
else
if
(
platform
::
is_custom_place
(
place
))
{
return
platform
::
DeviceType
::
CUSTOM_DEVICE
;
return
platform
::
DeviceType
::
CUSTOM_DEVICE
;
}
else
{
}
else
{
...
...
paddle/fluid/platform/device_context.h
浏览文件 @
4d5a3ad6
...
@@ -109,7 +109,6 @@ constexpr DeviceType kCUDA = DeviceType::CUDA;
...
@@ -109,7 +109,6 @@ constexpr DeviceType kCUDA = DeviceType::CUDA;
constexpr
DeviceType
kXPU
=
DeviceType
::
XPU
;
constexpr
DeviceType
kXPU
=
DeviceType
::
XPU
;
constexpr
DeviceType
kNPU
=
DeviceType
::
NPU
;
constexpr
DeviceType
kNPU
=
DeviceType
::
NPU
;
constexpr
DeviceType
kIPU
=
DeviceType
::
IPU
;
constexpr
DeviceType
kIPU
=
DeviceType
::
IPU
;
constexpr
DeviceType
kMLU
=
DeviceType
::
MLU
;
constexpr
DeviceType
kCUSTOM_DEVICE
=
DeviceType
::
CUSTOM_DEVICE
;
constexpr
DeviceType
kCUSTOM_DEVICE
=
DeviceType
::
CUSTOM_DEVICE
;
using
DeviceContext
=
phi
::
DeviceContext
;
using
DeviceContext
=
phi
::
DeviceContext
;
...
...
paddle/fluid/platform/monitor.cc
浏览文件 @
4d5a3ad6
...
@@ -46,21 +46,3 @@ DEFINE_INT_STATUS(STAT_npu4_mem_size)
...
@@ -46,21 +46,3 @@ DEFINE_INT_STATUS(STAT_npu4_mem_size)
DEFINE_INT_STATUS
(
STAT_npu5_mem_size
)
DEFINE_INT_STATUS
(
STAT_npu5_mem_size
)
DEFINE_INT_STATUS
(
STAT_npu6_mem_size
)
DEFINE_INT_STATUS
(
STAT_npu6_mem_size
)
DEFINE_INT_STATUS
(
STAT_npu7_mem_size
)
DEFINE_INT_STATUS
(
STAT_npu7_mem_size
)
// For MLU
DEFINE_INT_STATUS
(
STAT_mlu0_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu1_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu2_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu3_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu4_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu5_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu6_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu7_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu8_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu9_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu10_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu11_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu12_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu13_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu14_mem_size
)
DEFINE_INT_STATUS
(
STAT_mlu15_mem_size
)
paddle/fluid/platform/monitor.h
浏览文件 @
4d5a3ad6
...
@@ -200,21 +200,3 @@ class StatRegistry {
...
@@ -200,21 +200,3 @@ class StatRegistry {
USE_INT_STAT(STAT_npu5_mem_size); \
USE_INT_STAT(STAT_npu5_mem_size); \
USE_INT_STAT(STAT_npu6_mem_size); \
USE_INT_STAT(STAT_npu6_mem_size); \
USE_INT_STAT(STAT_npu7_mem_size)
USE_INT_STAT(STAT_npu7_mem_size)
#define USE_MLU_MEM_STAT \
USE_INT_STAT(STAT_mlu0_mem_size); \
USE_INT_STAT(STAT_mlu1_mem_size); \
USE_INT_STAT(STAT_mlu2_mem_size); \
USE_INT_STAT(STAT_mlu3_mem_size); \
USE_INT_STAT(STAT_mlu4_mem_size); \
USE_INT_STAT(STAT_mlu5_mem_size); \
USE_INT_STAT(STAT_mlu6_mem_size); \
USE_INT_STAT(STAT_mlu7_mem_size); \
USE_INT_STAT(STAT_mlu8_mem_size); \
USE_INT_STAT(STAT_mlu9_mem_size); \
USE_INT_STAT(STAT_mlu10_mem_size); \
USE_INT_STAT(STAT_mlu11_mem_size); \
USE_INT_STAT(STAT_mlu12_mem_size); \
USE_INT_STAT(STAT_mlu13_mem_size); \
USE_INT_STAT(STAT_mlu14_mem_size); \
USE_INT_STAT(STAT_mlu15_mem_size)
paddle/fluid/platform/place.cc
浏览文件 @
4d5a3ad6
...
@@ -33,10 +33,6 @@ bool is_xpu_place(const Place &p) {
...
@@ -33,10 +33,6 @@ bool is_xpu_place(const Place &p) {
return
p
.
GetType
()
==
phi
::
AllocationType
::
XPU
;
return
p
.
GetType
()
==
phi
::
AllocationType
::
XPU
;
}
}
bool
is_mlu_place
(
const
Place
&
p
)
{
return
p
.
GetType
()
==
phi
::
AllocationType
::
MLU
;
}
bool
is_npu_place
(
const
Place
&
p
)
{
bool
is_npu_place
(
const
Place
&
p
)
{
return
p
.
GetType
()
==
phi
::
AllocationType
::
NPU
;
return
p
.
GetType
()
==
phi
::
AllocationType
::
NPU
;
}
}
...
@@ -77,8 +73,6 @@ bool is_same_place(const Place &p1, const Place &p2) {
...
@@ -77,8 +73,6 @@ bool is_same_place(const Place &p1, const Place &p2) {
return
true
;
return
true
;
}
else
if
(
is_xpu_place
(
p1
))
{
}
else
if
(
is_xpu_place
(
p1
))
{
return
p1
==
p2
;
return
p1
==
p2
;
}
else
if
(
is_mlu_place
(
p1
))
{
return
p1
==
p2
;
}
else
if
(
is_npu_place
(
p1
))
{
}
else
if
(
is_npu_place
(
p1
))
{
return
p1
==
p2
;
return
p1
==
p2
;
}
else
if
(
is_ipu_place
(
p1
))
{
}
else
if
(
is_ipu_place
(
p1
))
{
...
...
paddle/fluid/platform/place.h
浏览文件 @
4d5a3ad6
...
@@ -48,7 +48,6 @@ class PlaceHelper {
...
@@ -48,7 +48,6 @@ class PlaceHelper {
bool
is_gpu_place
(
const
Place
&
);
bool
is_gpu_place
(
const
Place
&
);
bool
is_xpu_place
(
const
Place
&
);
bool
is_xpu_place
(
const
Place
&
);
bool
is_npu_place
(
const
Place
&
);
bool
is_npu_place
(
const
Place
&
);
bool
is_mlu_place
(
const
Place
&
);
bool
is_ipu_place
(
const
Place
&
);
bool
is_ipu_place
(
const
Place
&
);
bool
is_cpu_place
(
const
Place
&
);
bool
is_cpu_place
(
const
Place
&
);
bool
is_cuda_pinned_place
(
const
Place
&
);
bool
is_cuda_pinned_place
(
const
Place
&
);
...
...
paddle/fluid/platform/profiler/chrometracing_logger.cc
浏览文件 @
4d5a3ad6
...
@@ -257,7 +257,6 @@ void ChromeTracingLogger::LogHostTraceEventNode(
...
@@ -257,7 +257,6 @@ void ChromeTracingLogger::LogHostTraceEventNode(
case
TracerEventType
::
UserDefined
:
case
TracerEventType
::
UserDefined
:
case
TracerEventType
::
OperatorInner
:
case
TracerEventType
::
OperatorInner
:
case
TracerEventType
::
Communication
:
case
TracerEventType
::
Communication
:
case
TracerEventType
::
MluRuntime
:
case
TracerEventType
::
NumTypes
:
case
TracerEventType
::
NumTypes
:
default:
default:
output_file_stream_
<<
string_format
(
output_file_stream_
<<
string_format
(
...
...
paddle/fluid/platform/profiler/profiler.h
浏览文件 @
4d5a3ad6
...
@@ -34,7 +34,6 @@ namespace platform {
...
@@ -34,7 +34,6 @@ namespace platform {
static
constexpr
uint32_t
kProfileCPUOptionBit
=
0
;
static
constexpr
uint32_t
kProfileCPUOptionBit
=
0
;
static
constexpr
uint32_t
kProfileGPUOptionBit
=
1
;
static
constexpr
uint32_t
kProfileGPUOptionBit
=
1
;
static
constexpr
uint32_t
kProfileMLUOptionBit
=
2
;
static
constexpr
uint32_t
kProfileCustomDeviceOptionBit
=
3
;
static
constexpr
uint32_t
kProfileCustomDeviceOptionBit
=
3
;
void
SynchronizeDevice
();
void
SynchronizeDevice
();
...
...
paddle/fluid/platform/profiler/utils.cc
浏览文件 @
4d5a3ad6
...
@@ -165,8 +165,7 @@ const char* StringTracerEventType(TracerEventType type) {
...
@@ -165,8 +165,7 @@ const char* StringTracerEventType(TracerEventType type) {
"Optimization"
,
"Optimization"
,
"Communication"
,
"Communication"
,
"PythonOp"
,
"PythonOp"
,
"PythonUserDefined"
,
"PythonUserDefined"
};
"MluRuntime"
};
return
categary_name_
[
static_cast
<
int
>
(
type
)];
return
categary_name_
[
static_cast
<
int
>
(
type
)];
}
}
...
...
paddle/fluid/pybind/place.cc
浏览文件 @
4d5a3ad6
...
@@ -656,8 +656,6 @@ void BindPlace(pybind11::module &m) { // NOLINT
...
@@ -656,8 +656,6 @@ void BindPlace(pybind11::module &m) { // NOLINT
[](
platform
::
Place
&
self
)
{
[](
platform
::
Place
&
self
)
{
return
platform
::
is_cuda_pinned_place
(
self
);
return
platform
::
is_cuda_pinned_place
(
self
);
})
})
.
def
(
"is_mlu_place"
,
[](
platform
::
Place
&
self
)
{
return
platform
::
is_mlu_place
(
self
);
})
.
def
(
.
def
(
"is_custom_place"
,
"is_custom_place"
,
[](
platform
::
Place
&
self
)
{
return
platform
::
is_custom_place
(
self
);
})
[](
platform
::
Place
&
self
)
{
return
platform
::
is_custom_place
(
self
);
})
...
@@ -665,7 +663,6 @@ void BindPlace(pybind11::module &m) { // NOLINT
...
@@ -665,7 +663,6 @@ void BindPlace(pybind11::module &m) { // NOLINT
.
def
(
"xpu_device_id"
,
[](
platform
::
Place
&
self
)
{
return
self
.
device
;
})
.
def
(
"xpu_device_id"
,
[](
platform
::
Place
&
self
)
{
return
self
.
device
;
})
.
def
(
"npu_device_id"
,
[](
platform
::
Place
&
self
)
{
return
self
.
device
;
})
.
def
(
"npu_device_id"
,
[](
platform
::
Place
&
self
)
{
return
self
.
device
;
})
.
def
(
"ipu_device_id"
,
[](
platform
::
Place
&
self
)
{
return
self
.
device
;
})
.
def
(
"ipu_device_id"
,
[](
platform
::
Place
&
self
)
{
return
self
.
device
;
})
.
def
(
"mlu_device_id"
,
[](
platform
::
Place
&
self
)
{
return
self
.
device
;
})
.
def
(
"custom_device_id"
,
.
def
(
"custom_device_id"
,
[](
platform
::
Place
&
self
)
{
return
self
.
device
;
})
[](
platform
::
Place
&
self
)
{
return
self
.
device
;
})
.
def
(
"set_place"
,
.
def
(
"set_place"
,
...
...
paddle/fluid/pybind/tensor.cc
浏览文件 @
4d5a3ad6
...
@@ -401,7 +401,7 @@ void BindTensor(pybind11::module &m) { // NOLINT
...
@@ -401,7 +401,7 @@ void BindTensor(pybind11::module &m) { // NOLINT
Args:
Args:
lod (numpy.ndarray): The data to set.
lod (numpy.ndarray): The data to set.
place (CPUPlace|CUDAPlace|XPUPlace|IPUPlace|CUDAPinnedPlace|NPUPlace
|MLUPlace
): The place where the
place (CPUPlace|CUDAPlace|XPUPlace|IPUPlace|CUDAPinnedPlace|NPUPlace): The place where the
Tensor is to be set.
Tensor is to be set.
zero_copy (bool, optional): Whether to share memory with the input numpy array.
zero_copy (bool, optional): Whether to share memory with the input numpy array.
This parameter only works with CPUPlace. Default: False.
This parameter only works with CPUPlace. Default: False.
...
...
paddle/fluid/pybind/tensor_py.h
浏览文件 @
4d5a3ad6
...
@@ -961,7 +961,6 @@ inline py::array TensorToPyArray(const phi::DenseTensor &tensor,
...
@@ -961,7 +961,6 @@ inline py::array TensorToPyArray(const phi::DenseTensor &tensor,
bool
is_gpu_tensor
=
platform
::
is_gpu_place
(
tensor
.
place
());
bool
is_gpu_tensor
=
platform
::
is_gpu_place
(
tensor
.
place
());
bool
is_xpu_tensor
=
platform
::
is_xpu_place
(
tensor
.
place
());
bool
is_xpu_tensor
=
platform
::
is_xpu_place
(
tensor
.
place
());
bool
is_npu_tensor
=
platform
::
is_npu_place
(
tensor
.
place
());
bool
is_npu_tensor
=
platform
::
is_npu_place
(
tensor
.
place
());
bool
is_mlu_tensor
=
platform
::
is_mlu_place
(
tensor
.
place
());
bool
is_custom_device_tensor
=
platform
::
is_custom_place
(
tensor
.
place
());
bool
is_custom_device_tensor
=
platform
::
is_custom_place
(
tensor
.
place
());
const
auto
&
tensor_dims
=
tensor
.
dims
();
const
auto
&
tensor_dims
=
tensor
.
dims
();
auto
tensor_dtype
=
framework
::
TransToProtoVarType
(
tensor
.
dtype
());
auto
tensor_dtype
=
framework
::
TransToProtoVarType
(
tensor
.
dtype
());
...
@@ -982,7 +981,7 @@ inline py::array TensorToPyArray(const phi::DenseTensor &tensor,
...
@@ -982,7 +981,7 @@ inline py::array TensorToPyArray(const phi::DenseTensor &tensor,
std
::
string
py_dtype_str
=
details
::
TensorDTypeToPyDTypeStr
(
std
::
string
py_dtype_str
=
details
::
TensorDTypeToPyDTypeStr
(
framework
::
TransToProtoVarType
(
tensor
.
dtype
()));
framework
::
TransToProtoVarType
(
tensor
.
dtype
()));
if
(
!
is_gpu_tensor
&&
!
is_xpu_tensor
&&
!
is_npu_tensor
&&
!
is_mlu_tensor
&&
if
(
!
is_gpu_tensor
&&
!
is_xpu_tensor
&&
!
is_npu_tensor
&&
!
is_custom_device_tensor
)
{
!
is_custom_device_tensor
)
{
if
(
!
need_deep_copy
)
{
if
(
!
need_deep_copy
)
{
auto
base
=
py
::
cast
(
std
::
move
(
tensor
));
auto
base
=
py
::
cast
(
std
::
move
(
tensor
));
...
...
paddle/phi/common/backend.h
浏览文件 @
4d5a3ad6
...
@@ -95,9 +95,6 @@ inline std::ostream& operator<<(std::ostream& os, Backend backend) {
...
@@ -95,9 +95,6 @@ inline std::ostream& operator<<(std::ostream& os, Backend backend) {
case
Backend
::
NPU
:
case
Backend
::
NPU
:
os
<<
"NPU"
;
os
<<
"NPU"
;
break
;
break
;
case
Backend
::
MLU
:
os
<<
"MLU"
;
break
;
case
Backend
::
ONEDNN
:
case
Backend
::
ONEDNN
:
os
<<
"ONEDNN"
;
os
<<
"ONEDNN"
;
break
;
break
;
...
@@ -143,8 +140,6 @@ inline Backend StringToBackend(const char* backend_cstr) {
...
@@ -143,8 +140,6 @@ inline Backend StringToBackend(const char* backend_cstr) {
return
Backend
::
XPU
;
return
Backend
::
XPU
;
}
else
if
(
s
==
std
::
string
(
"NPU"
))
{
}
else
if
(
s
==
std
::
string
(
"NPU"
))
{
return
Backend
::
NPU
;
return
Backend
::
NPU
;
}
else
if
(
s
==
std
::
string
(
"MLU"
))
{
return
Backend
::
MLU
;
}
else
if
(
s
==
std
::
string
(
"OneDNN"
))
{
}
else
if
(
s
==
std
::
string
(
"OneDNN"
))
{
return
Backend
::
ONEDNN
;
return
Backend
::
ONEDNN
;
}
else
if
(
s
==
std
::
string
(
"GPUDNN"
))
{
}
else
if
(
s
==
std
::
string
(
"GPUDNN"
))
{
...
@@ -181,8 +176,6 @@ inline std::string BackendToString(const Backend& backend) {
...
@@ -181,8 +176,6 @@ inline std::string BackendToString(const Backend& backend) {
return
"XPU"
;
return
"XPU"
;
case
Backend
::
NPU
:
case
Backend
::
NPU
:
return
"NPU"
;
return
"NPU"
;
case
Backend
::
MLU
:
return
"MLU"
;
case
Backend
::
ONEDNN
:
case
Backend
::
ONEDNN
:
return
"ONEDNN"
;
return
"ONEDNN"
;
case
Backend
::
GPUDNN
:
case
Backend
::
GPUDNN
:
...
...
paddle/phi/common/place.cc
浏览文件 @
4d5a3ad6
...
@@ -41,8 +41,6 @@ const char *AllocationTypeStr(AllocationType type) {
...
@@ -41,8 +41,6 @@ const char *AllocationTypeStr(AllocationType type) {
return
"npu_pinned"
;
return
"npu_pinned"
;
case
AllocationType
::
IPU
:
case
AllocationType
::
IPU
:
return
"ipu"
;
return
"ipu"
;
case
AllocationType
::
MLU
:
return
"mlu"
;
default:
default:
PD_THROW
(
"Invalid phi device type."
);
PD_THROW
(
"Invalid phi device type."
);
return
{};
return
{};
...
...
paddle/phi/core/compat/convert_utils.cc
浏览文件 @
4d5a3ad6
...
@@ -41,8 +41,6 @@ Backend TransToPhiBackend(const phi::Place& place) {
...
@@ -41,8 +41,6 @@ Backend TransToPhiBackend(const phi::Place& place) {
return
Backend
::
NPU
;
return
Backend
::
NPU
;
case
AllocationType
::
IPU
:
case
AllocationType
::
IPU
:
return
Backend
::
IPU
;
return
Backend
::
IPU
;
case
AllocationType
::
MLU
:
return
Backend
::
MLU
;
case
AllocationType
::
CUSTOM
:
case
AllocationType
::
CUSTOM
:
return
static_cast
<
Backend
>
(
return
static_cast
<
Backend
>
(
static_cast
<
size_t
>
(
Backend
::
NUM_BACKENDS
)
+
static_cast
<
size_t
>
(
Backend
::
NUM_BACKENDS
)
+
...
...
python/paddle/distributed/spawn.py
浏览文件 @
4d5a3ad6
...
@@ -108,8 +108,6 @@ def _get_default_nprocs():
...
@@ -108,8 +108,6 @@ def _get_default_nprocs():
return
core
.
get_cuda_device_count
()
return
core
.
get_cuda_device_count
()
elif
'xpu'
in
device
:
elif
'xpu'
in
device
:
return
core
.
get_xpu_device_count
()
return
core
.
get_xpu_device_count
()
elif
'mlu'
in
device
:
return
core
.
get_custom_device_count
(
'mlu'
)
elif
'cpu'
in
device
:
elif
'cpu'
in
device
:
return
multiprocessing
.
cpu_count
()
return
multiprocessing
.
cpu_count
()
else
:
else
:
...
...
python/paddle/nn/functional/loss.py
浏览文件 @
4d5a3ad6
...
@@ -2734,9 +2734,7 @@ def cross_entropy(
...
@@ -2734,9 +2734,7 @@ def cross_entropy(
valid_label
=
(
valid_label
=
(
paddle
.
cast
(
label
!=
ignore_index
,
dtype
=
label
.
dtype
)
*
label
paddle
.
cast
(
label
!=
ignore_index
,
dtype
=
label
.
dtype
)
*
label
)
)
if
core
.
is_compiled_with_custom_device
(
if
core
.
is_compiled_with_custom_device
(
"npu"
):
"npu"
)
or
core
.
is_compiled_with_custom_device
(
"mlu"
):
if
not
soft_label
:
if
not
soft_label
:
_
,
out
=
_legacy_C_ops
.
softmax_with_cross_entropy
(
_
,
out
=
_legacy_C_ops
.
softmax_with_cross_entropy
(
input
,
input
,
...
...
python/paddle/profiler/profiler.py
浏览文件 @
4d5a3ad6
...
@@ -499,8 +499,6 @@ class Profiler:
...
@@ -499,8 +499,6 @@ class Profiler:
profileoption
.
trace_switch
|=
1
profileoption
.
trace_switch
|=
1
if
ProfilerTarget
.
GPU
in
self
.
targets
:
if
ProfilerTarget
.
GPU
in
self
.
targets
:
profileoption
.
trace_switch
|=
1
<<
1
profileoption
.
trace_switch
|=
1
<<
1
if
ProfilerTarget
.
MLU
in
self
.
targets
:
profileoption
.
trace_switch
|=
1
<<
2
if
ProfilerTarget
.
CUSTOM_DEVICE
in
self
.
targets
:
if
ProfilerTarget
.
CUSTOM_DEVICE
in
self
.
targets
:
profileoption
.
trace_switch
|=
1
<<
3
profileoption
.
trace_switch
|=
1
<<
3
if
not
custom_device_types
:
if
not
custom_device_types
:
...
...
tools/get_pr_ut.py
浏览文件 @
4d5a3ad6
...
@@ -343,7 +343,6 @@ class PRChecker:
...
@@ -343,7 +343,6 @@ class PRChecker:
elif
(
elif
(
(
'/xpu/'
in
filename
.
lower
())
(
'/xpu/'
in
filename
.
lower
())
or
(
'/npu/'
in
filename
.
lower
())
or
(
'/npu/'
in
filename
.
lower
())
or
(
'/mlu/'
in
filename
.
lower
())
or
(
'/ipu/'
in
filename
.
lower
())
or
(
'/ipu/'
in
filename
.
lower
())
):
):
filterFiles
.
append
(
filename
)
filterFiles
.
append
(
filename
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录