Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Commit

Permalink
Caffe 1.1.6 prerelease, cont.
Browse files Browse the repository at this point in the history
  • Loading branch information
daisyden committed May 13, 2019
1 parent 8878d23 commit 1141d7f
Show file tree
Hide file tree
Showing 82 changed files with 1,251 additions and 8,250 deletions.
38 changes: 32 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
cmake_minimum_required(VERSION 2.8.7)
if(MSVC)
# CMake 3.4 introduced a WINDOWS_EXPORT_ALL_SYMBOLS target property that makes it possible to
# build shared libraries without using the usual declspec() decoration.
# See: https://blog.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/
# and https://cmake.org/cmake/help/v3.5/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html
# for details.
cmake_minimum_required(VERSION 3.4)
else()
cmake_minimum_required(VERSION 2.8.7)
endif()
if(POLICY CMP0046)
cmake_policy(SET CMP0046 NEW)
endif()
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()

# ---[ Caffe project
project(Caffe C CXX)

# ---[ Caffe version
set(CAFFE_TARGET_VERSION "1.1.5" CACHE STRING "Caffe logical version")
set(CAFFE_TARGET_SOVERSION "1.1.5" CACHE STRING "Caffe soname version")
set(CAFFE_TARGET_VERSION "1.1.6" CACHE STRING "Caffe logical version")
set(CAFFE_TARGET_SOVERSION "1.1.6" CACHE STRING "Caffe soname version")
add_definitions(-DCAFFE_VERSION=${CAFFE_TARGET_VERSION})

# ---[ Using cmake scripts and modules
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)

include(ExternalProject)
if(MSVC)
include(GNUInstallDirs)
endif()

include(cmake/Utils.cmake)
include(cmake/Targets.cmake)
Expand Down Expand Up @@ -62,8 +77,15 @@ endif()
#end code coverage

# ---[ Flags
if(UNIX OR APPLE)

if(MSVC)
set(USERCONFIG_PLATFORM "x64")
if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP -D_USE_MATH_DEFINES /DNO_STRICT /wd4800 /wd4996 /wd4068 /wd4305 /wd4244 /wd4551 /wd4267 /wd4661 /wd4146")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP -D_USE_MATH_DEFINES /DNO_STRICT -Qdiag-disable:15552 -Qdiag-disable:3180")
endif()
elseif(UNIX OR APPLE)
# Linker flags.
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
# GCC specific flags. ICC is compatible with them.
Expand Down Expand Up @@ -130,12 +152,16 @@ configure_file(cmake/Templates/caffe_config.h.in "${PROJECT_BINARY_DIR}/caffe_co
# ---[ Includes
set(Caffe_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)
include_directories(${Caffe_INCLUDE_DIR} ${PROJECT_BINARY_DIR})
include_directories(BEFORE src/gtest/include src/gmock/include) # This is needed for gtest.

if(NOT MSVC)
include_directories(BEFORE src/gtest/include src/gmock/include) # This is needed for gtest.
endif()
# ---[ Subdirectories
#add_subdirectory(src/gtest)
set(BUILD_SHARED_LIBS off)
if(NOT MSVC)
add_subdirectory(src/gmock)
endif()
set(BUILD_SHARED_LIBS on)
add_subdirectory(src/caffe)
add_subdirectory(tools)
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ LIB_BUILD_DIR := $(BUILD_DIR)/lib
STATIC_NAME := $(LIB_BUILD_DIR)/lib$(LIBRARY_NAME).a
DYNAMIC_VERSION_MAJOR := 1
DYNAMIC_VERSION_MINOR := 1
DYNAMIC_VERSION_REVISION := 5
DYNAMIC_VERSION_REVISION := 6
DYNAMIC_NAME_SHORT := lib$(LIBRARY_NAME).so
#DYNAMIC_SONAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR)
DYNAMIC_VERSIONED_NAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR).$(DYNAMIC_VERSION_MINOR).$(DYNAMIC_VERSION_REVISION)
Expand Down Expand Up @@ -517,6 +517,11 @@ ifeq ($(DISABLE_SPARSE), 1)
COMMON_FLAGS += -DDISABLE_SPARSE
endif

# Disable FC + ReLU fusion
ifeq ($(DISABLE_FC_RELU_FUSION), 1)
COMMON_FLAGS += -DDISABLE_FC_RELU_FUSION
endif

# Performance monitoring
ifeq ($(PERFORMANCE_MONITORING), 1)
CXXFLAGS += -DPERFORMANCE_MONITORING
Expand Down
3 changes: 3 additions & 0 deletions Makefile.config.example
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ DISABLE_CONV_SUM_FUSION := 0
# Use sparse to boost inference.
DISABLE_SPARSE := 0

