Skip to content

tensorflow_v2_6_0

Lynn Garren edited this page Jan 24, 2023 · 19 revisions

tensorflow v2_6_0

using a release of larrecodnn built with tensorflow v2_6_0

  • Some packages that tensorflow needs were built with spack.
    • These are installed using spack-to-ups in /cvmfs/larsoft.opensciencegrid.org/packages.
  • We have provided /cvmfs/larsoft.opensciencegrid.org/setup_larsoft.sh, to be used instead of /cvmfs/larsoft.opensciencegrid.org/products/setup.
  • Please replace source /cvmfs/larsoft.opensciencegrid.org/products/setup with source /cvmfs/larsoft.opensciencegrid.org/setup_larsoft.sh.
    • This script contains 2 lines:
source /cvmfs/larsoft.opensciencegrid.org/products/setup
export PRODUCTS=$PRODUCTS:/cvmfs/larsoft.opensciencegrid.org/packages
  • tensorflow v2_6_0 is built with eigen v3_4_0
    • Please make the following change where needed.
-find_package (Eigen3 3.3...3.3.9 REQUIRED NO_MODULE)
+find_package (Eigen3 REQUIRED NO_MODULE)

installing products

  • We strongly recommend using ups products and spack packages from /cvmfs/larsoft.opensciencegrid.org.
  • In the event this is not possible, use pullProducts -S <spack package directory>
    • This is supported in pullProducts 2.04.00 and later.
    • The spack package directory must exist, but it can be empty. pullProducts will initialize the spack package directory if necessary.
  • IMPORTANT: When installing experiment code, please use pullProducts 2.04.00 or later. This release of pullProducts will ignore the spack commands described below if -S is not specified.

recent problems

In some cases it may be necessary to explicitly set the spack mirror.

spack mirror add --scope site fnal https://spack-cache-1.fnal.gov/binaries/
spack buildcache keys --install --force
spack buildcache keys --trust

bundle manifests

Manifests that support tensorflow v2_6_0 can be created with buildFW 6.02.02 and later.
Expect to see the following lines.

spack_command spack install --cache-only libpng@1.6.37%gcc@4.8.5 arch=x86_64
spack_command spack install --cache-only libjpeg-turbo@2.1.0%gcc@4.8.5 arch=x86_64
spack_command spack install --cache-only giflib@5.2.1%gcc@4.8.5 arch=x86_64
spack_command spack module ups_version refresh -y libjpeg-turbo@2.1.0 libpng@1.6.37 giflib@5.2.1 zlib@1.2.7
spack_command spack module ups_table refresh -y libjpeg-turbo@2.1.0 libpng@1.6.37 giflib@5.2.1 zlib@

building a larsoft release distribution with tensorflow v2_6_0

  • Please use buildFW 6.02.02 or later.
  • The following lines should be near the top of the build config file.
# Specify version to bootstrap and setup UPS.
check_ups v6_0_8

# initialize spack
init_spack
# add spack packages here
add_spack_command spack install --cache-only libpng@1.6.37%gcc@4.8.5 arch=x86_64
add_spack_command spack install --cache-only libjpeg-turbo@2.1.0%gcc@4.8.5 arch=x86_64
add_spack_command spack install --cache-only giflib@5.2.1%gcc@4.8.5 arch=x86_64
add_spack_command spack module ups_version refresh -y libjpeg-turbo@2.1.0 libpng@1.6.37 giflib@5.2.1 zlib@1.2.7
add_spack_command spack module ups_table refresh -y libjpeg-turbo@2.1.0 libpng@1.6.37 giflib@5.2.1 zlib@1.2.7
  • Notes
    • buildFW will create a spack package directory under the working build directory.
    • By default, add_spack_command will execute the command and add it to the manifest.
      • If you do not want to have the command executed, use add_spack_command -n.
    • buildFW will not add init_spack to the manifest

the tensorflow config

  • Tensorflow v2_6_0 has its own instructions for building the spack packages.
    • These instructions are used to populate the spack buildcache with the required packages.
  • However, the tensorflow build should also add the spack commands to the tensorflow manifest.
  • To facilitate that, use add_spack_command -n, which adds the command to the manifest but does not execute it.

the test release

When building larsoft v09_47_00_01, we simply sourced /cvmfs/larsoft.opensciencegrid.org/setup_larsoft.sh. This is a workaround.