Skip to content

Commit 70eb0cc

Browse files
author
Ye Joey
committed
1. Refine Makefile
2. Rewrite the release notes with markdown format 3. Add the missed files in SqueezeNet
1 parent 0c199e3 commit 70eb0cc

8 files changed

Lines changed: 936 additions & 49 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
CaffeOnACL is a project to use ARM Compute Library (NEON+GPU) to speed up caffe and provide utilities to debug, profile and tune application performance.
55

66
Check out the documents for the details like
7-
- [release notes](https://github.com/OAID/caffeOnACL/tree/master/docs/caffeOnACL_release_notes_0_2_0.docx)
7+
- [release notes](https://github.com/OAID/caffeOnACL/tree/master/acl_openailab/README.md)
88
- [user guide](https://github.com/OAID/caffeOnACL/tree/master/docs/caffeOnACL_user_guide_0_2_0.docx)
99

1010

acl_openailab/Makefile.config.acl

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
## Refer to http://caffe.berkeleyvision.org/installation.html
2+
# Contributions simplifying and improving our build system are welcome!
3+
4+
# cuDNN acceleration switch (uncomment to build with cuDNN).
5+
# USE_CUDNN := 1
6+
7+
# CPU-only switch (uncomment to build without GPU support).
8+
CPU_ONLY := 1
9+
10+
# Enable ACL (ARM Compute Library)
11+
USE_ACL :=1
12+
13+
USE_PROFILING := 0
14+
15+
ifeq ($(USE_ACL), 1)
16+
ifeq ($(ACL_ROOT),)
17+
$(error ACL_ROOT does not specified. use "export ACL_ROOT='path of acl soure code'")
18+
endif
19+
20+
ACL_INCS :=$(ACL_ROOT)/include
21+
ACL_INCS +=$(ACL_ROOT)
22+
ACL_LIBS_DIR :=$(ACL_ROOT)/build
23+
ACL_LIBS_DIR +=$(ACL_ROOT)/build/arm_compute
24+
ACL_LIBS :=arm_compute OpenCL
25+
endif
26+
27+
# uncomment to disable IO dependencies and corresponding data layers
28+
# USE_OPENCV := 0
29+
# USE_LEVELDB := 0
30+
# USE_LMDB := 0
31+
32+
# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
33+
# You should not set this flag if you will be reading LMDBs with any
34+
# possibility of simultaneous read and write
35+
# ALLOW_LMDB_NOLOCK := 1
36+
37+
# Uncomment if you're using OpenCV 3
38+
# OPENCV_VERSION := 3
39+
40+
# To customize your choice of compiler, uncomment and set the following.
41+
# N.B. the default for Linux is g++ and the default for OSX is clang++
42+
# CUSTOM_CXX := g++
43+
#CUSTOM_CXX := aarch64-linux-gnu-g++
44+
#os :=linux
45+
#arch :=arm64-v8a
46+
47+
# CUDA directory contains bin/ and lib/ directories that we need.
48+
CUDA_DIR := /usr/local/cuda
49+
# On Ubuntu 14.04, if cuda tools are installed via
50+
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
51+
# CUDA_DIR := /usr
52+
53+
# CUDA architecture setting: going with all of them.
54+
# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
55+
# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
56+
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
57+
-gencode arch=compute_20,code=sm_21 \
58+
-gencode arch=compute_30,code=sm_30 \
59+
-gencode arch=compute_35,code=sm_35 \
60+
-gencode arch=compute_50,code=sm_50 \
61+
-gencode arch=compute_52,code=sm_52 \
62+
-gencode arch=compute_60,code=sm_60 \
63+
-gencode arch=compute_61,code=sm_61 \
64+
-gencode arch=compute_61,code=compute_61
65+
66+
# BLAS choice:
67+
# atlas for ATLAS (default)
68+
# mkl for MKL
69+
# open for OpenBlas
70+
#BLAS := atlas
71+
BLAS := open
72+
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
73+
# Leave commented to accept the defaults for your choice of BLAS
74+
# (which should work)!
75+
# BLAS_INCLUDE := /path/to/your/blas
76+
# BLAS_LIB := /path/to/your/blas
77+
78+
# Homebrew puts openblas in a directory that is not on the standard search path
79+
# BLAS_INCLUDE := $(shell brew --prefix openblas)/include
80+
# BLAS_LIB := $(shell brew --prefix openblas)/lib
81+
82+
# This is required only if you will compile the matlab interface.
83+
# MATLAB directory should contain the mex binary in /bin.
84+
# MATLAB_DIR := /usr/local
85+
# MATLAB_DIR := /Applications/MATLAB_R2012b.app
86+
87+
# NOTE: this is required only if you will compile the python interface.
88+
# We need to be able to find Python.h and numpy/arrayobject.h.
89+
PYTHON_INCLUDE := /usr/include/python2.7 \
90+
/usr/lib/python2.7/dist-packages/numpy/core/include
91+
# Anaconda Python distribution is quite popular. Include path:
92+
# Verify anaconda location, sometimes it's in root.
93+
# ANACONDA_HOME := $(HOME)/anaconda
94+
# PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
95+
# $(ANACONDA_HOME)/include/python2.7 \
96+
# $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include
97+
98+
# Uncomment to use Python 3 (default is Python 2)
99+
# PYTHON_LIBRARIES := boost_python3 python3.5m
100+
# PYTHON_INCLUDE := /usr/include/python3.5m \
101+
# /usr/lib/python3.5/dist-packages/numpy/core/include
102+
103+
# We need to be able to find libpythonX.X.so or .dylib.
104+
PYTHON_LIB := /usr/lib
105+
# PYTHON_LIB := $(ANACONDA_HOME)/lib
106+
107+
# Homebrew installs numpy in a non standard path (keg only)
108+
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
109+
# PYTHON_LIB += $(shell brew --prefix numpy)/lib
110+
111+
# Uncomment to support layers written in Python (will link against Python libs)
112+
# WITH_PYTHON_LAYER := 1
113+
114+
# Whatever else you find you need goes here.
115+
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
116+
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
117+
118+
# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
119+
# INCLUDE_DIRS += $(shell brew --prefix)/include
120+
# LIBRARY_DIRS += $(shell brew --prefix)/lib
121+
122+
# NCCL acceleration switch (uncomment to build with NCCL)
123+
# https://github.com/NVIDIA/nccl (last tested version: v1.2.3-1+cuda8.0)
124+
# USE_NCCL := 1
125+
126+
# Uncomment to use `pkg-config` to specify OpenCV library paths.
127+
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
128+
# USE_PKG_CONFIG := 1
129+
130+
# N.B. both build and distribute dirs are cleared on `make clean`
131+
BUILD_DIR := build
132+
DISTRIBUTE_DIR := distribute
133+
134+
#HDF5
135+
USE_HDF5 := 1
136+
HDF5_INCLUDE_DIRS := /usr/include/hdf5/serial
137+
HDF5_LIBRARY_DIRS := /usr/lib/aarch64-linux-gnu/hdf5/serial
138+
HDF5_LIBRARIES :=hdf5_hl hdf5
139+
140+
# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
141+
# DEBUG := 1
142+
143+
# The ID of the GPU that 'make runtest' will use to run unit tests.
144+
TEST_GPUID := 0
145+
146+
# enable pretty build (comment to see full commands)
147+
Q ?= @

acl_openailab/README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
![OPEN AI LAB](https://github.com/OAID/caffeOnACL/blob/master/acl_openailab/pics/openailab.png)
2+
3+
# 1. Release Notes
4+
[![License](https://img.shields.io/badge/license-BSD-blue.svg)](LICENSE)
5+
6+
Please refer to [CaffeOnACL Release NOTE](https://github.com/OAID/caffeOnACL/blob/master/acl_openailab/Reversion.md) for details
7+
8+
# 2. Preparation
9+
## 2.1 General dependencies installation
10+
sudo apt-get -y update
11+
sodo apt-get -y upgrade
12+
sudo apt-get install -y build-essential pkg-config automake autoconf protobuf-compiler cmake cmake-gui
13+
sudo apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev
14+
sudo apt-get install -y libatlas-base-dev libgflags-dev libgoogle-glog-dev liblmdb-dev libopenblas-dev
15+
sudo apt-get install -y libopencv-dev python-dev
16+
sudo apt-get install -y python-numpy python-scipy python-yaml python-six python-pip
17+
sudo apt-get install -y scons git
18+
sudo apt-get install -y --no-install-recommends libboost-all-dev
19+
pip install --upgrade pip
20+
21+
## 2.2 Download source code
22+
Recommend creating a new directory in your work directory to execute the following steps. For example, you can create a direcotry named "oaid" in your home directory by the following commands.<br>
23+
24+
cd ~
25+
mkdir oaid
26+
cd oaid
27+
28+
#### Download "ACL" (arm_compute : v17.05):
29+
git clone https://github.com/ARM-software/ComputeLibrary.git
30+
#### Download "CaffeOnACL" :
31+
git clone https://github.com/OAID/caffeOnACL.git
32+
#### Download "Googletest" :
33+
git clone https://github.com/google/googletest.git
34+
35+
# 3. Build CaffeOnACL
36+
## 3.1 Build ACL :
37+
cd ~/oaid/ComputeLibrary
38+
scons Werror=1 -j8 debug=0 asserts=1 neon=1 opencl=1 embed_kernels=1 os=linux arch=arm64-v8a
39+
40+
## 3.2 Build Caffe :
41+
export ACL_ROOT=~/oaid/ComputeLibrary
42+
cd ~/oaid/caffeOnACL
43+
cp acl_openailab/Makefile.config.acl Makefile.config
44+
make all distribute
45+
46+
## 3.3 Build Unit tests
47+
##### Build the gtest libraries
48+
cd ~/oaid/googletest
49+
cmake CMakeLists.txt
50+
make
51+
sudo make install
52+
53+
##### Build Caffe Unit tests
54+
export CAFFE_ROOT=~/oaid/caffeOnACL
55+
cd ~/oaid/caffeOnACL/unit_tests
56+
make clean
57+
make
58+
59+
## 3.3 Run tests
60+
If the output message of the following two tests is same as the examples, it means the porting is success.
61+
62+
export LD_LIBRARY_PATH=~/oaid/caffeOnACL/distribute/lib:~/oaid/ComputeLibrary/build
63+
64+
#### Reference Caffenet
65+
cd ~/oaid/caffeOnACL/data/ilsvrc12
66+
sudo chmod +x get_ilsvrc_aux.sh
67+
./get_ilsvrc_aux.sh
68+
cd ../..
69+
./scripts/download_model_binary.py ./models/bvlc_reference_caffenet
70+
./distribute/bin/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
71+
output message --
72+
---------- Prediction for examples/images/cat.jpg ----------
73+
0.3094 - "n02124075 Egyptian cat"
74+
0.1761 - "n02123159 tiger cat"
75+
0.1221 - "n02123045 tabby, tabby cat"
76+
0.1132 - "n02119022 red fox, Vulpes vulpes"
77+
0.0421 - "n02085620 Chihuahua"
78+
79+
#### Unit test
80+
cd ~/oaid/caffeOnACL/unit_tests
81+
./test_caffe_main
82+
output message:
83+
[==========] 29 tests from 6 test cases ran. (1236 ms total) [ PASSED ] 29 tests.

acl_openailab/Reversion.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Release Note
2+
[![License](https://img.shields.io/badge/license-BSD-blue.svg)](LICENSE)
3+
4+
The release version is 0.2.0. You can download the source code from [OAID/caffeOnACL](https://github.com/OAID/caffeOnACL)
5+
6+
## Verified Platform :
7+
8+
The release is verified on 64bits ARMv8 processor<br>
9+
* Hardware platform : Rockchip RK3399 (firefly RK3399 board)<br>
10+
* Software platform : Ubuntu 16.04<br>
11+
12+
## 10 Layers accelerated by ACL layers :
13+
* ConvolutionLayer
14+
* PoolingLayer
15+
* LRNLayer
16+
* ReLULayer
17+
* SigmoidLayer
18+
* SoftmaxLayer
19+
* TanHLayer
20+
* AbsValLayer
21+
* BNLLLayer
22+
* InnerProductLayer
23+
24+
## ACL compatibility issues :
25+
There are some compatibility issues between ACL and caffe Layers, we bypass it to Caffe's original layer class as the workaround solution for the below issues
26+
* Normalization in-channel issue
27+
* Tanh issue
28+
* Even Kernel size
29+
* Softmax supporting multi-dimension issue
30+
* Group issue
31+
* Performance need be fine turned in the future
32+
33+
# Changelist
34+
The caffe based version is `793bd96351749cb8df16f1581baf3e7d8036ac37`.
35+
## New Files :
36+
Makefile.config.acl
37+
cmake/Modules/FindACL.cmake
38+
examples/cpp_classification/classification_profiling.cpp
39+
examples/cpp_classification/classification_profiling_gpu.cpp
40+
include/caffe/acl_layer.hpp
41+
include/caffe/layers/acl_absval_layer.hpp
42+
include/caffe/layers/acl_base_activation_layer.hpp
43+
include/caffe/layers/acl_bnll_layer.hpp
44+
include/caffe/layers/acl_conv_layer.hpp
45+
include/caffe/layers/acl_inner_product_layer.hpp
46+
include/caffe/layers/acl_lrn_layer.hpp
47+
include/caffe/layers/acl_pooling_layer.hpp
48+
include/caffe/layers/acl_relu_layer.hpp
49+
include/caffe/layers/acl_sigmoid_layer.hpp
50+
include/caffe/layers/acl_softmax_layer.hpp
51+
include/caffe/layers/acl_tanh_layer.hpp
52+
models/SqueezeNet/README.md
53+
models/SqueezeNet/SqueezeNet_v1.1/squeezenet.1.1.deploy.prototxt
54+
src/caffe/acl_layer.cpp
55+
src/caffe/layers/acl_absval_layer.cpp
56+
src/caffe/layers/acl_base_activation_layer.cpp
57+
src/caffe/layers/acl_bnll_layer.cpp
58+
src/caffe/layers/acl_conv_layer.cpp
59+
src/caffe/layers/acl_inner_product_layer.cpp
60+
src/caffe/layers/acl_lrn_layer.cpp
61+
src/caffe/layers/acl_pooling_layer.cpp
62+
src/caffe/layers/acl_relu_layer.cpp
63+
src/caffe/layers/acl_sigmoid_layer.cpp
64+
src/caffe/layers/acl_softmax_layer.cpp
65+
src/caffe/layers/acl_tanh_layer.cpp
66+
unit_tests/Makefile
67+
unit_tests/pmu.c
68+
unit_tests/pmu.h
69+
unit_tests/prof_convolution_layer.cpp
70+
unit_tests/sgemm.cpp
71+
unit_tests/test.cpp
72+
unit_tests/test_caffe_main.cpp
73+
unit_tests/test_common.cpp
74+
unit_tests/test_convolution_layer.cpp
75+
unit_tests/test_fail.cpp
76+
unit_tests/test_inner_product_layer.cpp
77+
unit_tests/test_lrn_layer.cpp
78+
unit_tests/test_neuron_layer.cpp
79+
unit_tests/test_pooling_layer.cpp
80+
unit_tests/test_softmax_layer.cpp
81+
unit_tests/testbed.c
82+
unit_tests/testbed.h
83+
84+
## Change Files :
85+
Makefile
86+
cmake/Dependencies.cmake
87+
include/caffe/caffe.hpp
88+
include/caffe/common.hpp
89+
include/caffe/layer.hpp
90+
include/caffe/util/device_alternate.hpp
91+
include/caffe/util/hdf5.hpp
92+
src/caffe/common.cpp
93+
src/caffe/layer.cpp
94+
src/caffe/layer_factory.cpp
95+
src/caffe/layers/absval_layer.cpp
96+
src/caffe/layers/bnll_layer.cpp
97+
src/caffe/layers/hdf5_data_layer.cpp
98+
src/caffe/layers/hdf5_data_layer.cu
99+
src/caffe/layers/hdf5_output_layer.cpp
100+
src/caffe/layers/hdf5_output_layer.cu
101+
src/caffe/layers/inner_product_layer.cpp
102+
src/caffe/net.cpp
103+
src/caffe/solvers/sgd_solver.cpp
104+
src/caffe/syncedmem.cpp
105+
src/caffe/test/test_hdf5_output_layer.cpp
106+
src/caffe/test/test_hdf5data_layer.cpp
107+
src/caffe/util/hdf5.cpp
108+
src/caffe/util/math_functions.cpp
109+
110+
# Issue report
111+
Encounter any issue, please report on [issue report](https://github.com/OAID/caffeOnACL/issues). Issue report should contain the following information :
112+
* The exact description of the steps that are needed to reproduce the issue
113+
* The exact description of what happens and what you think is wrong

acl_openailab/pics/openailab.png

368 KB
Loading

models/SqueezeNet/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
Download the model files from https://github.com/DeepScale/SqueezeNet/tree/master/SqueezeNet_v1.1
3+
The model architecture file for deploying is:
4+
SqueezeNet_v1.1/squeezenet.1.1.deploy.prototxt

0 commit comments

Comments
 (0)