# Use fc/relu fusion to boost inference.
DISABLE_FC_RELU_FUSION := 0

# Intel(R) Math Kernel Library for Deep Neural Networks (Intel(R) MKL-DNN)
# Uncomment to disable MKLDNN download by customized setting
# DISABLE_MKLDNN_DOWNLOAD := 1
Expand Down
6 changes: 3 additions & 3 deletions Makefile.mkldnn
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ mkldnn_clean:
mkldnnroot_set:
$(eval CXXFLAGS += -DMKLDNN_SUPPORTED) \
$(eval INCLUDE_DIRS += $(MKLDNNROOT)/include)
$(eval MKLDNN_LDFLAGS += -lmkldnn -L$(MKLDNNROOT)/lib) \
$(eval MKLDNN_LDFLAGS += -Wl,-rpath,$(MKLDNNROOT)/lib) \
$(eval MKLDNN_LDFLAGS += -lmkldnn -L$(MKLDNNROOT)/lib64) \
$(eval MKLDNN_LDFLAGS += -Wl,-rpath,$(MKLDNNROOT)/lib64) \


mkldnnroot_notset: mkldnn_build
$(eval CXXFLAGS += -DMKLDNN_SUPPORTED) \
$(eval INCLUDE_DIRS += $(MKLDNN_INSTALLDIR)/include) \
$(eval MKLDNN_LDFLAGS += -lmkldnn) \
$(eval MKLDNN_LDFLAGS += -L$(MKLDNN_INSTALLDIR)/lib -Wl,-rpath,${MKLDNN_INSTALLDIR}/lib)
$(eval MKLDNN_LDFLAGS += -L$(MKLDNN_INSTALLDIR)/lib64 -Wl,-rpath,${MKLDNN_INSTALLDIR}/lib64)



