Tensorflow

Tensorflow is an open-source software library for Machine Intelligence.

Policy

Tensorflow is available to all users of HPC2N.

Citations

TensorFlow publishes a DOI for the open-source code base using Zenodo.org: 10.5281/zenodo.4724125

TensorFlow’s white papers are listed for citation on this page.

Overview

TensorFlowâ„¢ is an open source software library for numerical computation using data flow graphs. Nodes in the graph represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) communicated between them.

The flexible architecture allows you to deploy computation to one or more CPUs or GPUs in a desktop, server, or mobile device with a single API.

TensorFlow was originally developed by researchers and engineers working on the Google Brain Team within Google’s Machine Intelligence research organization for the purposes of conducting machine learning and deep neural networks research, but the system is general enough to be applicable in a wide variety of other domains as well.

Usage at HPC2N

On HPC2N we have TensorFlow available as a module.

Loading

To use the TensorFlow module, add it to your environment. You can find versions with

module spider TensorFlow

and you can then find how to load a specific version (including prerequisites) with

module spider TensorFlow/<version> 

Note

  • Most versions of TensorFlow include tensorboard.
  • Some versions of TensorFlow are compiled with CUDA. They are usually marked with -CUDA- in the version name (like TensorFlow/2.15.1-CUDA-12.1.1).

Running

Here are two batch script examples for running a Python code with TensorFlow

CPU example

#!/bin/bash
#SBATCH -A hpc2nXXXX-YYY # Change to your own project ID 
#SBATCH --time=00:10:00 # Asking for 10 minutes - adjust as suitable 
#SBATCH -n 1 # Asking for 1 core

# Load any modules you need, here for TensorFlow/2.15.1
module load GCC/12.3.0 OpenMPI/4.1.5 TensorFlow/2.15.1

# Run your Python script
python <my-tensorflow-code>.py

GPU example

#!/bin/bash
#SBATCH -A hpc2nXXXX-YYY # Change to your own project ID 
#SBATCH --time=00:10:00 # Asking for 10 minutes - adjust as is suitable 
#SBATCH -n 1 # Asking for 1 core
#SBATCH --gpus=1 # Asking for 1 GPU 
#SBATCH -C nvidia_gpu # We are happy with any Nvidia GPU 

# Load any modules you need, here for TensorFlow/2.15.1-CUDA-12.1.1  
module load GCC/12.3.0 OpenMPI/4.1.5 TensorFlow/2.15.1-CUDA-12.1.1  

# Run your Python script
python <my-gpu-tensorflow-code>.py 

Additional info