Skip to content

Commit

Permalink
Merge branch 'master' of github.com:apache/singa
Browse files Browse the repository at this point in the history
  • Loading branch information
moazreyad committed Aug 26, 2021
2 parents d34e27d + 93fd9da commit 3304bfc
Show file tree
Hide file tree
Showing 191 changed files with 24,038 additions and 19,147 deletions.
2 changes: 2 additions & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ github:
wiki: true
# Enable issues on github
issues: true
# Enable settings on github
settings: true
19 changes: 19 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

ignore:
- proto/*
71 changes: 71 additions & 0 deletions .github/workflows/conda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# This is a basic workflow to help you get started with Actions

name: conda

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
pull_request:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-pytest-package-ubuntu:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: install-conda-build
run: conda install conda-build=3.20.4 anaconda-client
- name: conda-config
run: conda config --add channels conda-forge && conda config --add channels nusdbsystem && conda config --set anaconda_upload no
- name: build-pytest
run: conda build tool/conda/singa --python 3.6
env:
TEST_COMMAND: pytest --cov=$PREFIX/lib/python3.7/site-packages/singa --cov-report=xml && codecov --flags singa-python
- name: upload-package
env:
ANACONDA_UPLOAD_TOKEN: ${{ secrets.ANACONDA_UPLOAD_TOKEN }}
if: ${{ env.ANACONDA_UPLOAD_TOKEN }}
run: /usr/share/miniconda/bin/anaconda -t $ANACONDA_UPLOAD_TOKEN upload -u nusdbsystem -l main /usr/share/miniconda/conda-bld/linux-64/singa-*.tar.bz2 --force
#


build-pytest-package-macos:
runs-on: macos-latest

steps:
- uses: actions/checkout@v1
- name: set permission
run: sudo chmod -R 777 /usr/local/miniconda
# && xcrun --show-sdk-path
- name: install-conda-build
run: conda install conda-build anaconda-client
- name: conda-config
run: conda config --add channels conda-forge && conda config --add channels nusdbsystem && conda config --set anaconda_upload no
- name: build-pytest
run: conda build tool/conda/singa --python 3.6
env:
TEST_COMMAND: pytest --cov=$PREFIX/lib/python3.6/site-packages/singa --cov-report=xml && codecov --flags singa-python
- name: upload-package
env:
ANACONDA_UPLOAD_TOKEN: ${{ secrets.ANACONDA_UPLOAD_TOKEN }}
if: ${{ env.ANACONDA_UPLOAD_TOKEN }}
run: /usr/local/miniconda/bin/anaconda -t $ANACONDA_UPLOAD_TOKEN upload -u nusdbsystem -l main /usr/local/miniconda/conda-bld/osx-64/singa-*.tar.bz2 --force
59 changes: 59 additions & 0 deletions .github/workflows/macOS.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: Native-MacOS

on:
push:
pull_request:

jobs:
build-cpptest-cpu:
runs-on: macos-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: install-build-dependencies
run: |
brew install protobuf swig opencv glog lmdb numpy
wget https://github.com/oneapi-src/oneTBB/releases/download/v2020.1/tbb-2020.1-mac.tgz
mkdir /tmp/tbb
tar zxvf tbb-2020.1-mac.tgz -C /tmp/tbb --strip-components=1
mv /tmp/tbb/lib/lib* /usr/local/lib/
pip3 install numpy && wget https://github.com/oneapi-src/oneDNN/releases/download/v1.2/dnnl_mac_1.2.0_cpu_tbb.tgz -P /tmp
tar zxf /tmp/dnnl_mac_1.2.0_cpu_tbb.tgz -C /tmp
- name: configure
run: mkdir build && cd build && cmake -DUSE_PYTHON3=YES -DENABLE_TEST=YES -DUSE_DNNL=YES ..
env:
CMAKE_INCLUDE_PATH: /usr/local/opt/openblas/include:$CMAKE_INCLUDE_PATH
CMAKE_LIBRARY_PATH: /usr/local/opt/openblas/lib:$CMAKE_LIBRARY_PATH
DNNL_ROOT: /tmp/dnnl_mac_1.2.0_cpu_tbb/
- name: build
run: cd build && make
env:
CXXFLAGS: -I /Users/runner/hostedtoolcache/Python/3.7.8/x64/lib/python3.7/site-packages/numpy/core/include $CXXFLAGS
LD_LIBRARY_PATH: /usr/local/opt/openblas/lib:/tmp/dnnl_mac_1.2.0_cpu_tbb/lib:$LD_LIBRARY_PATH
- name: C++ test
run: |
install_name_tool -change libdnnl.1.dylib /tmp/dnnl_mac_1.2.0_cpu_tbb/lib/libdnnl.1.dylib /Users/runner/work/singa/singa/build/lib/libsinga.dylib
install_name_tool -change libdnnl.1.dylib /tmp/dnnl_mac_1.2.0_cpu_tbb/lib/libdnnl.1.dylib build/bin/test_singa
build/bin/test_singa
env:
LD_LIBRARY_PATH: /usr/local/opt/openblas/lib:/tmp/dnnl_mac_1.2.0_cpu_tbb/lib:$LD_LIBRARY_PATH
2 changes: 1 addition & 1 deletion .github/workflows/rat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# This is a basic workflow to help you get started with Actions

name: CI
name: License-Check

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/ubuntu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# This is a basic workflow to help you get started with Actions

name: Native-Ubuntu

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
pull_request:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# build-ubuntu-cpp:
# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v1
# - name: install-build-dependencies
# run: sudo apt-get install -y libgoogle-glog-dev libprotobuf-dev protobuf-compiler libncurses-dev libopenblas-dev gfortran libblas-dev liblapack-dev libatlas-base-dev swig libcurl3-dev cmake dh-autoreconf
# - name: configure
# run: mkdir build && cd build && cmake -DUSE_PYTHON=NO -DENABLE_TEST=YES ..
# - name: build
# run: cd build && make
# - name: C++ test
# run: build/bin/test_singa

build-cpptest-on-cpu:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: get-oneDNN
run: wget https://github.com/oneapi-src/oneDNN/releases/download/v1.1/dnnl_lnx_1.1.0_cpu_gomp.tgz -P /tmp/ && tar zxf /tmp/dnnl_lnx_1.1.0_cpu_gomp.tgz -C /tmp
- name: install-build-dependencies
run: sudo apt-get install -y libgoogle-glog-dev libprotobuf-dev protobuf-compiler libncurses-dev libopenblas-dev gfortran libblas-dev liblapack-dev libatlas-base-dev swig dh-autoreconf lcov
- name: configure
run: mkdir build && cd build && cmake -DUSE_PYTHON=NO -DENABLE_TEST=YES -DCODE_COVERAGE=YES -DUSE_DNNL=YES ..
env:
DNNL_ROOT: /tmp/dnnl_lnx_1.1.0_cpu_gomp/
- name: build
run: cd build && make
- name: C++ test
run: build/bin/test_singa
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
flags: singa-cpp
70 changes: 0 additions & 70 deletions .travis.yml

This file was deleted.

28 changes: 18 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,22 @@ PROJECT(singa)

LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Thirdparty)

include(GetGitRevisionDescription)
git_describe(VERSION --tags --dirty=-d)
string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VERSION}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "${VERSION}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" VERSION_PATCH "${VERSION}")
#include(GetGitRevisionDescription)
#git_describe(VERSION --tags --dirty=-d)
#string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VERSION}")
#string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "${VERSION}")
#string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" VERSION_PATCH "${VERSION}")


SET(PACKAGE_VERSION 3.2.0) # ${VERSION})
SET(VERSION 3.2.0)
SET(SINGA_MAJOR_VERSION 3)
SET(SINGA_MINOR_VERSION 2)
SET(SINGA_PATCH_VERSION 0)
#SET(SINGA_MAJOR_VERSION ${VERSION_MAJOR}) # 0 -
#SET(SINGA_MINOR_VERSION ${VERSION_MINOR}) # 0 - 9
#SET(SINGA_PATCH_VERSION ${VERSION_PATCH}) # 0 - 99


SET(PACKAGE_VERSION ${VERSION})
SET(SINGA_MAJOR_VERSION ${VERSION_MAJOR}) # 0 -
SET(SINGA_MINOR_VERSION ${VERSION_MINOR}) # 0 - 9
SET(SINGA_PATCH_VERSION ${VERSION_PATCH}) # 0 - 99
MATH(EXPR SINGA_VERSION "${SINGA_MAJOR_VERSION} * 1000 + ${SINGA_MINOR_VERSION} * 100 + ${SINGA_PATCH_VERSION}")

message(STATUS "SINGA git Version ${VERSION}")
Expand Down Expand Up @@ -67,6 +72,7 @@ INCLUDE_DIRECTORIES(${SINGA_INCLUDE_DIR})

OPTION(USE_CUDA "Use Cuda libs" OFF)
OPTION(ENABLE_TEST "Enable unit test" OFF)
option(CODE_COVERAGE "Enable coverage reporting" OFF)
OPTION(USE_PYTHON "Generate py wrappers" ON)
OPTION(USE_PYTHON3 "Python 3x" OFF)

Expand Down Expand Up @@ -112,6 +118,8 @@ IF (USE_CUDA)
#ADD_SUBDIRECTORY(lib/cnmem)
#LIST(APPEND SINGA_LINKER_LIBS cnmem)
SET(global_cuda_objs "")
# add support cuda fp16
SET(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --gpu-architecture=compute_75")
ENDIF()

# TODO(wangwei) detect the ev lib
Expand Down

0 comments on commit 3304bfc

Please sign in to comment.