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

Commit 1141d7f

Browse files
committed
Caffe 1.1.6 prerelease, cont.
1 parent 8878d23 commit 1141d7f

File tree

82 files changed

+1251
-8250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1251
-8250
lines changed

CMakeLists.txt

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,38 @@
1-
cmake_minimum_required(VERSION 2.8.7)
1+
if(MSVC)
2+
# CMake 3.4 introduced a WINDOWS_EXPORT_ALL_SYMBOLS target property that makes it possible to
3+
# build shared libraries without using the usual declspec() decoration.
4+
# See: https://blog.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/
5+
# and https://cmake.org/cmake/help/v3.5/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html
6+
# for details.
7+
cmake_minimum_required(VERSION 3.4)
8+
else()
9+
cmake_minimum_required(VERSION 2.8.7)
10+
endif()
211
if(POLICY CMP0046)
312
cmake_policy(SET CMP0046 NEW)
413
endif()
514
if(POLICY CMP0054)
615
cmake_policy(SET CMP0054 NEW)
716
endif()
17+
if(POLICY CMP0074)
18+
cmake_policy(SET CMP0074 NEW)
19+
endif()
820

921
# ---[ Caffe project
1022
project(Caffe C CXX)
1123

1224
# ---[ Caffe version
13-
set(CAFFE_TARGET_VERSION "1.1.5" CACHE STRING "Caffe logical version")
14-
set(CAFFE_TARGET_SOVERSION "1.1.5" CACHE STRING "Caffe soname version")
25+
set(CAFFE_TARGET_VERSION "1.1.6" CACHE STRING "Caffe logical version")
26+
set(CAFFE_TARGET_SOVERSION "1.1.6" CACHE STRING "Caffe soname version")
1527
add_definitions(-DCAFFE_VERSION=${CAFFE_TARGET_VERSION})
1628

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

2032
include(ExternalProject)
33+
if(MSVC)
34+
include(GNUInstallDirs)
35+
endif()
2136

2237
include(cmake/Utils.cmake)
2338
include(cmake/Targets.cmake)
@@ -62,8 +77,15 @@ endif()
6277
#end code coverage
6378

6479
# ---[ Flags
65-
if(UNIX OR APPLE)
66-
80+
if(MSVC)
81+
set(USERCONFIG_PLATFORM "x64")
82+
if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
83+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP -D_USE_MATH_DEFINES /DNO_STRICT /wd4800 /wd4996 /wd4068 /wd4305 /wd4244 /wd4551 /wd4267 /wd4661 /wd4146")
84+
endif()
85+
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
86+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP -D_USE_MATH_DEFINES /DNO_STRICT -Qdiag-disable:15552 -Qdiag-disable:3180")
87+
endif()
88+
elseif(UNIX OR APPLE)
6789
# Linker flags.
6890
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
6991
# GCC specific flags. ICC is compatible with them.
@@ -130,12 +152,16 @@ configure_file(cmake/Templates/caffe_config.h.in "${PROJECT_BINARY_DIR}/caffe_co
130152
# ---[ Includes
131153
set(Caffe_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)
132154
include_directories(${Caffe_INCLUDE_DIR} ${PROJECT_BINARY_DIR})
133-
include_directories(BEFORE src/gtest/include src/gmock/include) # This is needed for gtest.
134155

156+
if(NOT MSVC)
157+
include_directories(BEFORE src/gtest/include src/gmock/include) # This is needed for gtest.
158+
endif()
135159
# ---[ Subdirectories
136160
#add_subdirectory(src/gtest)
137161
set(BUILD_SHARED_LIBS off)
162+
if(NOT MSVC)
138163
add_subdirectory(src/gmock)
164+
endif()
139165
set(BUILD_SHARED_LIBS on)
140166
add_subdirectory(src/caffe)
141167
add_subdirectory(tools)

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ LIB_BUILD_DIR := $(BUILD_DIR)/lib
102102
STATIC_NAME := $(LIB_BUILD_DIR)/lib$(LIBRARY_NAME).a
103103
DYNAMIC_VERSION_MAJOR := 1
104104
DYNAMIC_VERSION_MINOR := 1
105-
DYNAMIC_VERSION_REVISION := 5
105+
DYNAMIC_VERSION_REVISION := 6
106106
DYNAMIC_NAME_SHORT := lib$(LIBRARY_NAME).so
107107
#DYNAMIC_SONAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR)
108108
DYNAMIC_VERSIONED_NAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR).$(DYNAMIC_VERSION_MINOR).$(DYNAMIC_VERSION_REVISION)
@@ -517,6 +517,11 @@ ifeq ($(DISABLE_SPARSE), 1)
517517
COMMON_FLAGS += -DDISABLE_SPARSE
518518
endif
519519

520+
# Disable FC + ReLU fusion
521+
ifeq ($(DISABLE_FC_RELU_FUSION), 1)
522+
COMMON_FLAGS += -DDISABLE_FC_RELU_FUSION
523+
endif
524+
520525
# Performance monitoring
521526
ifeq ($(PERFORMANCE_MONITORING), 1)
522527
CXXFLAGS += -DPERFORMANCE_MONITORING

Makefile.config.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ DISABLE_CONV_SUM_FUSION := 0
9696
# Use sparse to boost inference.
9797
DISABLE_SPARSE := 0
9898

99+
# Use fc/relu fusion to boost inference.
100+
DISABLE_FC_RELU_FUSION := 0
101+
99102
# Intel(R) Math Kernel Library for Deep Neural Networks (Intel(R) MKL-DNN)
100103
# Uncomment to disable MKLDNN download by customized setting
101104
# DISABLE_MKLDNN_DOWNLOAD := 1

