Skip to content

Commit 4078da2

Browse files
jackalcoopertsaiguo-ran
authored
Dev rel legacy cuda (#3343)
* add rel script * support customized package name * one wheel dir * update docs * add more info * add more info * add from img * fix * use oneflow_cu102 in ci * fix * default rdma OFF * fix typo Co-authored-by: tsai <caishenghang@1f-dev.kbaeegfb1x0ubnoznzequyxzve.bx.internal.cloudapp.net> Co-authored-by: guo ran <360112263@qq.com>
1 parent 02bb9f9 commit 4078da2

File tree

12 files changed

+70
-17
lines changed

12 files changed

+70
-17
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dist
2929

3030
build/third_party/re2/src/re2-*
3131

32-
/wheelhouse
32+
/wheelhouse*
3333
/.DS_Store
3434
/tmp_wheel
3535
/manylinux*

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ core.*
1515
/.idea
1616
/manylinux*
1717
wheelhouse/
18+
wheelhouse*
1819
.DS_Store
1920
/tmp_wheel

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (NOT THIRD_PARTY AND NOT ONEFLOW)
99
endif()
1010

1111
option(USE_CLANG_FORMAT "" OFF)
12-
option(BUILD_RDMA "" ON)
12+
option(BUILD_RDMA "" OFF)
1313
option(BUILD_CUDA "" ON)
1414
option(BUILD_TESTING "" ON)
1515
option(PY3 "" ON)

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,33 @@
88

99
#### Install Pip package
1010

11-
- To install latest release of OneFlow:
11+
- To install latest release of OneFlow with CUDA support:
1212

1313
```
14-
python3 -m pip install oneflow
14+
python3 -m pip install oneflow_cu102
1515
```
1616
17+
- To install OneFlow with legacy CUDA support, run one of:
18+
```
19+
python3 -m pip install oneflow_cu101
20+
python3 -m pip install oneflow_cu100
21+
python3 -m pip install oneflow_cu92
22+
python3 -m pip install oneflow_cu91
23+
python3 -m pip install oneflow_cu90
24+
```
25+
26+
- Support for latest stable version of CUDA will be prioritized. Please upgrade your Nvidia driver to version 440.33 or above and install `oneflow_cu102` if possible. For more information, please refer to [CUDA compatibility documentation](https://docs.nvidia.com/deploy/cuda-compatibility/index.html).
27+
1728
- To install nightly release of OneFlow:
1829
1930
```
20-
python3 -m pip install --find-links https://oneflow-inc.github.io/nightly oneflow
31+
python3 -m pip install --find-links https://oneflow-inc.github.io/nightly oneflow_cu102
2132
```
2233
34+
- CPU-only OneFlow is not available for now.
35+
36+
- Releases are built with G++/GCC 4.8.5, cuDNN 7 and MKL 2020.0-088.
37+
2338
### Build OneFlow from Source
2439
2540
1. #### System Requirements to Build OneFlow

ci/build/clean.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ set -ex
22
docker run --rm \
33
-v $HOME/ci-tmp:/ci-tmp \
44
-w $HOME/ci-tmp:/ci-tmp busybox rm -rf /ci-tmp/wheelhouse
5+
docker run --rm -v $PWD:/p -w /p busybox rm -rf build

ci/build/make.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ fi
1818
# build manylinux image
1919
cd $src_dir
2020
docker build -f $src_dir/docker/package/manylinux/Dockerfile \
21+
--build-arg from=nvidia/cuda:10.2-cudnn7-devel-centos7 \
2122
$docker_proxy_build_args -t $docker_tag .
2223

2324
cd -
@@ -32,7 +33,9 @@ function build() {
3233
-v $tmp_dir/py-build-lib:/oneflow-src/build/lib/ \
3334
-w /ci-tmp \
3435
"$docker_tag" \
35-
/oneflow-src/docker/package/manylinux/build_wheel.sh --python3.6
36+
/oneflow-src/docker/package/manylinux/build_wheel.sh \
37+
--python3.6 \
38+
--package-name oneflow_cu102
3639
}
3740

3841
set +e

docker/package/manylinux/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM nvidia/cuda:10.2-cudnn7-devel-centos7
1+
ARG from
2+
FROM ${from}
23
LABEL maintainer="OneFlow Maintainers"
34

45
# manylinux2014

docker/package/manylinux/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
在 OneFlow 源码根目录下运行:
66
```
7-
docker build -f docker/package/manylinux/Dockerfile -t oneflow:manylinux2014-cuda10.2 .
7+
docker build -f docker/package/manylinux/Dockerfile --build-arg from=nvidia/cuda:10.2-cudnn7-devel-centos7 -t oneflow:manylinux2014-cuda10.2 .
88
```
99

1010
### 打包 manylinux python wheel

docker/package/manylinux/build_wheel.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ while [[ "$#" > 0 ]]; do
1313
--skip-third-party) SKIP_THIRD_PARTY=1; ;;
1414
--cache-dir) CACHE_DIR=$2; shift ;;
1515
--house-dir) HOUSE_DIR=$2; shift ;;
16+
--package-name) PACKAGE_NAME=$2; shift ;;
1617
--python3.5) PY_VERS+=( "35" ) ;;
1718
--python3.6) PY_VERS+=( "36" ) ;;
1819
--python3.7) PY_VERS+=( "37" ) ;;
@@ -32,6 +33,11 @@ then
3233
HOUSE_DIR=$PWD/wheelhouse
3334
fi
3435

