Skip to content

Commit eebb3fc

Browse files
committed
First open source release of LBANN: Livermore Big Artificial Neural
Network Toolkit. Version 0.9. Migrated from internal CZ Stash git repo. Initial developers are: LLNL Team Brian Van Essen <[email protected]> Hyojin Kim <[email protected]> Sam Jacobs <[email protected]> Adam Moody <[email protected]> LLNL Summer Interns Nikoli Dryden <[email protected]>, <[email protected]> Tim Moon <[email protected]>, <[email protected]>
0 parents  commit eebb3fc

File tree

154 files changed

+25896
-0
lines changed

Some content is hidden

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

154 files changed

+25896
-0
lines changed

.astylerc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# astyle --dry-run --options=lbann.astylerc --recursive
2+
# --dry-run
3+
4+
# Bracket Style Options
5+
--style=kr
6+
7+
# Tab Option
8+
--indent=spaces=2
9+
10+
# How are pointer and reference characters aligned: type or name
11+
--align-pointer=name
12+
13+
# How are reference characters aligned: type or name (overrides align-pointer)
14+
--align-reference=type
15+
16+
# Do not allow unbracketed one line conditional statements
17+
--add-brackets

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Can ignore specific files
2+
.DS_Store
3+
4+
# Use wildcards as well
5+
*~
6+
*.o
7+
8+
# Can also ignore all directories and files in a directory.
9+
# tmp/**/*

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "external/Elemental"]
2+
path = external/Elemental
3+
url = git://github.com/elemental/Elemental.git

