Docker image for the use of flax-related Python packages in Fred Hutch OCDO's WILDS
1.1K
This directory contains Docker images for Flax and related machine learning packages, providing a GPU-accelerated Python environment for high-performance numerical computing and deep learning research.
latest ( Dockerfile | Vulnerability Report )0.1.0 ( Dockerfile | Vulnerability Report )These Docker images are built from nvidia/cuda:12.6.3-cudnn-devel-ubuntu24.04 and include:
The images are designed to provide a comprehensive Flax/JAX-based machine learning environment with CUDA 12 GPU support. While named after Flax, this image includes a broad set of ML and data science packages and can be used for a wide range of deep learning and scientific computing use cases.
Note on Scenic: Scenic is not available on PyPI and is installed directly from its GitHub repository, pinned to a specific commit hash for reproducibility.
If you use Flax in your research, please cite the original authors:
Heek, J., Levskaya, A., Oliver, A., Ritter, M., Rondepierre, B., Steiner, A., & van Zee, M. (2024).
Flax: A neural network library and ecosystem for JAX.
http://github.com/google/flax
Tool homepage: https://github.com/google/flax
docker pull getwilds/flax:latest
# or
docker pull getwilds/flax:0.1.0
# Alternatively, pull from GitHub Container Registry
docker pull ghcr.io/getwilds/flax:latest
apptainer pull docker://getwilds/flax:latest
# or
apptainer pull docker://getwilds/flax:0.1.0
# Alternatively, pull from GitHub Container Registry
apptainer pull docker://ghcr.io/getwilds/flax:latest
# example.py
import jax
import jax.numpy as jnp
from flax import nnx
import optax
# Check available devices
print(f"JAX devices: {jax.devices()}")
# Define a simple neural network using Flax
class SimpleNN(nnx.Module):
def __init__(self, rngs: nnx.Rngs):
self.linear1 = nnx.Linear(784, 128, rngs=rngs)
self.linear2 = nnx.Linear(128, 10, rngs=rngs)
def __call__(self, x):
x = nnx.relu(self.linear1(x))
return self.linear2(x)
# Initialize model and optimizer
model = SimpleNN(rngs=nnx.Rngs(0))
optimizer = nnx.Optimizer(model, optax.adam(1e-3))
# Create dummy data
key = jax.random.PRNGKey(0)
x = jax.random.normal(key, (32, 784))
y = jax.random.randint(key, (32,), 0, 10)
Run the script with:
# Docker (with GPU support)
docker run --rm --gpus all -v /path/to/script:/script getwilds/flax:latest python3 /script/example.py
# Docker (CPU only)
docker run --rm -v /path/to/script:/script getwilds/flax:latest python3 /script/example.py
# Apptainer (with GPU support)
apptainer run --nv --bind /path/to/script:/script docker://getwilds/flax:latest python3 /script/example.py
# Apptainer (local SIF file)
apptainer run --nv --bind /path/to/script:/script flax_latest.sif python3 /script/example.py
Note: This image is only built for linux/amd64 architecture. jaxlib requires AVX instructions and NVIDIA CUDA GPU support, neither of which are available on ARM64 platforms.
This image requires NVIDIA GPU drivers and the NVIDIA Container Toolkit for GPU acceleration. Use --gpus all with Docker or --nv with Apptainer to enable GPU support.
The Dockerfile follows these main steps:
nvidia/cuda:12.6.3-cudnn-devel-ubuntu24.04 as the base image--no-cache-dir to minimize image sizeThese images are regularly scanned for vulnerabilities using Docker Scout. However, due to the nature of bioinformatics software and their dependencies, some Docker images may contain components with known vulnerabilities (CVEs).
Use at your own risk: While we strive to minimize security issues, these images are primarily designed for research and analytical workflows in controlled environments.
For the latest security information about this image, please check the CVEs_*.md files in this directory, which are automatically updated through our GitHub Actions workflow. If a particular vulnerability is of concern, please file an issue in the GitHub repo citing which CVE you would like to be addressed.
These Dockerfiles are maintained in the WILDS Docker Library repository.
Content type
Image
Digest
sha256:f4452cde7…
Size
5.6 GB
Last updated
7 months ago
docker pull getwilds/flax