cxr-vlm-code / docker /Dockerfile
convitom
f
c9b4129
# CXR-VLM training environment.
# Matches the Colab GPU runtime fingerprint verified on 2026-05:
# Python 3.12.13
# torch 2.10.0+cu128
# CUDA 12.8 (nvcc 12.8.93)
# cuDNN 9.10.2
# glibc 2.35 (Ubuntu 22.04 base)
# bnb 0.49.2 (4-bit quantize verified)
#
# ─── Host requirements ────────────────────────────────────────────────────────
# This image requires NVIDIA driver >= 550.54 on the host (CUDA 12.8 runtime).
# • Colab — driver 580+, OK
# • Vast.ai — filter "CUDA Driver >= 550" when picking an instance
# • Lightning AI — A10G / A100 / H100 OK; check older T4 Studios
# • RunPod — pick a 12.8-compatible template or BYO image
#
# T4 (sm_75) note: torch.cuda.is_bf16_supported() returns True via emulation,
# but T4 has no hardware BF16. Keep train_cfg.training.fp16=True / bf16=False
# on T4. On A100/L4/H100 (sm_80+) you can flip to bf16.
#
# ─── Build & push ─────────────────────────────────────────────────────────────
# docker build -t <hub>/cxr-vlm-env:cu128 docker/
# docker push <hub>/cxr-vlm-env:cu128
#
# ─── Base image fallbacks (if 2.10.0-cuda12.8 tag is missing on Docker Hub) ──
# FROM nvcr.io/nvidia/pytorch:25.04-py3 # NVIDIA NGC, always cu128
# FROM pytorch/pytorch:2.10.0-cuda12.8-cudnn9-devel # +5GB, includes nvcc
# FROM pytorch/pytorch:2.6.0-cuda12.6-cudnn9-runtime # stable, slightly older
# `-runtime` (no CUDA toolkit/nvcc) is enough — bitsandbytes 0.49 ships
# precompiled wheels, nothing in our deps compiles CUDA from source.
FROM pytorch/pytorch:2.10.0-cuda12.8-cudnn9-runtime
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
BITSANDBYTES_NOWELCOME=1 \
TOKENIZERS_PARALLELISM=false \
HF_HUB_DISABLE_PROGRESS_BARS=1 \
TRANSFORMERS_VERBOSITY=warning \
PIP_BREAK_SYSTEM_PACKAGES=1
# ↑ PEP 668: the base image uses Debian's "externally-managed" system Python,
# which blocks `pip install` by default. Inside a single-purpose container
# there's nothing else to break, so we allow pip to write to site-packages.
RUN apt-get update && \
apt-get install -y --no-install-recommends git wget curl && \
rm -rf /var/lib/apt/lists/*
COPY requirements_docker.txt /tmp/requirements_docker.txt
RUN pip install --no-cache-dir -r /tmp/requirements_docker.txt
WORKDIR /workspace