Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
f8810f73
MegEngine
项目概览
MegEngine 天元
/
MegEngine
1 年多 前同步成功
通知
403
Star
4705
Fork
582
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MegEngine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
f8810f73
编写于
8月 12, 2020
作者:
M
Megvii Engine Team
提交者:
Xinran Xu
8月 25, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(mge/imperative): prepare to make whl
GitOrigin-RevId: f9f22fb6cbcfd72331273021b1bea7917a1ddaf8
上级
ff60fdb8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
43 addition
and
14 deletion
+43
-14
scripts/whl/BUILD_PYTHON_WHL_README.md
scripts/whl/BUILD_PYTHON_WHL_README.md
+2
-0
scripts/whl/manylinux2010/build_wheel.sh
scripts/whl/manylinux2010/build_wheel.sh
+3
-1
scripts/whl/manylinux2010/do_build.sh
scripts/whl/manylinux2010/do_build.sh
+38
-13
未找到文件。
scripts/whl/BUILD_PYTHON_WHL_README.md
浏览文件 @
f8810f73
...
@@ -79,6 +79,8 @@
...
@@ -79,6 +79,8 @@
```
```
ALL_PYTHON=35m ./build_wheel.sh cpu
ALL_PYTHON=35m ./build_wheel.sh cpu
```
```
Please append `imperative` to `build_wheel.sh` to use the new runtime, e.g., `./build_wheel.sh cpu imperative`.
## build for macos
## build for macos
```
```
./scripts/whl/macos/macos_build_whl.sh
./scripts/whl/macos/macos_build_whl.sh
...
...
scripts/whl/manylinux2010/build_wheel.sh
浏览文件 @
f8810f73
...
@@ -6,6 +6,8 @@ OUTPUTDIR=$(readlink -f ${CWD}/output)
...
@@ -6,6 +6,8 @@ OUTPUTDIR=$(readlink -f ${CWD}/output)
USERID
=
$(
id
-u
)
USERID
=
$(
id
-u
)
TMPFS_ARGS
=
"--tmpfs /tmp:exec"
TMPFS_ARGS
=
"--tmpfs /tmp:exec"
IMPERATIVE
=
${
2
:-
mgb
}
echo
${
BASEDIR
}
echo
${
BASEDIR
}
pushd
${
BASEDIR
}
/third_party
>
/dev/null
pushd
${
BASEDIR
}
/third_party
>
/dev/null
./prepare.sh
./prepare.sh
...
@@ -92,6 +94,6 @@ if [ $TENSORRT_VERSION != $REQUIR_TENSORRT_VERSION ] ; then
...
@@ -92,6 +94,6 @@ if [ $TENSORRT_VERSION != $REQUIR_TENSORRT_VERSION ] ; then
exit
-1
exit
-1
fi
fi
docker run
-it
--rm
$TMPFS_ARGS
-e
UID
=
${
USERID
}
-e
LOCAL_VERSION
=
${
LOCAL_VERSION
}
-e
ALL_PYTHON
=
${
ALL_PYTHON
}
-v
${
CUDA_ROOT_DIR
}
:/usr/local/cuda
-v
${
CUDNN_ROOT_DIR
}
:/opt/cudnn
-v
${
TENSORRT_ROOT_DIR
}
:/opt/tensorrt
-v
${
BASEDIR
}
:/home/code
-v
${
OUTPUTDIR
}
:/home/output:rw env_manylinux2010:latest /home/code/scripts/whl/manylinux2010/do_build.sh
docker run
-it
--rm
$TMPFS_ARGS
-e
UID
=
${
USERID
}
-e
LOCAL_VERSION
=
${
LOCAL_VERSION
}
-e
ALL_PYTHON
=
${
ALL_PYTHON
}
-v
${
CUDA_ROOT_DIR
}
:/usr/local/cuda
-v
${
CUDNN_ROOT_DIR
}
:/opt/cudnn
-v
${
TENSORRT_ROOT_DIR
}
:/opt/tensorrt
-v
${
BASEDIR
}
:/home/code
-v
${
OUTPUTDIR
}
:/home/output:rw env_manylinux2010:latest /home/code/scripts/whl/manylinux2010/do_build.sh
$IMPERATIVE
scripts/whl/manylinux2010/do_build.sh
浏览文件 @
f8810f73
...
@@ -6,6 +6,15 @@ then
...
@@ -6,6 +6,15 @@ then
fi
fi
EXTRA_CMAKE_ARGS
=
EXTRA_CMAKE_ARGS
=
if
[[
"
$1
"
==
imperative
]]
;
then
BUILD_IMPERATIVE
=
ON
SO_NAME
=
_imperative_rt
SO_PATH
=
megengine/core
else
BUILD_IMPERATIVE
=
OFF
SO_NAME
=
_mgb
SO_PATH
=
megengine/_internal
fi
for
ver
in
${
ALL_PYTHON
}
for
ver
in
${
ALL_PYTHON
}
do
do
...
@@ -14,29 +23,40 @@ do
...
@@ -14,29 +23,40 @@ do
MAJOR
=
${
python_ver
:0:1
}
MAJOR
=
${
python_ver
:0:1
}
MINOR
=
${
ver
:1
}
MINOR
=
${
ver
:1
}
PYTHON_DIR
=
/opt/python/cp
${
python_ver
}
-cp
${
ver
}
/
PYTHON_DIR
=
/opt/python/cp
${
python_ver
}
-cp
${
ver
}
/
EXT_NAME
=
_mgb
.cpython-
${
ver
}
-x86_64-linux-gnu
.so
EXT_NAME
=
${
SO_NAME
}
.cpython-
${
ver
}
-x86_64-linux-gnu
.so
mkdir
-p
${
BUILD_DIR
}
mkdir
-p
${
BUILD_DIR
}
pushd
${
BUILD_DIR
}
>
/dev/null
pushd
${
BUILD_DIR
}
>
/dev/null
cmake /home/code
-DMGE_WITH_DISTRIBUTED
=
ON
-DMGE_WITH_CUDA
=
ON
\
MGE_CMAKE_FLAGS
=
"-DMGE_WITH_DISTRIBUTED=ON
\
-DMGE_WITH_CUDA=ON
\
-DCMAKE_PREFIX_PATH=
${
PYTHON_DIR
}
\
-DCMAKE_PREFIX_PATH=
${
PYTHON_DIR
}
\
-DMGE_WITH_TEST
=
ON
-DCMAKE_INSTALL_PREFIX
=
/home/output
\
-DCMAKE_INSTALL_PREFIX=/home/output "
-DPYTHON_LIBRARY
=
${
PYTHON_DIR
}
lib/
\
if
[[
"
$BUILD_IMPERATIVE
"
==
ON
]]
;
then
-DPYTHON_INCLUDE_DIR
=
${
PYTHON_DIR
}
include/python
${
MAJOR
}
.
${
MINOR
}
/
\
MGE_CMAKE_FLAGS+
=
" -DMGE_BUILD_IMPERATIVE_RT=ON
\
${
EXTRA_CMAKE_ARGS
}
-DPYTHON_EXECUTABLE=
${
PYTHON_DIR
}
/bin/python3"
make
-j
$(
nproc
)
else
MGE_CMAKE_FLAGS+
=
" -DPYTHON_LIBRARY=
${
PYTHON_DIR
}
lib/
\
-DPYTHON_INCLUDE_DIR=
${
PYTHON_DIR
}
include/python
${
MAJOR
}
.
${
MINOR
}
"
fi
cmake /home/code
${
MGE_CMAKE_FLAGS
}
${
EXTRA_CMAKE_ARGS
}
make
-j
$(
nproc
)
VERBOSE
=
1
make
install
make
install
mkdir
-p
staging
mkdir
-p
staging
mkdir
-p
/home/output/debug
mkdir
-p
/home/output/debug
cp
-a
python_module/
{
megengine,setup.py,requires.txt,requires-style.txt,requires-test.txt
}
staging/
if
[[
"
$BUILD_IMPERATIVE
"
==
ON
]]
;
then
cp
-a
imperative/python/
{
megengine,setup.py,requires.txt,requires-style.txt,requires-test.txt
}
staging/
else
cp
-a
python_module/
{
megengine,setup.py,requires.txt,requires-style.txt,requires-test.txt
}
staging/
fi
pushd
dnn/cuda-stub/
>
/dev/null
pushd
dnn/cuda-stub/
>
/dev/null
strip
-s
libcuda.so
strip
-s
libcuda.so
ln
-sf
libcuda.so libcuda.so.1
ln
-sf
libcuda.so libcuda.so.1
popd
>
/dev/null
popd
>
/dev/null
pushd
staging
>
/dev/null
pushd
staging
>
/dev/null
pushd
megengine/_internal
>
/dev/null
pushd
${
SO_PATH
}
>
/dev/null
objcopy
--only-keep-debug
_mgb.so
${
EXT_NAME
}
.dbg
SO_NAME_EXT
=
${
SO_NAME
}
.so
strip
-s
_mgb.so
objcopy
--only-keep-debug
${
SO_NAME_EXT
}
${
EXT_NAME
}
.dbg
objcopy
--add-gnu-debuglink
=
${
EXT_NAME
}
.dbg _mgb.so
strip
-s
${
SO_NAME_EXT
}
objcopy
--add-gnu-debuglink
=
${
EXT_NAME
}
.dbg
${
SO_NAME_EXT
}
cp
-a
${
EXT_NAME
}
.dbg /home/output/debug
cp
-a
${
EXT_NAME
}
.dbg /home/output/debug
mkdir
-p
lib/ucx
mkdir
-p
lib/ucx
cp
-L
/usr/local/cuda/lib
*
/libnvrtc-builtins.so lib
cp
-L
/usr/local/cuda/lib
*
/libnvrtc-builtins.so lib
...
@@ -47,7 +67,12 @@ do
...
@@ -47,7 +67,12 @@ do
popd
>
/dev/null
popd
>
/dev/null
popd
>
/dev/null
popd
>
/dev/null
pushd
/home/output
>
/dev/null
pushd
/home/output
>
/dev/null
LD_LIBRARY_PATH
=
${
BUILD_DIR
}
/dnn/cuda-stub:
$LD_LIBRARY_PATH
auditwheel repair
-L
_internal/lib
${
BUILD_DIR
}
/staging/dist/Meg
*
.whl
if
[[
"
$BUILD_IMPERATIVE
"
==
ON
]]
;
then
NEW_LIB_PATH
=
core/lib
else
NEW_LIB_PATH
=
_internal/lib
fi
LD_LIBRARY_PATH
=
${
BUILD_DIR
}
/dnn/cuda-stub:
$LD_LIBRARY_PATH
auditwheel repair
-L
${
NEW_LIB_PATH
}
${
BUILD_DIR
}
/staging/dist/Meg
*
.whl
chown
-R
${
UID
}
.
${
UID
}
.
chown
-R
${
UID
}
.
${
UID
}
.
popd
>
/dev/null
popd
>
/dev/null
rm
-rf
${
BUILD_DIR
}
rm
-rf
${
BUILD_DIR
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录