Skip to content

Commit

Permalink
Merge pull request #1 from RadeonOpenCompute/master
Browse files Browse the repository at this point in the history
Pull from upstream
  • Loading branch information
settle authored Aug 22, 2020
2 parents 1517a9f + 10b1a8e commit d7d0549
Show file tree
Hide file tree
Showing 984 changed files with 841,112 additions and 6,390 deletions.
Binary file added AMD1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Current_Release_Notes/AMD1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,057 changes: 1,034 additions & 23 deletions Current_Release_Notes/Current-Release-Notes.rst

Large diffs are not rendered by default.

Binary file added Current_Release_Notes/HIPClang2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Current_Release_Notes/HipClang2.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Current_Release_Notes/MultiIns.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Current_Release_Notes/RDCComponentsrevised.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Current_Release_Notes/RPP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Current_Release_Notes/Versionchange1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Current_Release_Notes/amdblack.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Current_Release_Notes/onnx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Current_Release_Notes/singleinstance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
959 changes: 924 additions & 35 deletions Deep_learning/Deep-learning.rst

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions Deep_learning/MXNet.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
.. _mxnet:

=========
MXNet
=========

.. image:: MXNet_image1.png

MXNet is a deep learning framework that has been ported to the HIP port of MXNet. It works both on HIP/ROCm and HIP/CUDA platforms.
Mxnet makes use of rocBLAS,rocRAND,hcFFT and MIOpen APIs.
It allows you to mix `symbolic and imperative programming <https://mxnet.incubator.apache.org/architecture/index.html#deep-learning-system-design-concepts>`_ to **maximize** efficiency and productivity. At its core, MXNet contains a dynamic dependency scheduler that automatically parallelizes both symbolic and imperative operations on the fly. A graph optimization layer on top of that makes symbolic execution fast and memory efficient. MXNet is portable and lightweight, scaling effectively to multiple GPUs and multiple machines.

MXNet is more than a deep learning project. It is a collection of `blue prints and guidelines <https://mxnet.incubator.apache.org/architecture/index.html#deep-learning-system-design-concepts>`_ for building deep learning systems, and interesting insights of DL systems for hackers.

Installation Guide for MXNet library
#####################################

Prerequisites
**************

`GCC 4.8 <https://gcc.gnu.org/gcc-4.8/>`_ or later to compile C++ 11.
`GNU Make <https://www.gnu.org/software/make/>`_

**Install Dependencies to build mxnet for HIP/ROCm**

* Install ROCm following AMD `ROCm's Installation Guide <http://rocm-documentation.readthedocs.io/en/latest/Installation_Guide/Installation-Guide.html#installing-from-amd-rocm-repositories>`_ to setup MXNet with GPU support.

* Install ROCm Libraries

::
sudo apt install -y rocm-device-libs rocm-libs rocblas hipblas rocrand rocfft

* Install ROCm opencl

::

sudo apt install -y rocm-opencl rocm-opencl-dev

* Install MIOpen for acceleration

::

sudo apt install -y miopengemm miopen-hip

* Install rocthrust,rocprim, hipcub Libraries

::

sudo apt install -y rocthrust rocprim hipcub
**Install Dependencies to build mxnet for HIP/CUDA**

Install CUDA following the NVIDIA’s `installation guide <http://docs.nvidia.com/cuda/cuda-installation-guide-linux/>`_ to setup MXNet with GPU support

.. note::
* Make sure to add CUDA install path to LD_LIBRARY_PATH
* Example - export LD_LIBRARY_PATH=/usr/local/cuda/lib64/:$LD_LIBRARY_PATH

Install the dependencies hipblas, rocrand, hcfft from source.

Build the MXNet library
########################

