You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by wa...@apache.org on 2018/05/13 14:46:15 UTC

[1/3] incubator-singa git commit: SINGA-361 Add git instructions for contributors and committers

Repository: incubator-singa
Updated Branches:
  refs/heads/master 00573e26b -> 394d78d00


SINGA-361 Add git instructions for contributors and committers


Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/6d43cc99
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/6d43cc99
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/6d43cc99

Branch: refs/heads/master
Commit: 6d43cc99280b162d43851de33732cd82e0ecbd16
Parents: 00573e2
Author: Moaz Reyad <mo...@gmail.com>
Authored: Sun May 13 05:08:45 2018 +0800
Committer: Moaz Reyad <mo...@gmail.com>
Committed: Sun May 13 05:08:45 2018 +0800

----------------------------------------------------------------------
 doc/en/community/source-repository.md  | 22 ------------
 doc/en/community/source-repository.rst | 56 +++++++++++++++++++++++++++++
 doc/en/index.rst                       |  5 ---
 3 files changed, 56 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/6d43cc99/doc/en/community/source-repository.md
----------------------------------------------------------------------
diff --git a/doc/en/community/source-repository.md b/doc/en/community/source-repository.md
deleted file mode 100644
index 8864629..0000000
--- a/doc/en/community/source-repository.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# Source Repository
-
-___
-
-This project uses [Git](http://git-scm.com/) to manage its source code. Instructions on Git use can be found at [http://git-scm.com/documentation](http://git-scm.com/documentation).
-
-## Web Access
-
-The following is a link to the online source repository.
-
-* [https://git-wip-us.apache.org/repos/asf?p=incubator-singa.git;a=summary](https://git-wip-us.apache.org/repos/asf?p=incubator-singa.git;a=summary)
-
-
-## Upstream for committers
-
-Committers need to set the upstream endpoint to the Apache git (not github) repo address, e.g.,
-
-    $ git remote add asf https://git-wip-us.apache.org/repos/asf/incubator-singa.git
-
-Then you (committer) can push your code in this way,
-
-    $ git push asf <local-branch>:<remote-branch>

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/6d43cc99/doc/en/community/source-repository.rst
----------------------------------------------------------------------
diff --git a/doc/en/community/source-repository.rst b/doc/en/community/source-repository.rst
new file mode 100644
index 0000000..d60f148
--- /dev/null
+++ b/doc/en/community/source-repository.rst
@@ -0,0 +1,56 @@
+.. 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.
+
+Source Repository
+=================
+
+This project uses `Git <http://git-scm.com/>`_ to manage its source code. Instructions on Git use can be found at http://git-scm.com/documentation .
+
+Web Access
+----------
+
+The following is a link to the online source repository.
+
+* https://git-wip-us.apache.org/repos/asf?p=incubator-singa.git;a=summary
+
+Contributors
+------------
+
+Contributors are encouraged to rebase their commits onto the latest master before sending the pull requests to make the git history clean. The following git instructors should be executed after committing the current work:
+
+.. code-block:: bash
+
+    git checkout master
+    git pull <apache/incubator-singa upstream> master:master
+    git checkout <new feature branch>
+    git rebase master
+
+Committers
+----------
+
+To merge pull request https://github.com/apache/incubator-singa/pull/xxx, the following instructions should be executed,
+
+.. code-block:: bash
+
+    git clone https://github.com/apache/incubator-singa.git
+    git remote add asf https://git-wip-us.apache.org/repos/asf/incubator-singa.git
+    # optional
+    git pull asf master:master
+    git fetch origin pull/xxx/head:prxxx
+    git merge prxxx
+    git push asf master:master
+

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/6d43cc99/doc/en/index.rst
----------------------------------------------------------------------
diff --git a/doc/en/index.rst b/doc/en/index.rst
index bfb68ff..0835acb 100755
--- a/doc/en/index.rst
+++ b/doc/en/index.rst
@@ -15,11 +15,6 @@
    specific language governing permissions and limitations
    under the License.
 
-
-.. SINGA documentation master file, created by
-   sphinx-quickstart on Sat Jul  9 20:36:57 2016.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
 Welcome to Apache SINGA
 =======================
 


[2/3] incubator-singa git commit: SINGA-294 Add instructions for CUDA support on Windows

Posted by wa...@apache.org.
SINGA-294 Add instructions for CUDA support on Windows


Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/2195af2f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/2195af2f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/2195af2f

Branch: refs/heads/master
Commit: 2195af2f03b48d082bd1913a094fca73221b61c9
Parents: 00573e2
Author: Moaz Reyad <mo...@gmail.com>
Authored: Sun May 13 20:58:13 2018 +0800
Committer: Moaz Reyad <mo...@gmail.com>
Committed: Sun May 13 20:58:13 2018 +0800

----------------------------------------------------------------------
 doc/en/docs/install_win.rst | 148 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 148 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/2195af2f/doc/en/docs/install_win.rst
----------------------------------------------------------------------
diff --git a/doc/en/docs/install_win.rst b/doc/en/docs/install_win.rst
index 4ab4ae5..8b6be0c 100644
--- a/doc/en/docs/install_win.rst
+++ b/doc/en/docs/install_win.rst
@@ -218,3 +218,151 @@ A video tutorial for running the unit tests can be found here:
 +---------+
 
 	
+5. Build GPU support with CUDA
+------------------------------
+
+In this section, we will extend the previous steps to enable GPU.
+
+5.1 Install Dependencies
+------------------------
+
+In addition to the dependencies in section 1 above, we will need the following:
+
+* CUDA 
+	
+	Download a suitable version such as 9.1 from https://developer.nvidia.com/cuda-downloads . Make sure to install the Visual Studio integration module.
+
+* cuDNN
+
+	Download a suitable version such as 7.1 from https://developer.nvidia.com/cudnn 
+
+* cnmem: 
+
+	* Download the latest version from https://github.com/NVIDIA/cnmem 
+	* Build the Visual Studio solution:
+	
+		.. code-block:: bash
+	
+			cmake -G "Visual Studio 15 2017 Win64"
+		
+	* Open the generated solution in Visual Studio.
+	* Change the build settings to Release and x64.
+	* Build the cnmem project.
+	
+
+5.2 Build SINGA source
+----------------------
+
+* Call cmake and add the paths in your system similar to the following example:
+
+	.. code-block:: bash
+	
+    		cmake -G "Visual Studio 15 2017 Win64" ^
+			  -DGLOG_INCLUDE_DIR="D:/WinSinga/dependencies/glog-0.3.5/src/windows" ^
+			  -DGLOG_LIBRARIES="D:/WinSinga/dependencies/glog-0.3.5/x64/Release" ^
+			  -DCBLAS_INCLUDE_DIR="D:/WinSinga/dependencies/openblas-0.2.20/lapack-netlib/CBLAS/include" ^
+			  -DCBLAS_LIBRARIES="D:/WinSinga/dependencies/openblas-0.2.20/lib/RELEASE" ^
+			  -DProtobuf_INCLUDE_DIR="D:/WinSinga/dependencies/protobuf-2.6.1/src" ^
+			  -DProtobuf_LIBRARIES="D:\WinSinga/dependencies/protobuf-2.6.1/vsprojects/x64/Release" ^
+			  -DProtobuf_PROTOC_EXECUTABLE="D:/WinSinga/dependencies/protoc-2.6.1-win32/protoc.exe" ^
+			  -DCUDNN_INCLUDE_DIR=D:\WinSinga\dependencies\cudnn-9.1-windows10-x64-v7.1\cuda\include ^
+			  -DCUDNN_LIBRARIES=D:\WinSinga\dependencies\cudnn-9.1-windows10-x64-v7.1\cuda\lib\x64 ^
+			  -DSWIG_DIR=D:\WinSinga\dependencies\swigwin-3.0.12 ^
+			  -DSWIG_EXECUTABLE=D:\WinSinga\dependencies\swigwin-3.0.12\swig.exe ^
+			  -DUSE_CUDA=YES ^
+			  -DCUDNN_VERSION=7 ^
+			  ..
+  
+
+* Generate swig interfaces for C++ and Python:
+	Goto src/api
+
+	.. code-block:: bash
+	
+		swig -python -c++ singa.i
+
+* Open the generated solution in Visual Studio
+		
+* Change the build settings to Release and x64
+
+5.2.1 Building singa_objects
+----------------------------
+
+* Add the singa_wrap.cxx file from src/api to the singa_objects project
+* In the singa_objects project, open Additional Include Directories.
+* Add Python include path
+* Add numpy include path
+* Add protobuf include path
+* Add include path for CUDA, cuDNN and cnmem
+* In the preprocessor definitions of the singa_objects project, add USE_GLOG, USE_CUDA and USE_CUDNN. Remove DISABLE_WARNINGS.
+* Build singa_objects project
+	
+5.2.2 Building singa-kernel
+---------------------------	
+
+* Create a new Visual Studio projcet of type "CUDA 9.1 Runtime". Give it a name such as singa-kernel.
+* The project comes with an initial file called kernel.cu. Remove this file from the project.
+* Add this file: src/core/tensor/math_kernel.cu 
+* In the project settings:
+
+	* Set Platfrom Toolset to "Visual Studio 2015 (v140)"
+	* Set Configuration Type to " Static Library (.lib)"
+	* In the Include Directories, add build/include.
+
+* Build singa-kernel project
+
+
+5.2.3 Building singa
+--------------------
+	
+* In singa project:
+	* add singa_wrap.obj to Object Libraries
+	* change target name to _singa_wrap
+	* change target extension to .pyd
+	* change configuration type to Dynamic Library (.dll)
+	* goto Additional Library Directories and add the path to python, openblas, protobuf and glog libraries
+	* Add also the library path to singa-kernel, cnmem, cuda and cudnn.
+	* goto Additional Dependencies and add libopenblas.lib, libglog.lib and libprotobuf.lib.
+	* Add also: singa-kernel.lib, cnmem.lib, cudnn.lib, cuda.lib , cublas.lib, curand.lib and cudart.lib.
+	
+* build singa project
+
+5.3. Install Python module
+--------------------------
+
+* Change _singa_wrap.so to _singa_wrap.pyd in build/python/setup.py 
+* Copy the files in src/proto/python_out to build/python/singa/proto
+
+* Optionally create and activate a virtual environment:
+
+.. code-block:: bash
+
+	mkdir SingaEnv
+	virtualenv SingaEnv
+	SingaEnv\Scripts\activate
+	
+* goto build/python folder and run:
+
+.. code-block:: bash
+
+	python setup.py install
+
+* Make _singa_wrap.pyd, libglog.dll, libopenblas.dll, cnmem.dll, CUDA Runtime (e.g. cudart64_91.dll) and cuDNN (e.g. cudnn64_7.dll) available by adding them to the path or by copying them to singa package folder in the python site-packages 
+	
+* Verify that SINGA is installed by running:
+
+.. code-block:: bash
+
+	python -c "from singa import device; dev = device.create_cuda_gpu()"
+
+A video tutorial for this part can be found here:
+	
+
+.. |video| image:: https://img.youtube.com/vi/YasKVjRtuDs/0.jpg
+   :scale: 100%
+   :align: middle
+   :target: https://www.youtube.com/watch?v=YasKVjRtuDs
+
++---------+
+| |video| |
++---------+


[3/3] incubator-singa git commit: Merge branch 'pr373'

Posted by wa...@apache.org.
Merge branch 'pr373'


Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/394d78d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/394d78d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/394d78d0

Branch: refs/heads/master
Commit: 394d78d00921cedb8a9399cdd20b6f05ed956777
Parents: 6d43cc9 2195af2
Author: wang wei <wa...@comp.nus.edu.sg>
Authored: Sun May 13 21:45:27 2018 +0700
Committer: wang wei <wa...@comp.nus.edu.sg>
Committed: Sun May 13 21:45:27 2018 +0700

----------------------------------------------------------------------
 doc/en/docs/install_win.rst | 148 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 148 insertions(+)
----------------------------------------------------------------------