Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix support for Ninja and add Ninja build in Simple CI #5236

Merged
merged 28 commits into from
Jun 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6b747ce
Update CMakeLists.txt
jackalcooper Jun 18, 2021
ef19e69
refine
jackalcooper Jun 18, 2021
b148a4a
Merge branch 'master' of https://github.com/Oneflow-Inc/oneflow into …
jackalcooper Jun 18, 2021
c21dfd3
refine
jackalcooper Jun 18, 2021
f1de510
Merge branch 'master' into mv-default-third-party-dir-into-build-dir-1
oneflow-ci-bot Jun 18, 2021
fc1b0d5
refine
jackalcooper Jun 18, 2021
edcff1f
add config in matrix
jackalcooper Jun 18, 2021
c2260ca
refine
jackalcooper Jun 18, 2021
e0713de
refine
jackalcooper Jun 18, 2021
fd6fa2a
refine
jackalcooper Jun 18, 2021
88c963c
fix
jackalcooper Jun 18, 2021
317b6a7
add badge
jackalcooper Jun 18, 2021
7dfba4e
refine
jackalcooper Jun 18, 2021
6b009b9
refine
jackalcooper Jun 18, 2021
166e9bf
refine
jackalcooper Jun 18, 2021
c6b7a85
Merge branch 'master' of https://github.com/Oneflow-Inc/oneflow into …
jackalcooper Jun 18, 2021
7b59a48
refine
jackalcooper Jun 18, 2021
a9b2cd0
Merge branch 'master' of https://github.com/Oneflow-Inc/oneflow into …
jackalcooper Jun 18, 2021
ed68f01
Merge branch 'master' of https://github.com/Oneflow-Inc/oneflow into …
jackalcooper Jun 18, 2021
96dd3f1
refine
jackalcooper Jun 18, 2021
86f7567
don't build Ninja with Release to reduce product
jackalcooper Jun 18, 2021
c51596f
revert
jackalcooper Jun 18, 2021
befa080
refine order
jackalcooper Jun 18, 2021
75dc746
refine order
jackalcooper Jun 18, 2021
6b492f1
refine
jackalcooper Jun 18, 2021
cdacff8
Merge branch 'support_ninja' of https://github.com/Oneflow-Inc/oneflo…
jackalcooper Jun 18, 2021
e436059
Merge branch 'master' of https://github.com/Oneflow-Inc/oneflow into …
jackalcooper Jun 18, 2021
bc3927f
Merge branch 'master' into support_ninja
jackalcooper Jun 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 13 additions & 19 deletions .github/workflows/simple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,20 @@ jobs:
hosted:
name: CPU-only
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.allow_fail }}
needs: [cancel_previous]
strategy:
max-parallel: 5
fail-fast: false
matrix:
test_suite: ["mac", "ubuntu"]
cmake_build_type:
[
"CMAKE_BUILD_TYPE=Debug",
"CMAKE_BUILD_TYPE=Release",
"CMAKE_BUILD_TYPE=RelWithDebInfo",
]
cmake_generator: ["Ninja", "Unix Makefiles"]
cmake_build_type: ["CMAKE_BUILD_TYPE=Debug", "CMAKE_BUILD_TYPE=Release"]
build_shared_libs: ["BUILD_SHARED_LIBS=ON", "BUILD_SHARED_LIBS=OFF"]
include:
- test_suite: mac
os: "macos-10.15"
allow_fail: false
make_concurrency: 2
- test_suite: ubuntu
os: "ubuntu-20.04"
allow_fail: false
make_concurrency: 2
steps:
- uses: actions/checkout@v2
Expand All @@ -50,12 +43,12 @@ jobs:
- name: Install dependencies (homebrew)
if: matrix.test_suite == 'mac'
run: |
brew install nasm
brew install nasm ninja
shell: bash
- name: Install dependencies (apt)
if: matrix.test_suite == 'ubuntu'
run: |
sudo apt install -y libopenblas-dev nasm g++ gcc python3-pip
sudo apt install -y libopenblas-dev nasm g++ gcc python3-pip ninja-build
shell: bash
- name: Cache pip (Linux)
if: startsWith(runner.os, 'Linux')
Expand All @@ -80,6 +73,7 @@ jobs:
cmake_flags=""
cmake_flags+=" -DRPC_BACKEND=LOCAL"
cmake_flags+=" -DBUILD_CUDA=OFF"
cmake_flags+=" -G '${{ matrix.cmake_generator }}'"
cmake_flags+=" -D${{ matrix.cmake_build_type }}"
cmake_flags+=" -D${{ matrix.build_shared_libs }}"
echo "cmake_flags=${cmake_flags}" >> $GITHUB_ENV
Expand All @@ -91,40 +85,40 @@ jobs:
mkdir -p build-third_party
mkdir -p third_party_install
cd build-third_party
cmake .. ${{ env.cmake_flags }} -DTHIRD_PARTY=ON -DONEFLOW=OFF -DTHIRD_PARTY_DIR=$(realpath ../third_party_install)
make -j $(nproc)
cmake .. ${{ env.cmake_flags }} -DTHIRD_PARTY=ON -DONEFLOW=OFF -DTHIRD_PARTY_DIR=$PWD/../third_party_install
cmake --build . -j $(nproc)
shell: bash
- name: Build (of_ccobj)
if: startsWith(runner.os, 'Linux')
run: |
mkdir -p build
cd build
cmake .. ${{ env.cmake_flags }} -DTHIRD_PARTY=OFF -DONEFLOW=ON -DTHIRD_PARTY_DIR=$(realpath ../third_party_install)
make -j ${{ matrix.make_concurrency }} of_ccobj
cmake .. ${{ env.cmake_flags }} -DTHIRD_PARTY=OFF -DONEFLOW=ON -DTHIRD_PARTY_DIR=$PWD/../third_party_install
cmake --build . -j ${{ matrix.make_concurrency }} --target of_ccobj
shell: bash
- name: Build (oneflow_internal)
if: startsWith(runner.os, 'Linux')
run: |
mkdir -p build
cd build
cmake .. ${{ env.cmake_flags }} -DTHIRD_PARTY=OFF -DONEFLOW=ON
make -j ${{ matrix.make_concurrency }} oneflow_internal
cmake --build . -j ${{ matrix.make_concurrency }} --target oneflow_internal
shell: bash
- name: Build (generate_api)
if: startsWith(runner.os, 'Linux')
run: |
mkdir -p build
cd build
cmake .. ${{ env.cmake_flags }} -DTHIRD_PARTY=OFF -DONEFLOW=ON
make -j ${{ matrix.make_concurrency }} generate_api
cmake --build . -j ${{ matrix.make_concurrency }} --target generate_api
shell: bash
- name: Build (ALL)
if: startsWith(runner.os, 'Linux')
run: |
mkdir -p build
cd build
cmake .. ${{ env.cmake_flags }} -DTHIRD_PARTY=OFF -DONEFLOW=ON
make -j ${{ matrix.make_concurrency }}
cmake --build . -j ${{ matrix.make_concurrency }}
shell: bash
- name: Exe test
if: startsWith(runner.os, 'Linux')
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# OneFlow

