Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
5a8d43bb
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
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看板
未验证
提交
5a8d43bb
编写于
12月 29, 2020
作者:
W
Wilber
提交者:
GitHub
12月 29, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support mips (#29943)
上级
a839ddca
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
21 addition
and
8 deletion
+21
-8
CMakeLists.txt
CMakeLists.txt
+6
-0
cmake/external/openblas.cmake
cmake/external/openblas.cmake
+3
-0
cmake/flags.cmake
cmake/flags.cmake
+1
-1
paddle/fluid/operators/search_compute.h
paddle/fluid/operators/search_compute.h
+8
-4
paddle/fluid/platform/cpu_info.cc
paddle/fluid/platform/cpu_info.cc
+1
-1
paddle/fluid/platform/cpu_info.h
paddle/fluid/platform/cpu_info.h
+1
-1
python/setup.py.in
python/setup.py.in
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
5a8d43bb
...
...
@@ -144,6 +144,7 @@ option(WITH_NCCL "Compile PaddlePaddle with NCCL support" ON)
option
(
WITH_CRYPTO
"Compile PaddlePaddle with crypto support"
ON
)
option
(
WITH_ARM
"Compile PaddlePaddle with arm support"
OFF
)
option
(
WITH_SW
"Compile PaddlePaddle with sw support"
OFF
)
option
(
WITH_MIPS
"Compile PaddlePaddle with mips support"
OFF
)
option
(
WITH_MUSL
"Compile with musl libc instead of gblic"
OFF
)
# PY_VERSION
...
...
@@ -264,6 +265,11 @@ if (WITH_SW)
add_definitions
(
-DPADDLE_WITH_SW
)
endif
()
if
(
WITH_MIPS
)
set
(
WITH_XBYAK OFF CACHE STRING
"Disable XBYAK when compiling WITH_MIPS=ON"
FORCE
)
add_definitions
(
-DPADDLE_WITH_MIPS
)
endif
()
set
(
PADDLE_PYTHON_BUILD_DIR
"
${
CMAKE_CURRENT_BINARY_DIR
}
/python/build"
)
set
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-O3 -g -DNDEBUG"
)
...
...
cmake/external/openblas.cmake
浏览文件 @
5a8d43bb
...
...
@@ -19,6 +19,9 @@ SET(CBLAS_SOURCE_DIR ${THIRD_PARTY_PATH}/openblas/src/extern_openblas)
SET
(
CBLAS_INSTALL_DIR
${
THIRD_PARTY_PATH
}
/install/openblas
)
SET
(
CBLAS_REPOSITORY
${
GIT_URL
}
/xianyi/OpenBLAS.git
)
SET
(
CBLAS_TAG v0.3.7
)
if
(
WITH_MIPS
)
SET
(
CBLAS_TAG v0.3.13
)
endif
()
cache_third_party
(
extern_openblas
REPOSITORY
${
CBLAS_REPOSITORY
}
...
...
cmake/flags.cmake
浏览文件 @
5a8d43bb
...
...
@@ -183,7 +183,7 @@ set(GPU_COMMON_FLAGS
-Wno-error=unused-function
# Warnings in Numpy Header.
-Wno-error=array-bounds
# Warnings in Eigen::array
)
if
(
NOT WITH_NV_JETSON AND NOT WITH_ARM AND NOT WITH_SW
)
if
(
NOT WITH_NV_JETSON AND NOT WITH_ARM AND NOT WITH_SW
AND NOT WITH_MIPS
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-m64"
)
endif
()
endif
(
NOT WIN32
)
...
...
paddle/fluid/operators/search_compute.h
浏览文件 @
5a8d43bb
...
...
@@ -14,7 +14,8 @@ limitations under the License. */
#pragma once
#if !defined(PADDLE_WITH_ARM) && !defined(PADDLE_WITH_SW)
#if !defined(PADDLE_WITH_ARM) && !defined(PADDLE_WITH_SW) && \
!defined(PADDLE_WITH_MIPS)
#include <immintrin.h>
#endif
#include <cfloat>
...
...
@@ -74,7 +75,8 @@ void call_gemm_batched(const framework::ExecutionContext& ctx,
}
}
#if !defined(PADDLE_WITH_ARM) && !defined(PADDLE_WITH_SW)
#if !defined(PADDLE_WITH_ARM) && !defined(PADDLE_WITH_SW) && \
!defined(PADDLE_WITH_MIPS)
#define __m256x __m256
...
...
@@ -114,7 +116,8 @@ inline void axpy(const T* x, T* y, size_t len, const T alpha) {
_mm256_add_px
(
_mm256_load_px
(
y
+
jjj
),
_mm256_mul_px
(
mm_alpha
,
_mm256_load_px
(
x
+
jjj
))));
}
#elif defined(PADDLE_WITH_ARM) || defined(PADDLE_WITH_SW)
#elif defined(PADDLE_WITH_ARM) || defined(PADDLE_WITH_SW) || \
defined(PADDLE_WITH_MIPS)
PADDLE_THROW
(
platform
::
errors
::
Unimplemented
(
"axpy is not supported"
));
#else
lll
=
len
&
~
SSE_CUT_LEN_MASK
;
...
...
@@ -143,7 +146,8 @@ inline void axpy_noadd(const T* x, T* y, size_t len, const T alpha) {
for
(
jjj
=
0
;
jjj
<
lll
;
jjj
+=
AVX_STEP_SIZE
)
{
_mm256_store_px
(
y
+
jjj
,
_mm256_mul_px
(
mm_alpha
,
_mm256_load_px
(
x
+
jjj
)));
}
#elif defined(PADDLE_WITH_ARM) || defined(PADDLE_WITH_SW)
#elif defined(PADDLE_WITH_ARM) || defined(PADDLE_WITH_SW) || \
defined(PADDLE_WITH_MIPS)
PADDLE_THROW
(
platform
::
errors
::
Unimplemented
(
"axpy_noadd is not supported"
));
#else
lll
=
len
&
~
SSE_CUT_LEN_MASK
;
...
...
paddle/fluid/platform/cpu_info.cc
浏览文件 @
5a8d43bb
...
...
@@ -141,7 +141,7 @@ bool MayIUse(const cpu_isa_t cpu_isa) {
return
true
;
}
else
{
#if !defined(WITH_NV_JETSON) && !defined(PADDLE_WITH_ARM) && \
!defined(PADDLE_WITH_SW)
!defined(PADDLE_WITH_SW)
&& !defined(PADDLE_WITH_MIPS)
int
reg
[
4
];
cpuid
(
reg
,
0
);
int
nIds
=
reg
[
0
];
...
...
paddle/fluid/platform/cpu_info.h
浏览文件 @
5a8d43bb
...
...
@@ -41,7 +41,7 @@ limitations under the License. */
#define cpuid(reg, x) __cpuidex(reg, x, 0)
#else
#if !defined(WITH_NV_JETSON) && !defined(PADDLE_WITH_ARM) && \
!defined(PADDLE_WITH_SW)
!defined(PADDLE_WITH_SW)
&& !defined(PADDLE_WITH_MIPS)
#include <cpuid.h>
inline
void
cpuid
(
int
reg
[
4
],
int
x
)
{
__cpuid_count
(
x
,
0
,
reg
[
0
],
reg
[
1
],
reg
[
2
],
reg
[
3
]);
...
...
python/setup.py.in
浏览文件 @
5a8d43bb
...
...
@@ -347,7 +347,7 @@ if '${CMAKE_BUILD_TYPE}' == 'Release':
# The dynamic library compiled under aarch64 is greater than 64M,
# and an oversize error will be reported when using patchelf.
# The sw_64 not suppot patchelf, so we just disable that.
if platform.machine() != 'aarch64' and platform.machine() != 'sw_64':
if platform.machine() != 'aarch64' and platform.machine() != 'sw_64'
and platform.machine() != 'mips64'
:
if os.system(command) != 0:
raise Exception("patch ${FLUID_CORE_NAME}.%s failed, command: %s" % (ext_name, command))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录