CMakeLists.txt

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
project (LBANN)
2+
cmake_minimum_required (VERSION 2.8.8)
3+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
4+
5+
#
6+
# Options
7+
#
8+
#option(CMAKE_INSTALL_RPATH_USE_LINK_PATH "Use Rpath for dependencies." TRUE)
9+
#option(HAVOQGT_BUILD_TEST "Build HAVOQGT tests." TRUE)
10+
11+
################################################################################
12+
# Always full RPATH
13+
################################################################################
14+
# use, i.e. don't skip the full RPATH for the build tree
15+
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
16+
17+
# when building, don't use the install RPATH already
18+
# (but later on when installing)
19+
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
20+
21+
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
22+
23+
# add the automatically determined parts of the RPATH
24+
# which point to directories outside the build tree to the install RPATH
25+
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
26+
27+
# the RPATH to be used when installing, but only if it's not a system directory
28+
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
29+
IF("${isSystemDir}" STREQUAL "-1")
30+
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
31+
ENDIF("${isSystemDir}" STREQUAL "-1")
32+
################################################################################
33+
34+
# Get the git version so that we can embed it into the executable
35+
execute_process(COMMAND git describe --abbrev=7 --dirty --always --tags OUTPUT_VARIABLE GIT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
36+
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVERSION=\\\"${GIT_VERSION}\\\"" )
37+
38+
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
39+
40+
#
41+
# Main Include directory
42+
#
43+
include_directories("${PROJECT_SOURCE_DIR}/include")
44+
include_directories("${PROJECT_SOURCE_DIR}/include/lbann")
45+
include_directories("${PROJECT_SOURCE_DIR}")
46+
47+
include(CheckSymbolExists)
48+
49+
#
50+
# Link in CUDA,cuDNN
51+
#
52+
find_package(CUDA QUIET)
53+
if (CUDA_FOUND AND CMAKE_CUDNN_DIR)
54+
include(FindCUDA)
55+
include_directories("${CUDA_TOOLKIT_ROOT_DIR}/include")
56+
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib64")
57+
include_directories("${CMAKE_CUDNN_DIR}/include")
58+
link_directories("${CMAKE_CUDNN_DIR}/lib64")
59+
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__LIB_CUDNN" )
60+
#CUDA_LIBS = -lcudart -lcublas
61+
set(CUDNN_LIBRARIES -lcudnn)
62+
endif()
63+
64+
macro(link_cudnn target)
65+
target_link_libraries(${target} ${CUDA_LIBRARIES} ${CUDNN_LIBRARIES})
66+
endmacro()
67+
68+
#
69+
# Build nested source lists
70+
#
71+
macro (add_sources)
72+
file (RELATIVE_PATH _relPath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
73+
foreach (_src ${ARGN})
74+
if (_relPath)
75+
list (APPEND SRCS "${_relPath}/${_src}")
76+
else()
77+
list (APPEND SRCS "${_src}")
78+
endif()
79+
endforeach()
80+
if (_relPath)
81+
# propagate SRCS to parent directory
82+
set (SRCS ${SRCS} PARENT_SCOPE)
83+
endif()
84+
endmacro()
85+
86+
# TBinf (Tensorboard interface)
87+
# This must come first so the right protobuf libraries are found.
88+
if(CMAKE_TBINF)
89+
include_directories(external/TBinf)
90+
add_sources(external/TBinf/TBinf.cpp)
91+
add_sources(external/TBinf/summary.pb.cc)
92+
add_sources(external/TBinf/event.pb.cc)
93+
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D__HAVE_TBINF" )
94+
if(CMAKE_PROTOBUF)
95+
# Need to get ahead of the system protobuf version for now.
96+
include_directories(BEFORE "${CMAKE_PROTOBUF}/include")
97+
link_directories("${CMAKE_PROTOBUF}/lib")
98+
endif(CMAKE_PROTOBUF)
99+
endif(CMAKE_TBINF)
100+
macro(include_link_tbinf target)
101+
if(CMAKE_TBINF)
102+
target_link_libraries(${target} protobuf)
103+
endif(CMAKE_TBINF)
104+
endmacro()
105+
106+
# Link in OpenCV
107+
include_directories("/usr/gapps/brain/installs/generic/include")
108+
link_directories("/usr/gapps/brain/installs/generic/lib")
109+
#CV_LIBS = -lopencv_core -lopencv_highgui
110+
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D__LIB_OPENCV" )
111+
112+
#
113+
# MPI is required
114+
#
115+
find_package( MPI REQUIRED )
116+
macro(include_link_mpi target)
117+
include_directories(${MPI_INCLUDE_PATH})
118+
target_link_libraries(${target} ${MPI_LIBRARIES})
119+
endmacro()
120+
121+
#
122+
# OpenCV is required
123+
#
124+
#set(OpenCV_STATIC ON)
125+
#set(OpenCV_CUDA OFF)
126+
127+
find_package( OpenCV REQUIRED HINTS ${OpenCV_DIR})
128+
#find_package( OpenCV REQUIRED HINTS ${CMAKE_OPENCV_DIR})
129+
if(OpenCV_FOUND)
130+
include_directories("${OpenCV_INCLUDE_DIRS}")
131+
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D__LIB_OPENCV" )
132+
message("-- Found OpenCV version: ${OpenCV_VERSION} ${OpenCV_DIR}")
133+
endif()
134+
135+
macro(link_opencv target)
136+
target_link_libraries(${target} ${OpenCV_LIBRARIES})
137+
endmacro()
138+
139+
if(NOT ${CMAKE_CXX_COMPILER} MATCHES "icpc")
140+
find_package( OpenBLAS HINTS ${OpenBLAS_DIR})
141+
if(OpenBLAS_FOUND)
142+
include_directories("${OpenBLAS_INCLUDE_DIRS}")
143+
message("-- Found OpenBLAS version: ${OpenBLAS_VERSION} ${OpenBLAS_DIR}")
144+
endif()
145+
endif()
146+
147+
macro(link_openblas target)
148+
target_link_libraries(${target} ${OpenBLAS_LIBRARIES})
149+
endmacro()
150+
151+
#
152+
# Doxygen
153+
#
154+
find_package(Doxygen)
155+
if(DOXYGEN_FOUND)
156+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in
157+
${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY)
158+
add_custom_target(doc
159+
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
160+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc
161+
COMMENT "Generating API documentation with Doxygen" VERBATIM
162+
)
163+
endif(DOXYGEN_FOUND)
164+
165+
#
166+
# Elemental is required
167+
#
168+
169+
if(CMAKE_ELEMENTAL_DIR)
170+
include_directories("${CMAKE_ELEMENTAL_DIR}/include/")
171+
link_directories("${CMAKE_ELEMENTAL_DIR}/lib/")
172+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__LIB_ELEMENTAL" )
173+
message("-- Manually including Elemental Libraries: ${CMAKE_ELEMENTAL_DIR}")
174+
else()
175+
find_package(Elemental REQUIRED HINTS ${Elemental_ROOT_DIR})
176+
if(Elemental_FOUND)
177+
set(CMAKE_CXX_FLAGS "${Elemental_COMPILE_FLAGS}")
178+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__LIB_ELEMENTAL" )
179+
include_directories(${Elemental_INCLUDE_DIRS})
180+
add_definitions(${Elemental_DEFINITIONS})
181+
message("-- Found Elemental Libraries: ${Elemental_LIBRARIES} ${Elemental_DIR}")
182+
else()
183+
# add_subdirectory(external/Elemental)
184+
message(FATAL_ERROR "Could not locate Elemental installation")
185+
endif()
186+
187+
macro(link_elemental target)
188+
target_link_libraries(${target} ${Elemental_LIBRARIES})
189+
if(Elemental_LINK_FLAGS)
190+
set_target_properties(${target} PROPERTIES LINK_FLAGS ${Elemental_LINK_FLAGS})
191+
endif()
192+
endmacro()
193+
endif()
194+
195+
include_directories(${MPI_CXX_INCLUDE_PATH})
196+
197+
198+
# Build LBANN
199+
200+
add_subdirectory (src)
201+
add_subdirectory (model_zoo)
202+
#enable_testing()
203+
#add_subdirectory (test)
204+
205+
add_library(src OBJECT ${SRCS})
206+
if(NOT CMAKE_ELEMENTAL_DIR)
207+
add_dependencies(src El)
208+
endif(NOT CMAKE_ELEMENTAL_DIR)
209+
210+
set( LIBRARY_TYPE SHARED )
211+
add_library(lbann ${LIBRARY_TYPE} $<TARGET_OBJECTS:src>)
212+
213+
# Link in found libraries
214+
link_opencv(lbann)
215+
include_link_tbinf(lbann)
216+
if(CMAKE_ELEMENTAL_DIR)
217+
target_link_libraries(lbann El)
218+
else()
219+
link_elemental(lbann)
220+
endif()
221+
222+
if(OpenBLAS_FOUND)
223+
link_openblas(lbann)
224+
endif()
225+
226+
if(CUDA_FOUND)
227+
link_cudnn(lbann)
228+
endif()
229+
230+
#link_directories(core)
231+
#
232+
# Configuration Summary
233+
#
234+
message("== Configuration Summary ==")
235+
message(" CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
236+
if(CMAKE_BUILD_TYPE MATCHES None)
237+
message(" - CXX FLAGS: ${CMAKE_CXX_FLAGS}")
238+
elseif(CMAKE_BUILD_TYPE MATCHES Release)
239+
message(" - CXX FLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
240+
elseif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
241+
message(" - CXX FLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
242+
elseif(CMAKE_BUILD_TYPE MATCHES Debug)
243+
message(" - CXX FLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
244+
endif()
245+
#message(" LBANN_BUILD_TEST: ${LBANN_BUILD_TEST}")
246+
message(" MPI_FOUND: ${MPI_FOUND}")
247+
message(" DOXYGEN_FOUND: ${DOXYGEN_FOUND}")
248+
message(" Elemental_FOUND: ${Elemental_FOUND}")
249+
message(" OpenCV_FOUND: ${OpenCV_FOUND}")
250+
#MPI params found
251+
if(MPI_FOUND)
252+
message(" MPIEXEC: ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS
253+
${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS")
254+
endif(MPI_FOUND)
255+
if(CMAKE_TBINF)
256+
message(" TBinf: ${CMAKE_TBINF}")
257+
endif(CMAKE_TBINF)

CONTRIBUTORS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
LLNL Team
2+
Brian Van Essen <[email protected]>
3+
Hyojin Kim <[email protected]>
4+
Sam Jacobs <[email protected]>
5+
Adam Moody <[email protected]>
6+
7+
LLNL Summer Interns
8+
9+

LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Copyright (c) 2014-2016, Lawrence Livermore National Security, LLC.
2+
Produced at the Lawrence Livermore National Laboratory.
3+
Written by the LBANN Research Team (B. Van Essen, et al.) listed in
4+
the CONTRIBUTORS file. <[email protected]>
5+
6+
LLNL-CODE-697807.
7+
All rights reserved.
8+
9+
This file is part of LBANN: Livermore Big Artificial Neural Network
10+
Toolkit. For details, see http://software.llnl.gov/LBANN or
11+
https://github.com/LLNL/LBANN.
12+
13+
Licensed under the Apache License, Version 2.0 (the "Licensee"); you
14+
may not use this file except in compliance with the License. You may
15+
obtain a copy of the License at:
16+
17+
http://www.apache.org/licenses/LICENSE-2.0
18+
19+
Unless required by applicable law or agreed to in writing, software
20+
distributed under the License is distributed on an "AS IS" BASIS,
21+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
22+
implied. See the License for the specific language governing
23+
permissions and limitations under the license.
24+

README_LLNL.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
README_LLNL.txt:
2+
3+
Using LBANN on LLNL LC clusters:
4+
5+
cd examples
6+
7+
Setup the environment:
8+
source setup_brain_lbann_env.sh
9+
# NOTE: Compilation is now done using cmake, please follow the instruction in doc/getting_started
10+
Compile:
11+
make
12+
13+
Running on Catalyst:
14+
15+
Interactive Mode: (Allocate nodes in SLURM)
16+
salloc -N16 --enable-hyperthreads -t 1440 --clear-ssd
17+
./run_lbann_dnn_imagenet.sh -t 2400 -v 10 -e 4 -n 5000,2500,1000 -b 192 -r 0.0001
18+
19+
20+
Batch Mode:
21+
cd tests
22+
sbatch -N16 --enable-hyperthreads -t 1440 --clear-ssd ./test_imagenet_topologies.sh
23+
24+
25+
Running on Surface:
26+
27+
Interactive Mode: (Allocate nodes in MOAB)
28+
29+
mxterm 16 256 1440 -A hpclearn

README_coding_style.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
For LBANN coding style we are going to use one that is based on the standard C++ libraries and Boost projects.
2+
3+
* overriding style is lowercase separated with underbar
4+
* member fields: m_*
5+
* function names, class names: lowercase with underbar
6+
* templated types: start with uppercase (camel case after that e.g. DataType)
7+
* derived typedef types: typedef DataType::value_type value_type
8+
* header preprocessor guard: <NAMESPACE_PATH_NAME>_HPP_INCLUDED (e.g. LBANN_LAYERS_FULLYCONNECTED_HPP_INCLUDED)
9+
* 2 space, no tabs
10+
* comments:
11+
* doxygen:
12+
* /// single line comment
13+
* /** multi-line comment */
14+
* @todo - TODO note
15+
* inside of a function use //
16+
* outside use a doxygen comment
17+
* minimize blocks of // or /* */ comments that are not picked up by doxygen
18+
* If you have a complicated function or algorithm, either explain it in a doxygen comment or cite an appropriate reference
19+
* if the implementation details or meta-parameters are derived from another opensource ML toolkit - cite it
20+
* global variable - see above about lowercase with underbar

build/catalyst.llnl.gov/.keep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Build directory for LLNL catalyst cluster.

build/flash.llnl.gov/.keep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Build directory for LLNL flash cluster.

0 commit comments

Comments
 (0)