Makefile.mkldnn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ mkldnn_clean:
6363
mkldnnroot_set:
6464
$(eval CXXFLAGS += -DMKLDNN_SUPPORTED) \
6565
$(eval INCLUDE_DIRS += $(MKLDNNROOT)/include)
66-
$(eval MKLDNN_LDFLAGS += -lmkldnn -L$(MKLDNNROOT)/lib) \
67-
$(eval MKLDNN_LDFLAGS += -Wl,-rpath,$(MKLDNNROOT)/lib) \
66+
$(eval MKLDNN_LDFLAGS += -lmkldnn -L$(MKLDNNROOT)/lib64) \
67+
$(eval MKLDNN_LDFLAGS += -Wl,-rpath,$(MKLDNNROOT)/lib64) \
6868

6969

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

7676

7777

README.md

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
1+
# Caffe
2+
[![Build Status](https://travis-ci.org/BVLC/caffe.svg?branch=master)](https://travis-ci.org/BVLC/caffe)
3+
[![License](https://img.shields.io/badge/license-BSD-blue.svg)](LICENSE)
4+
5+
Caffe is a deep learning framework made with expression, speed, and modularity in mind.
6+
It is developed by the Berkeley Vision and Learning Center ([BVLC](http://bvlc.eecs.berkeley.edu)) and community contributors.
7+
8+
Check out the [project site](http://caffe.berkeleyvision.org) for all the details like
9+
- [DIY Deep Learning for Vision with Caffe](https://docs.google.com/presentation/d/1UeKXVgRvvxg9OUdh_UiC5G71UMscNPlvArsWER41PsU/edit#slide=id.p)
10+
- [Tutorial Documentation](http://caffe.berkeleyvision.org/tutorial/)
11+
- [BVLC reference models](http://caffe.berkeleyvision.org/model_zoo.html) and the [community model zoo](https://github.com/BVLC/caffe/wiki/Model-Zoo)
12+
- [Installation instructions](https://github.com/intel/caffe/wiki/Installation)
13+
14+
and step-by-step examples.
15+
16+
[![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)
17+
18+
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.
19+
Framework development discussions and thorough bug reports are collected on [Issues](https://github.com/BVLC/caffe/issues).
20+
21+
Happy brewing!
22+
23+
24+
# SSD: Single Shot MultiBox Detector
25+
This repository contains merged code issued as pull request to BVLC caffe written by:
26+
[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).
27+
28+
Original branch can be found at https://github.com/weiliu89/caffe/tree/ssd.
29+
30+
Read our [wiki page](https://github.com/intel/caffe/wiki/SSD:-Single-Shot-MultiBox-Detector) for more details.
31+
132
# Intel® Distribution of Caffe*
233
This fork is dedicated to improving Caffe performance when running on CPU, in particular Intel® Xeon processors.
334

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

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

20-
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:
21-
22-
. run.sh
23-
24-
To verify the accuracy, please run
25-
26-
. run_accuracy.sh
27-
2851
## Best performance solution
2952
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.
3053

31-
Results:
32-
33-
Performance and convergence test result: https://github.com/intel/caffe/wiki/INTEL%C2%AE-OPTIMIZED-CAFFE-PERFORMANCE-AND-CONVERGENCE.
34-
35-
Scaling test result on AWS: https://github.com/intel/caffe/wiki/Intel%C2%AE-Optimization-for-Caffe-AWS-EC2-C5-(SKX)-Multi-node-Scaling.
36-
3754
## Multinode Training
3855
Intel® Distribution of Caffe* multi-node allows you to execute deep neural network training on multiple machines.
3956

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

5875

59-
# SSD: Single Shot MultiBox Detector
60-
This repository contains merged code issued as pull request to BVLC caffe written by:
61-
[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).
62-
63-
Original branch can be found at https://github.com/weiliu89/caffe/tree/ssd.
64-
65-
Read our [wiki page](https://github.com/intel/caffe/wiki/SSD:-Single-Shot-MultiBox-Detector) for more details.
66-
67-
# Caffe
68-
[![Build Status](https://travis-ci.org/BVLC/caffe.svg?branch=master)](https://travis-ci.org/BVLC/caffe)
69-
[![License](https://img.shields.io/badge/license-BSD-blue.svg)](LICENSE)
70-
Caffe is a deep learning framework made with expression, speed, and modularity in mind.
71-
It is developed by the Berkeley Vision and Learning Center ([BVLC](http://bvlc.eecs.berkeley.edu)) and community contributors.
72-
73-
74-
Check out the [project site](http://caffe.berkeleyvision.org) for all the details like
75-
- [DIY Deep Learning for Vision with Caffe](https://docs.google.com/presentation/d/1UeKXVgRvvxg9OUdh_UiC5G71UMscNPlvArsWER41PsU/edit#slide=id.p)
76-
- [Tutorial Documentation](http://caffe.berkeleyvision.org/tutorial/)
77-
- [BVLC reference models](http://caffe.berkeleyvision.org/model_zoo.html) and the [community model zoo](https://github.com/BVLC/caffe/wiki/Model-Zoo)
78-
- [Installation instructions](https://github.com/intel/caffe/wiki/Installation)
79-
80-
and step-by-step examples.
81-
82-
[![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)
83-
84-
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.
85-
Framework development discussions and thorough bug reports are collected on [Issues](https://github.com/BVLC/caffe/issues).
86-
87-
Happy brewing!
88-
8976

cmake/ConfigGen.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function(caffe_generate_export_configs)
120120
configure_file("cmake/Templates/CaffeConfig.cmake.in" "${PROJECT_BINARY_DIR}/CaffeConfig.cmake" @ONLY)
121121

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

126126
# ---[ Configure install-tree CaffeConfig.cmake file ]---

0 commit comments

Comments
 (0)