Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature/evaluator
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhwinter committed Nov 14, 2017
2 parents 7c79243 + 85b839f commit fc117ec
Show file tree
Hide file tree
Showing 192 changed files with 8,084 additions and 1,215 deletions.
2 changes: 1 addition & 1 deletion benchmark/paddle/image/vgg.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

settings(
batch_size=batch_size,
learning_rate=0.01 / batch_size,
learning_rate=0.001 / batch_size,
learning_method=MomentumOptimizer(0.9),
regularization=L2Regularization(0.0005 * batch_size))

Expand Down
47 changes: 2 additions & 45 deletions cmake/cblas.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# Find the CBlas and lapack libraries
#
# It will search MKL, atlas, OpenBlas, reference-cblas in order.
# It will search MKLML, atlas, OpenBlas, reference-cblas in order.
#
# If any cblas implementation found, the following variable will be set.
# CBLAS_PROVIDER # one of MKL, ATLAS, OPENBLAS, REFERENCE
# CBLAS_PROVIDER # one of MKLML, ATLAS, OPENBLAS, REFERENCE
# CBLAS_INC_DIR # the include directory for cblas.
# CBLAS_LIBS # a list of libraries should be linked by paddle.
# # Each library should be full path to object file.
#
# User should set one of MKL_ROOT, ATLAS_ROOT, OPENBLAS_ROOT, REFERENCE_CBLAS_ROOT
# during cmake. If none of them set, it will try to find cblas implementation in
# system paths.
#

set(CBLAS_FOUND OFF)

Expand All @@ -30,44 +25,6 @@ if(WITH_MKLML AND MKLML_INC_DIR AND MKLML_LIB)
return()
endif()

## Then find MKL.
set(INTEL_MKL_ROOT "/opt/intel/mkl" CACHE PATH "Folder contains intel mkl libs")
set(MKL_ROOT $ENV{MKL_ROOT} CACHE PATH "Folder contains env MKL")

set(MKL_INCLUDE_SEARCH_PATHS
${MKL_ROOT}/include
${INTEL_MKL_ROOT}/include)
set(MKL_LIB_SEARCH_PATHS
${MKL_ROOT}/lib
${MKL_ROOT}/lib/intel64
${INTEL_MKL_ROOT}/lib
${INTEL_MKL_ROOT}/lib/intel64)

find_path(MKL_INC_DIR mkl.h PATHS
${MKL_INCLUDE_SEARCH_PATHS})
find_path(MKL_LAPACK_INC_DIR mkl_lapacke.h PATHS
${MKL_INCLUDE_SEARCH_PATHS})
find_library(MKL_CORE_LIB NAMES mkl_core PATHS
${MKL_LIB_SEARCH_PATHS})
find_library(MKL_SEQUENTIAL_LIB NAMES mkl_sequential PATHS
${MKL_LIB_SEARCH_PATHS})
find_library(MKL_INTEL_LP64 NAMES mkl_intel_lp64 PATHS
${MKL_LIB_SEARCH_PATHS})

if(MKL_LAPACK_INC_DIR AND MKL_INC_DIR AND MKL_CORE_LIB AND MKL_SEQUENTIAL_LIB AND MKL_INTEL_LP64)
set(CBLAS_FOUND ON)
set(CBLAS_PROVIDER MKL)
set(CBLAS_INC_DIR ${MKL_INC_DIR} ${MKL_LAPACK_INC_DIR})
set(CBLAS_LIBRARIES ${MKL_INTEL_LP64} ${MKL_SEQUENTIAL_LIB} ${MKL_CORE_LIB})

add_definitions(-DPADDLE_USE_MKL)
add_definitions(-DLAPACK_FOUND)

message(STATUS "Found MKL (include: ${MKL_INC_DIR}, library: ${CBLAS_LIBRARIES})")
message(STATUS "Found lapack in MKL (include: ${MKL_LAPACK_INC_DIR})")
return()
endif()