Expand Down
77 changes: 32 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,39 @@
# Caffe
[![Build Status](https://travis-ci.org/BVLC/caffe.svg?branch=master)](https://travis-ci.org/BVLC/caffe)
[![License](https://img.shields.io/badge/license-BSD-blue.svg)](LICENSE)

Caffe is a deep learning framework made with expression, speed, and modularity in mind.
It is developed by the Berkeley Vision and Learning Center ([BVLC](http://bvlc.eecs.berkeley.edu)) and community contributors.

Check out the [project site](http://caffe.berkeleyvision.org) for all the details like
- [DIY Deep Learning for Vision with Caffe](https://docs.google.com/presentation/d/1UeKXVgRvvxg9OUdh_UiC5G71UMscNPlvArsWER41PsU/edit#slide=id.p)
- [Tutorial Documentation](http://caffe.berkeleyvision.org/tutorial/)
- [BVLC reference models](http://caffe.berkeleyvision.org/model_zoo.html) and the [community model zoo](https://github.com/BVLC/caffe/wiki/Model-Zoo)
- [Installation instructions](https://github.com/intel/caffe/wiki/Installation)

and step-by-step examples.

[![Join the chat at https://gitter.im/BVLC/caffe](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/BVLC/caffe?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Please join the [caffe-users group](https://groups.google.com/forum/#!forum/caffe-users) or [gitter chat](https://gitter.im/BVLC/caffe) to ask questions and talk about methods and models.
Framework development discussions and thorough bug reports are collected on [Issues](https://github.com/BVLC/caffe/issues).

Happy brewing!


# SSD: Single Shot MultiBox Detector
This repository contains merged code issued as pull request to BVLC caffe written by:
[Wei Liu](http://www.cs.unc.edu/~wliu/), [Dragomir Anguelov](https://www.linkedin.com/in/dragomiranguelov), [Dumitru Erhan](http://research.google.com/pubs/DumitruErhan.html), [Christian Szegedy](http://research.google.com/pubs/ChristianSzegedy.html), [Scott Reed](http://www-personal.umich.edu/~reedscot/), [Cheng-Yang Fu](http://www.cs.unc.edu/~cyfu/), [Alexander C. Berg](http://acberg.com).

Original branch can be found at https://github.com/weiliu89/caffe/tree/ssd.

Read our [wiki page](https://github.com/intel/caffe/wiki/SSD:-Single-Shot-MultiBox-Detector) for more details.

# Intel® Distribution of Caffe*
This fork is dedicated to improving Caffe performance when running on CPU, in particular Intel® Xeon processors.

## Building
Build procedure is the same as on bvlc-caffe-master branch, see section "Caffe". Both Make and CMake can be used.
Build procedure is the same as on bvlc-caffe-master branch. Both Make and CMake can be used.
When OpenMP is available will be used automatically.

## Running
Expand All @@ -17,23 +48,9 @@ If some system tool like numactl is used to control CPU affinity, by default caf
to use more than one thread per core. When less than required cores are specified, caffe will
limit execution of OpenMP threads to specified cores only.

To collect performance on full INT8 model of ResNet-50 v1.0, please update the variables NUM_CORE, the batch size range s_BS and e_BS, and INSTANCES according to your test requirements, then run:

. run.sh

To verify the accuracy, please run

. run_accuracy.sh

## Best performance solution
Please read [our Wiki](https://github.com/intel/caffe/wiki/Recommendations-to-achieve-best-performance) for our recommendations and configuration to achieve best performance on Intel CPUs.

Results:

Performance and convergence test result: https://github.com/intel/caffe/wiki/INTEL%C2%AE-OPTIMIZED-CAFFE-PERFORMANCE-AND-CONVERGENCE.

Scaling test result on AWS: https://github.com/intel/caffe/wiki/Intel%C2%AE-Optimization-for-Caffe-AWS-EC2-C5-(SKX)-Multi-node-Scaling.

## Multinode Training
Intel® Distribution of Caffe* multi-node allows you to execute deep neural network training on multiple machines.

Expand All @@ -56,34 +73,4 @@ Please cite Caffe in your publications if it helps your research:
*Other names and brands may be claimed as the property of others


# SSD: Single Shot MultiBox Detector
This repository contains merged code issued as pull request to BVLC caffe written by:
[Wei Liu](http://www.cs.unc.edu/~wliu/), [Dragomir Anguelov](https://www.linkedin.com/in/dragomiranguelov), [Dumitru Erhan](http://research.google.com/pubs/DumitruErhan.html), [Christian Szegedy](http://research.google.com/pubs/ChristianSzegedy.html), [Scott Reed](http://www-personal.umich.edu/~reedscot/), [Cheng-Yang Fu](http://www.cs.unc.edu/~cyfu/), [Alexander C. Berg](http://acberg.com).

Original branch can be found at https://github.com/weiliu89/caffe/tree/ssd.

Read our [wiki page](https://github.com/intel/caffe/wiki/SSD:-Single-Shot-MultiBox-Detector) for more details.

# Caffe
[![Build Status](https://travis-ci.org/BVLC/caffe.svg?branch=master)](https://travis-ci.org/BVLC/caffe)
[![License](https://img.shields.io/badge/license-BSD-blue.svg)](LICENSE)
Caffe is a deep learning framework made with expression, speed, and modularity in mind.
It is developed by the Berkeley Vision and Learning Center ([BVLC](http://bvlc.eecs.berkeley.edu)) and community contributors.


Check out the [project site](http://caffe.berkeleyvision.org) for all the details like
- [DIY Deep Learning for Vision with Caffe](https://docs.google.com/presentation/d/1UeKXVgRvvxg9OUdh_UiC5G71UMscNPlvArsWER41PsU/edit#slide=id.p)
- [Tutorial Documentation](http://caffe.berkeleyvision.org/tutorial/)
- [BVLC reference models](http://caffe.berkeleyvision.org/model_zoo.html) and the [community model zoo](https://github.com/BVLC/caffe/wiki/Model-Zoo)
- [Installation instructions](https://github.com/intel/caffe/wiki/Installation)

and step-by-step examples.

[![Join the chat at https://gitter.im/BVLC/caffe](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/BVLC/caffe?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Please join the [caffe-users group](https://groups.google.com/forum/#!forum/caffe-users) or [gitter chat](https://gitter.im/BVLC/caffe) to ask questions and talk about methods and models.
Framework development discussions and thorough bug reports are collected on [Issues](https://github.com/BVLC/caffe/issues).

Happy brewing!


2 changes: 1 addition & 1 deletion cmake/ConfigGen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function(caffe_generate_export_configs)
configure_file("cmake/Templates/CaffeConfig.cmake.in" "${PROJECT_BINARY_DIR}/CaffeConfig.cmake" @ONLY)

# Add targets to the build-tree export set
export(TARGETS caffe proto FILE "${PROJECT_BINARY_DIR}/CaffeTargets.cmake")
export(TARGETS caffe caffeproto FILE "${PROJECT_BINARY_DIR}/CaffeTargets.cmake")
export(PACKAGE Caffe)

# ---[ Configure install-tree CaffeConfig.cmake file ]---
Expand Down
Loading

0 comments on commit 1141d7f

Please sign in to comment.