**Step 1: Install build tools.**
::
$ sudo apt-get update
$ sudo apt-get install -y build-essential
**Step 2: Install OpenBLAS.**
MXNet uses BLAS and LAPACK libraries for accelerated numerical computations on CPU machine. There are several flavors of BLAS/LAPACK libraries - OpenBLAS, ATLAS and MKL. In this step we install OpenBLAS. You can choose to install ATLAS or MKL.
::
$ sudo apt-get install -y libopenblas-dev liblapack-dev libomp-dev libatlas-dev libatlas-base-dev

**Step 3: Install OpenCV.**
Install OpenCV <https://opencv.org/>`_ here.
MXNet uses OpenCV for efficient image loading and augmentation operations.
::
$ sudo apt-get install -y libopencv-dev

**Step 4: Download MXNet sources and build MXNet core shared library.**
::
$ git clone --recursive https://github.com/ROCmSoftwarePlatform/mxnet.git
$ cd mxnet
$ export PATH=/opt/rocm/bin:$PATH

**Step 5:**

**To compile on HCC PLATFORM(HIP/ROCm):**
::
$ export HIP_PLATFORM=hcc

**To compile on NVCC PLATFORM(HIP/CUDA):**
::
$ export HIP_PLATFORM=nvcc

**Step 6: To enable MIOpen for higher acceleration :**
::
USE_CUDNN=1

**Step 7:**
**If building on CPU:**
::
make -jn(n=number of cores) USE_GPU=0 (For Ubuntu 16.04)
make -jn(n=number of cores) CXX=g++-6 USE_GPU=0 (For Ubuntu 18.04)
**If building on GPU:**
::
make -jn(n=number of cores) USE_GPU=1 (For Ubuntu 16.04)
make -jn(n=number of cores) CXX=g++-6 USE_GPU=1 (For Ubuntu 18.04)

On succesfull compilation a library called libmxnet.so is created in mxnet/lib path.

**Note:**
1. USE_CUDA(to build on GPU), USE_CUDNN(for acceleration) flags can be changed in make/config.mk.
2. To compile on HIP/CUDA make sure to set USE_CUDA_PATH to right CUDA installation path in make/config.mk. In most cases it is - /usr/local/cuda.


Install the MXNet Python binding
##################################

**Step 1: Install prerequisites - python, setup-tools, python-pip and numpy.**
::
$ sudo apt-get install -y python-dev python-setuptools python-numpy python-pip python-scipy
$ sudo apt-get install python-tk
$ sudo apt install -y fftw3 fftw3-dev pkg-config



**Step 2: Install the MXNet Python binding.**
::
$ cd python
$ sudo python setup.py install

**Step 3: Execute sample example**
::
$ cd example/
$ cd bayesian-methods/

To run on gpu change mx.cpu() to mx.gpu() in python script (Example- bdk_demo.py)

::
$ python bdk_demo.py


Binary file added Deep_learning/MXNet_image1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions Deep_learning/caffe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,26 @@ Steps::
./scripts/download_model_binary.py models/bvlc_reference_caffenet
./build/examples/cpp_classification/classification.bin \ models/bvlc_reference_caffenet/deploy.prototxt \models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel \data/ilsvrc12/imagenet_mean.binaryproto \data/ilsvrc12/synset_words.txt \examples/images/cat.jpg

Soumith's Convnet benchmarks
+++++++++++++++++++++++++++++++

Steps:

::
git clone https://github.com/soumith/convnet-benchmarks.git
cd convnet-benchmarks/caffe


OPTIONAL: reduce the batch sizes to avoid running out of memory for GoogleNet and VGG. For example, these configs work on Fiji: sed -i 's|input_dim: 128|input_dim: 8|1' imagenet_winners/googlenet.prototxt

::

export CAFFE_ROOT=/path/to/your/caffe/installation
sed -i 's#./caffe/build/tools/caffe#$CAFFE_ROOT/build/tools/caffe#' ./run_imagenet.sh
./run_imagenet.sh


Known Issues
-------------

Expand Down
Loading

0 comments on commit d7d0549

Please sign in to comment.