**OneFlow is a performance-centered and open-source deep learning framework.**

[![Simple CI](https://github.com/Oneflow-Inc/oneflow/actions/workflows/simple.yml/badge.svg)](https://github.com/Oneflow-Inc/oneflow/actions/workflows/simple.yml)

## Install OneFlow

### System Requirements
Expand Down
2 changes: 1 addition & 1 deletion cmake/third_party/grpc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ExternalProject_Add(grpc
URL_HASH MD5=${GRPC_URL_HASH}
UPDATE_COMMAND ""
BUILD_IN_SOURCE 1
BUILD_COMMAND make -j${PROC_NUM} grpc grpc_unsecure grpc++_unsecure
BUILD_COMMAND ${CMAKE_COMMAND} --build . -j ${PROC_NUM} -t grpc grpc_unsecure grpc++_unsecure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

要不要顺便把 lz4.cmake、openssl.cmake、nccl.cmake 也改掉

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

要不要顺便把 lz4.cmake、openssl.cmake、nccl.cmake 也改掉

好主意

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note
没有成功,因为那几个项目是make项目,cmake --build 如果调用的是 ninja,就会失败

INSTALL_COMMAND ""
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
Expand Down
4 changes: 3 additions & 1 deletion cmake/third_party/lz4.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ set(LZ4_CFLAGS "-O3 -fPIC")

if(THIRD_PARTY)

include(ProcessorCount)
ProcessorCount(PROC_NUM)
ExternalProject_Add(lz4
PREFIX lz4
URL ${LZ4_URL}
URL_MD5 3898c56c82fb3d9455aefd48db48eaad
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_IN_SOURCE 1
BUILD_COMMAND make -j lib CFLAGS=${LZ4_CFLAGS}
BUILD_COMMAND make -j ${PROC_NUM} lib CFLAGS=${LZ4_CFLAGS}
INSTALL_COMMAND ""
)

Expand Down