## Then find atlas.
set(ATLAS_ROOT $ENV{ATLAS_ROOT} CACHE PATH "Folder contains Atlas")
set(ATLAS_INCLUDE_SEARCH_PATHS
Expand Down
6 changes: 5 additions & 1 deletion cmake/external/mkldnn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,20 @@ IF(${CBLAS_PROVIDER} STREQUAL "MKLML")
MESSAGE(STATUS "Build MKLDNN with ${MKLDNN_MKLROOT}")
ENDIF()

SET(MKLDNN_CFLAG "${CMAKE_C_FLAGS} -Wno-error=strict-overflow")
SET(MKLDNN_CXXFLAG "${CMAKE_CXX_FLAGS} -Wno-error=strict-overflow")
ExternalProject_Add(
${MKLDNN_PROJECT}
${EXTERNAL_PROJECT_LOG_ARGS}
DEPENDS ${MKLDNN_DEPENDS}
GIT_REPOSITORY "https://github.com/01org/mkl-dnn.git"
GIT_TAG "v0.10"
GIT_TAG "v0.11"
PREFIX ${MKLDNN_SOURCES_DIR}
UPDATE_COMMAND ""
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${MKLDNN_INSTALL_DIR}
CMAKE_ARGS -DMKLROOT=${MKLDNN_MKLROOT}
CMAKE_ARGS -DCMAKE_C_FLAGS=${MKLDNN_CFLAG}
CMAKE_ARGS -DCMAKE_CXX_FLAGS=${MKLDNN_CXXFLAG}
CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${MKLDNN_INSTALL_DIR}
-DMKLROOT:PATH=${MKLDNN_MKLROOT}
)
Expand Down
4 changes: 2 additions & 2 deletions cmake/external/mklml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ ENDIF()
INCLUDE(ExternalProject)

SET(MKLML_PROJECT "extern_mklml")
SET(MKLML_VER "mklml_lnx_2018.0.20170720")
SET(MKLML_URL "https://github.com/01org/mkl-dnn/releases/download/v0.10/${MKLML_VER}.tgz")
SET(MKLML_VER "mklml_lnx_2018.0.1.20171007")
SET(MKLML_URL "https://github.com/01org/mkl-dnn/releases/download/v0.11/${MKLML_VER}.tgz")
SET(MKLML_SOURCE_DIR "${THIRD_PARTY_PATH}/mklml")
SET(MKLML_DOWNLOAD_DIR "${MKLML_SOURCE_DIR}/src/${MKLML_PROJECT}")
SET(MKLML_DST_DIR "mklml")
Expand Down
4 changes: 2 additions & 2 deletions cmake/external/openblas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ IF(NOT ${CBLAS_FOUND})
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
)

SET(CBLAS_PROVIDER openblas)
IF(WITH_C_API)
INSTALL(DIRECTORY ${CBLAS_INC_DIR} DESTINATION third_party/openblas)
# Because libopenblas.a is a symbolic link of another library, thus need to
Expand Down Expand Up @@ -115,7 +115,7 @@ INCLUDE_DIRECTORIES(${CBLAS_INC_DIR})
# linear algebra libraries for cc_library(xxx SRCS xxx.c DEPS cblas)
SET(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/cblas_dummy.c)
FILE(WRITE ${dummyfile} "const char * dummy = \"${dummyfile}\";")
IF(${CBLAS_PROVIDER} MATCHES MKL)
IF("${CBLAS_PROVIDER}" STREQUAL "MKLML")
ADD_LIBRARY(cblas SHARED ${dummyfile})
ELSE()
ADD_LIBRARY(cblas STATIC ${dummyfile})
Expand Down
2 changes: 1 addition & 1 deletion cmake/generic.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
if(NOT APPLE AND NOT ANDROID)
find_package(Threads REQUIRED)
link_libraries(${CMAKE_THREAD_LIBS_INIT})
set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -ldl -lrt")
set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -pthread -ldl -lrt")
endif(NOT APPLE AND NOT ANDROID)

function(merge_static_libs TARGET_NAME)
Expand Down
5 changes: 5 additions & 0 deletions doc/api/v2/config/layer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ maxout
.. autoclass:: paddle.v2.layer.maxout
:noindex:

roi_pool
--------
.. autoclass:: paddle.v2.layer.roi_pool
:noindex:

Norm Layer
==========

Expand Down
113 changes: 5 additions & 108 deletions doc/api/v2/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,112 +2,9 @@
Data Reader Interface and DataSets
==================================

.. toctree::
:maxdepth: 1

DataTypes
=========

.. automodule:: paddle.v2.data_type
:members:
:noindex:

DataFeeder
==========

.. automodule:: paddle.v2.data_feeder
:members:
:noindex:

Reader
======

.. automodule:: paddle.v2.reader
:members:
:noindex:

.. automodule:: paddle.v2.reader.creator
:members:
:noindex:

minibatch
=========

.. automodule:: paddle.v2.minibatch
:members:
:noindex:

Dataset
=======

.. automodule:: paddle.v2.dataset
:members:
:noindex:

mnist
+++++

.. automodule:: paddle.v2.dataset.mnist
:members:
:noindex:

cifar
+++++

.. automodule:: paddle.v2.dataset.cifar
:members:
:noindex:

conll05
+++++++

.. automodule:: paddle.v2.dataset.conll05
:members: get_dict,get_embedding,test
:noindex:

imdb
++++

.. automodule:: paddle.v2.dataset.imdb
:members:
:noindex:

imikolov
++++++++

.. automodule:: paddle.v2.dataset.imikolov
:members:
:noindex:

movielens
+++++++++

.. automodule:: paddle.v2.dataset.movielens
:members:
:noindex:

.. autoclass:: paddle.v2.dataset.movielens.MovieInfo
:noindex:

.. autoclass:: paddle.v2.dataset.movielens.UserInfo
:noindex:

sentiment
+++++++++

.. automodule:: paddle.v2.dataset.sentiment
:members:
:noindex:

uci_housing
+++++++++++

.. automodule:: paddle.v2.dataset.uci_housing
:members:
:noindex:

wmt14
+++++

.. automodule:: paddle.v2.dataset.wmt14
:members:
:noindex:

data/data_reader.rst
data/image.rst
data/dataset.rst
36 changes: 36 additions & 0 deletions doc/api/v2/data/data_reader.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
=====================
Data Reader Interface
=====================


DataTypes
=========

.. automodule:: paddle.v2.data_type
:members:
:noindex:

DataFeeder
==========

.. automodule:: paddle.v2.data_feeder
:members:
:noindex:

Reader
======

.. automodule:: paddle.v2.reader
:members:
:noindex:

.. automodule:: paddle.v2.reader.creator
:members:
:noindex:

minibatch
=========

.. automodule:: paddle.v2.minibatch
:members:
:noindex:
75 changes: 75 additions & 0 deletions doc/api/v2/data/dataset.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Dataset
=======

.. automodule:: paddle.v2.dataset
:members:
:noindex:

mnist
+++++

.. automodule:: paddle.v2.dataset.mnist
:members:
:noindex:

cifar
+++++

.. automodule:: paddle.v2.dataset.cifar
:members:
:noindex:

conll05
+++++++

.. automodule:: paddle.v2.dataset.conll05
:members: get_dict,get_embedding,test
:noindex:

imdb
++++

.. automodule:: paddle.v2.dataset.imdb
:members:
:noindex:

imikolov
++++++++

.. automodule:: paddle.v2.dataset.imikolov
:members:
:noindex:

movielens
+++++++++

.. automodule:: paddle.v2.dataset.movielens
:members:
:noindex:

.. autoclass:: paddle.v2.dataset.movielens.MovieInfo
:noindex:

.. autoclass:: paddle.v2.dataset.movielens.UserInfo
:noindex:

sentiment
+++++++++

.. automodule:: paddle.v2.dataset.sentiment
:members:
:noindex:

uci_housing
+++++++++++

.. automodule:: paddle.v2.dataset.uci_housing
:members:
:noindex:

wmt14
+++++

.. automodule:: paddle.v2.dataset.wmt14
:members:
:noindex:
5 changes: 5 additions & 0 deletions doc/api/v2/data/image.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Image Interface
===============

.. automodule:: paddle.v2.image
:members:
Loading

0 comments on commit fc117ec

Please sign in to comment.