36+
if [[ ! -v PACKAGE_NAME ]]
37+
then
38+
PACKAGE_NAME=oneflow
39+
fi
40+
3541
ONEFLOW_SRC_DIR=`cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd`
3642
ONEFLOW_SRC_DIR=$ONEFLOW_SRC_DIR/../../..
3743

@@ -44,13 +50,14 @@ cd $ONEFLOW_SRC_DIR
4450

4551
THIRD_PARTY_BUILD_DIR=$CACHE_DIR/build-third-party
4652
THIRD_PARTY_INSTALL_DIR=$CACHE_DIR/build-third-party-install
53+
COMMON_CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release -DBUILD_RDMA=ON -DTHIRD_PARTY_DIR=$THIRD_PARTY_INSTALL_DIR"
4754
if [[ $SKIP_THIRD_PARTY != 1 ]]; then
4855
mkdir -p $THIRD_PARTY_BUILD_DIR
4956
pushd $THIRD_PARTY_BUILD_DIR
5057

51-
cmake -DTHIRD_PARTY=ON -DCMAKE_BUILD_TYPE=Release \
58+
cmake -DTHIRD_PARTY=ON \
59+
$COMMON_CMAKE_ARGS \
5260
-DONEFLOW=OFF \
53-
-DTHIRD_PARTY_DIR=$THIRD_PARTY_INSTALL_DIR \
5461
$ONEFLOW_SRC_DIR
5562
make -j nccl
5663
make -j`nproc` prepare_oneflow_third_party
@@ -77,15 +84,15 @@ do
7784
PY_ROOT=/opt/python/${PY_ABI}
7885
PY_BIN=${PY_ROOT}/bin/python
7986
cmake -DTHIRD_PARTY=OFF -DONEFLOW=ON\
87+
$COMMON_CMAKE_ARGS \
8088
-DPython3_ROOT_DIR=$PY_ROOT \
81-
-DCMAKE_BUILD_TYPE=Release \
82-
-DTHIRD_PARTY_DIR=$THIRD_PARTY_INSTALL_DIR \
8389
$EXTRA_ONEFLOW_CMAKE_ARGS \
8490
$ONEFLOW_SRC_DIR
8591
cmake --build . -j `nproc`
8692
popd
8793
trap cleanup EXIT
88-
$PY_BIN setup.py bdist_wheel -d tmp_wheel --build_dir $ONEFLOW_BUILD_DIR
94+
rm -rf $ONEFLOW_BUILD_DIR/python_scripts/*.egg-info
95+
$PY_BIN setup.py bdist_wheel -d tmp_wheel --build_dir $ONEFLOW_BUILD_DIR --package_name $PACKAGE_NAME
8996
auditwheel repair tmp_wheel/*.whl --wheel-dir $HOUSE_DIR
9097
cleanup
9198
done
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
set -ex
2+
3+
function release() {
4+
set -ex
5+
docker_tag=oneflow:rel-manylinux2014-cuda-$1
6+
package_name=oneflow_cu`echo $1 | tr -d .`
7+
docker build --build-arg from=nvidia/cuda:$1-cudnn7-devel-centos7 -f docker/package/manylinux/Dockerfile -t $docker_tag .
8+
docker run --rm -it -v `pwd`:/oneflow-src -w /oneflow-src $docker_tag \
9+
/oneflow-src/docker/package/manylinux/build_wheel.sh --cache-dir /oneflow-src/manylinux2014-build-cache-cuda-$1 \
10+
--house-dir /oneflow-src/wheelhouse \
11+
--package-name $package_name
12+
}
13+
14+
release 10.2
15+
release 10.1
16+
release 10.0
17+
release 9.2
18+
release 9.1
19+
release 9.0

0 commit comments

Comments
 (0)