Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding HDF5 compression plugins to superbuild #2432

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion scripts/superbuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ lbann_sb_add_packages(
Aluminum # Hydrogen, DiHydrogen
Catch2 # Hydrogen, DiHydrogen
HDF5 # Conduit
ZFP # LBANN
H5Z-ZFP # LBANN
HDF5_PLUGINS # LBANN
Comment on lines +80 to +82
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ZFP # LBANN
H5Z-ZFP # LBANN
HDF5_PLUGINS # LBANN
ZFP # LBANN (runtime)
H5Z-ZFP # LBANN (runtime)
HDF5_PLUGINS # LBANN (runtime)

JPEG-TURBO # OpenCV
OpenBLAS # Hydrogen
spdlog # DiHydrogen, LBANN
Expand Down Expand Up @@ -112,7 +115,11 @@ foreach (pkg ${LBANN_SB_BUILD_PKGS})
endforeach ()

# Print a helpful(?) message
set(LBANN_SB_SUGG_CMAKE_PREFIX_PATH_TMP "\$\{CMAKE_PREFIX_PATH\}")
set(LBANN_SB_SUGG_CMAKE_PREFIX_PATH_TMP "${CMAKE_PREFIX_PATH}:\$\{CMAKE_PREFIX_PATH\}")
message("BVE I think that there is a prefix path ${CMAKE_PREFIX_PATH}")
message("BVE I think that there is a foo ${FOO}")
message("BVE I think that there is a suggesed prefix path ${LBANN_SB_SUGG_CMAKE_PREFIX_PATH_TMP}")
#set(LBANN_SB_SUGG_CMAKE_PREFIX_PATH_TMP "\$\{CMAKE_PREFIX_PATH\}")
Comment on lines +118 to +122
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set(LBANN_SB_SUGG_CMAKE_PREFIX_PATH_TMP "${CMAKE_PREFIX_PATH}:\$\{CMAKE_PREFIX_PATH\}")
message("BVE I think that there is a prefix path ${CMAKE_PREFIX_PATH}")
message("BVE I think that there is a foo ${FOO}")
message("BVE I think that there is a suggesed prefix path ${LBANN_SB_SUGG_CMAKE_PREFIX_PATH_TMP}")
#set(LBANN_SB_SUGG_CMAKE_PREFIX_PATH_TMP "\$\{CMAKE_PREFIX_PATH\}")

message("\n-----------------------------------------------------------------\n")
message("LBANN SuperBuild will build the following packages:\n")
foreach (pkg ${LBANN_SB_BUILD_PKGS})
Expand Down Expand Up @@ -140,6 +147,16 @@ message("\n-----------------------------------------------------------------\n")
file(WRITE "${CMAKE_BINARY_DIR}/lbann_sb_suggested_cmake_prefix_path.sh"
"export CMAKE_PREFIX_PATH=${LBANN_SB_SUGG_CMAKE_PREFIX_PATH}\n")

if (LBANN_SB_BUILD_H5Z-ZFP)
file(APPEND "${CMAKE_BINARY_DIR}/lbann_sb_suggested_cmake_prefix_path.sh"
"\nexport HDF5_PLUGIN_PATH=${H5Z-ZFP_DIR}/plugin:\$\{HDF5_PLUGIN_PATH\}\n")
endif (LBANN_SB_BUILD_H5Z-ZFP)

if (LBANN_SB_BUILD_HDF5_PLUGINS)
file(APPEND "${CMAKE_BINARY_DIR}/lbann_sb_suggested_cmake_prefix_path.sh"
"\nexport HDF5_PLUGIN_PATH=${HDF5_PLUGINS_DIR}/lib/plugin:\$\{HDF5_PLUGIN_PATH\}\n")
endif (LBANN_SB_BUILD_HDF5_PLUGINS)

# Add a custom target for bundling all things up
if (UNIX)
find_program(__FIND_EXE find)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ macro(lbann_sb_add_cmake_extern_pkg)
NAME
GITHUB_URL
GIT_TAG
SOURCE_SUBDIR)
SOURCE_SUBDIR
INIT_CONFIG)
set(_macro_multi_val
LANGUAGES
EXTRA_CMAKE_ARGS
Expand Down Expand Up @@ -274,6 +275,11 @@ macro(lbann_sb_add_cmake_extern_pkg)
message("\nLBANN!\n")
endif ()

if (lbann_sb_add_INIT_CONFIG)
list(PREPEND LBANN_SB_${PKG_NAME}_CMAKE_LANG_ARGS
"-C${lbann_sb_add_INIT_CONFIG}")
endif ()

# Finally add the project.
ExternalProject_Add(${PKG_NAME}
# Standard stuff; users shouldn't care.
Expand Down
26 changes: 20 additions & 6 deletions scripts/superbuild/examples/cuda-distconv.sh
100644 → 100755
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this was not executable in the repository on purpose (executing it wouldn't preserve the meaningful export statements) -- it should only ever be sourced.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
## permissions and limitations under the license.
################################################################################

#source $LMOD_PKG/init/zsh
#ml cuda/11.8 cmake/3.23 ninja gcc/11
ml load cuda/12.2.2 cmake/3.23.1 gcc/11.2.1 spectrum-mpi/rolling-release python/3.8.2
export LIBRARY_PATH=$LD_LIBRARY_PATH

Comment on lines +27 to +31
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#source $LMOD_PKG/init/zsh
#ml cuda/11.8 cmake/3.23 ninja gcc/11
ml load cuda/12.2.2 cmake/3.23.1 gcc/11.2.1 spectrum-mpi/rolling-release python/3.8.2
export LIBRARY_PATH=$LD_LIBRARY_PATH

# Set to ON (or any CMake truthy value) to build all of the
# dependencies of the LBANN stack
BUILD_EXTERNAL_TPLS=ON
Expand Down Expand Up @@ -53,18 +58,21 @@ LBANN_SRC_DIR=$(git rev-parse --show-toplevel)
SUPERBUILD_SRC_DIR=${LBANN_SRC_DIR}/scripts/superbuild

# Set to the preferred install directory
INSTALL_PREFIX=${PWD}/install-cuda-distconv
#INSTALL_PREFIX=${PWD}/install-cuda-distconv
INSTALL_PREFIX=/p/vast1/lbann/stable_dependencies/lassen/gcc-11.2.1/cuda-12.2.2/spectrum-mpi-rolling-release

# Set to the preferred build directory
BUILD_DIR=${TMPDIR}/lbann-superbuild

# -G Ninja \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# -G Ninja \

cmake \
-G Ninja \
-G "Unix Makefiles" \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-G "Unix Makefiles" \

-S ${SUPERBUILD_SRC_DIR} \
-B ${BUILD_DIR} \
\
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
-D BUILD_SHARED_LIBS=ON \
\
-D CMAKE_C_COMPILER=$(command -v gcc) \
-D CMAKE_CXX_COMPILER=$(command -v g++) \
Expand All @@ -74,7 +82,7 @@ cmake \
\
-D CMAKE_CXX_STANDARD=17 \
-D CMAKE_CUDA_STANDARD=17 \
-D CMAKE_CUDA_ARCHITECTURES=${GPU_ARCH} \
-D CMAKE_CUDA_ARCHITECTURES=${CUDA_GPU_ARCH} \
\
-D CMAKE_POSITION_INDEPENDENT_CODE=ON \
\
Expand Down Expand Up @@ -107,12 +115,13 @@ cmake \
-D LBANN_SB_BUILD_Aluminum=${BUILD_LBANN_STACK} \
-D LBANN_SB_Aluminum_CXX_FLAGS="${EXTRA_CXX_FLAGS}" \
-D LBANN_SB_Aluminum_CUDA_FLAGS="${EXTRA_CUDA_FLAGS}" \
-D LBANN_SB_FWD_Aluminum_ALUMINUM_ENABLE_CALIPER=ON \
-D LBANN_SB_FWD_Aluminum_ALUMINUM_ENABLE_CALIPER=OFF \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May as well set LBANN_SB_BUILD_adiak=OFF and LBANN_SB_BUILD_Caliper=OFF, too.

-D LBANN_SB_FWD_Aluminum_ALUMINUM_ENABLE_NCCL=ON \
-D LBANN_SB_FWD_Aluminum_ALUMINUM_ENABLE_HOST_TRANSFER=ON \
-D LBANN_SB_FWD_Aluminum_ALUMINUM_ENABLE_TESTS=OFF \
-D LBANN_SB_FWD_Aluminum_ALUMINUM_ENABLE_BENCHMARKS=OFF \
-D LBANN_SB_FWD_Aluminum_ALUMINUM_ENABLE_THREAD_MULTIPLE=OFF \
-D LBANN_SB_FWD_Aluminum_NCCL_DIR=${INSTALL_PREFIX}/nccl_2.20.3-1+cuda12.2_ppc64le \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-D LBANN_SB_FWD_Aluminum_NCCL_DIR=${INSTALL_PREFIX}/nccl_2.20.3-1+cuda12.2_ppc64le \

\
-D LBANN_SB_BUILD_Hydrogen=${BUILD_LBANN_STACK} \
-D LBANN_SB_Hydrogen_CXX_FLAGS="${EXTRA_CXX_FLAGS}" \
Expand All @@ -122,12 +131,15 @@ cmake \
-D LBANN_SB_FWD_Hydrogen_Hydrogen_ENABLE_HALF=OFF \
-D LBANN_SB_FWD_Hydrogen_Hydrogen_ENABLE_TESTING=ON \
-D LBANN_SB_FWD_Hydrogen_Hydrogen_ENABLE_UNIT_TESTS=OFF \
-D LBANN_SB_FWD_Hydrogen_NCCL_DIR=${INSTALL_PREFIX}/nccl_2.20.3-1+cuda12.2_ppc64le \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-D LBANN_SB_FWD_Hydrogen_NCCL_DIR=${INSTALL_PREFIX}/nccl_2.20.3-1+cuda12.2_ppc64le \

\
-D LBANN_SB_BUILD_DiHydrogen=${BUILD_LBANN_STACK} \
-D LBANN_SB_DiHydrogen_CXX_FLAGS="${EXTRA_CXX_FLAGS}" \
-D LBANN_SB_DiHydrogen_CUDA_FLAGS="${EXTRA_CUDA_FLAGS}" \
-D LBANN_SB_FWD_DiHydrogen_BLA_VENDOR="Generic" \
-D LBANN_SB_FWD_DiHydrogen_H2_ENABLE_DISTCONV_LEGACY=${BUILD_WITH_DISTCONV} \
-D LBANN_SB_FWD_DiHydrogen_NCCL_DIR=${INSTALL_PREFIX}/nccl_2.20.3-1+cuda12.2_ppc64le \
-D LBANN_SB_FWD_DiHydrogen_CUDNN_DIR=${INSTALL_PREFIX}/cudnn-linux-ppc64le-8.9.7.29_cuda12-archive \
Comment on lines +141 to +142
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-D LBANN_SB_FWD_DiHydrogen_NCCL_DIR=${INSTALL_PREFIX}/nccl_2.20.3-1+cuda12.2_ppc64le \
-D LBANN_SB_FWD_DiHydrogen_CUDNN_DIR=${INSTALL_PREFIX}/cudnn-linux-ppc64le-8.9.7.29_cuda12-archive \

\
-D LBANN_SB_BUILD_LBANN=${BUILD_LBANN_STACK} \
-D LBANN_SB_LBANN_SOURCE_DIR=${LBANN_SRC_DIR} \
Expand All @@ -137,7 +149,9 @@ cmake \
-D LBANN_SB_FWD_LBANN_BLA_VENDOR="Generic" \
-D LBANN_SB_FWD_LBANN_CMAKE_EXPORT_COMPILE_COMMANDS=ON \
-D LBANN_SB_FWD_LBANN_LBANN_DATATYPE=float \
-D LBANN_SB_FWD_LBANN_LBANN_WITH_CALIPER=ON \
-D LBANN_SB_FWD_LBANN_LBANN_WITH_CALIPER=OFF \
-D LBANN_SB_FWD_LBANN_LBANN_WITH_DISTCONV=${BUILD_WITH_DISTCONV} \
-D LBANN_SB_FWD_LBANN_LBANN_WITH_TBINF=OFF \
-D LBANN_SB_FWD_LBANN_LBANN_WITH_UNIT_TESTING=ON
-D LBANN_SB_FWD_LBANN_LBANN_WITH_UNIT_TESTING=ON \
-D LBANN_SB_FWD_LBANN_NCCL_DIR=${INSTALL_PREFIX}/nccl_2.20.3-1+cuda12.2_ppc64le \
-D LBANN_SB_FWD_LBANN_CUDNN_DIR=${INSTALL_PREFIX}/cudnn-linux-ppc64le-8.9.7.29_cuda12-archive
Comment on lines +155 to +157
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-D LBANN_SB_FWD_LBANN_LBANN_WITH_UNIT_TESTING=ON \
-D LBANN_SB_FWD_LBANN_NCCL_DIR=${INSTALL_PREFIX}/nccl_2.20.3-1+cuda12.2_ppc64le \
-D LBANN_SB_FWD_LBANN_CUDNN_DIR=${INSTALL_PREFIX}/cudnn-linux-ppc64le-8.9.7.29_cuda12-archive
-D LBANN_SB_FWD_LBANN_LBANN_WITH_UNIT_TESTING=ON

42 changes: 42 additions & 0 deletions scripts/superbuild/h5z-zfp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
################################################################################
## Copyright (c) 2014-2024, Lawrence Livermore National Security, LLC.
## Produced at the Lawrence Livermore National Laboratory.
## Written by the LBANN Research Team (B. Van Essen, et al.) listed in
## the CONTRIBUTORS file. <[email protected]>
##
## LLNL-CODE-697807.
## All rights reserved.
##
## This file is part of LBANN: Livermore Big Artificial Neural Network
## Toolkit. For details, see http://software.llnl.gov/LBANN or
## https://github.com/LLNL/LBANN.
##
## Licensed under the Apache License, Version 2.0 (the "Licensee"); you
## may not use this file except in compliance with the License. You may
## obtain a copy of the License at:
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
## implied. See the License for the specific language governing
## permissions and limitations under the license.
################################################################################

# Conduit is "cute" about finding HDF5. It's not a CMake option() --
# you opt in by setting HDF5_DIR explicitly. So let's do that.
# if (TARGET HDF5 AND NOT LBANN_SB_FWD_ZFP_HDF5_DIR)
# set(LBANN_SB_FWD_ZFP_HDF5_DIR ${HDF5_DIR})
# endif ()
Comment on lines +27 to +31
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Conduit is "cute" about finding HDF5. It's not a CMake option() --
# you opt in by setting HDF5_DIR explicitly. So let's do that.
# if (TARGET HDF5 AND NOT LBANN_SB_FWD_ZFP_HDF5_DIR)
# set(LBANN_SB_FWD_ZFP_HDF5_DIR ${HDF5_DIR})
# endif ()


lbann_sb_add_cmake_extern_pkg(
NAME H5Z-ZFP
LANGUAGES C CXX ${lbann_sb_ftn_lang}
GITHUB_URL llnl/h5z-zfp.git
GIT_TAG "master"
DEPENDS_ON HDF5 ZFP
)

set(H5Z-ZFP_DIR ${LBANN_SB_H5Z-ZFP_PREFIX}
CACHE INTERNAL "The install prefix of H5Z-ZFP.")
36 changes: 21 additions & 15 deletions scripts/superbuild/hdf5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
## permissions and limitations under the license.
################################################################################
# These defaults are set so as to be most amenable to LBANN(/Conduit).
set(LBANN_SB_FWD_HDF5_DEFAULT_API_VERSION "v18"
CACHE BOOL "Default API version for HDF5")
set(LBANN_SB_FWD_HDF5_DEFAULT_API_VERSION "v112"
CACHE STRING "Default API version for HDF5")

option(LBANN_SB_FWD_HDF5_BUILD_TESTING
"Build HDF5 tests."
Expand All @@ -37,24 +37,30 @@ option(LBANN_SB_FWD_HDF5_HDF5_BUILD_EXAMPLES
option(LBANN_SB_FWD_HDF5_HDF5_ENABLE_PARALLEL
"Build HDF5 with parallel (MPI) support." ON)

option(LBANN_SB_FWD_HDF5_HDF5_USE_16_API_DEFAULT
"Use 1.6 API by default"
OFF)
option(LBANN_SB_FWD_HDF5_HDF5_USE_18_API_DEFAULT
"Use 1.8 API by default"
ON)
option(LBANN_SB_FWD_HDF5_HDF5_USE_110_API_DEFAULT
"Use 1.10 API by default"
OFF)
option(LBANN_SB_FWD_HDF5_HDF5_USE_112_API_DEFAULT
"Use 1.12 API by default"
OFF)
# option(LBANN_SB_FWD_HDF5_HDF5_USE_16_API_DEFAULT
# "Use 1.6 API by default"
# OFF)
# option(LBANN_SB_FWD_HDF5_HDF5_USE_18_API_DEFAULT
# "Use 1.8 API by default"
# OFF)
# option(LBANN_SB_FWD_HDF5_HDF5_USE_110_API_DEFAULT
# "Use 1.10 API by default"
# OFF)
# option(LBANN_SB_FWD_HDF5_HDF5_USE_112_API_DEFAULT
# "Use 1.12 API by default"
# ON)
Comment on lines +40 to +51
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# option(LBANN_SB_FWD_HDF5_HDF5_USE_16_API_DEFAULT
# "Use 1.6 API by default"
# OFF)
# option(LBANN_SB_FWD_HDF5_HDF5_USE_18_API_DEFAULT
# "Use 1.8 API by default"
# OFF)
# option(LBANN_SB_FWD_HDF5_HDF5_USE_110_API_DEFAULT
# "Use 1.10 API by default"
# OFF)
# option(LBANN_SB_FWD_HDF5_HDF5_USE_112_API_DEFAULT
# "Use 1.12 API by default"
# ON)

option(LBANN_SB_FWD_HDF5_HDF5_BUILD_FORTRAN
"Build HDF5 with fortran support"
OFF)
option(LBANN_SB_FWD_HDF5_HDF5_GENERATE_HEADERS
"See HDF5 docs."
ON)
option(LBANN_SB_FWD_HDF5_ONLY_SHARED_LIBS
"Only Build Shared Libraries."
ON)
# option(LBANN_SB_FWD_HDF5_DEFAULT_API_VERSION
# "Only Build Shared Libraries."
# v112)
Comment on lines +61 to +63
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# option(LBANN_SB_FWD_HDF5_DEFAULT_API_VERSION
# "Only Build Shared Libraries."
# v112)


# At present, this is required for LBANN/JAG use.
option(LBANN_SB_FWD_HDF5_HDF5_ENABLE_Z_LIB_SUPPORT
Expand All @@ -75,7 +81,7 @@ lbann_sb_add_cmake_extern_pkg(
NAME HDF5
LANGUAGES C CXX ${MAYBE_HDF5_FORTRAN}
GITHUB_URL HDFGroup/hdf5
GIT_TAG "hdf5-1_10_9")
GIT_TAG "hdf5-1_12_3")

set(HDF5_DIR ${LBANN_SB_HDF5_PREFIX}
CACHE INTERNAL "The install prefix of HDF5.")
Loading
Loading