Sync docker to dataset volume
Browse filesFiles changed (3)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677# syntax=docker/dockerfile:1.7# ZOMBIE-WEIGHTS L4 image: two isolated uv/Python-3.12 environments sharing one HF cache.## /opt/venv_core torch 2.13 (from base), transformers <5.22, trl <1.15,# transformer-lens==3.8.0, bnb, CuratorKIT, CircuitKIT,# SafeTune, AuditKIT — NO torchao# /opt/venv_aligntune aligntune 0.1.35, trl==1.7.1, torchao 0.18, torchvision 0.28## Build:# docker build -f docker/Dockerfile.l4 -t ghcr.io/divyanshu-kumar14/zombie-weights-l4:latest .FROM pytorch/pytorch:2.13.0-cuda12.6-cudnn9-runtime
ENV DEBIAN_FRONTEND=noninteractive \ HF_HOME=/root/.cache/huggingface \ HF_HUB_ENABLE_HF_TRANSFER=1 \ PYTHONUNBUFFERED=1 \ TOKENIZERS_PARALLELISM=false \ ALIGNTUNE_ENABLE_VLLM=0 \ UV_LINK_MODE=copy
RUN apt-get update && apt-get install -y --no-install-recommends \ git curl ca-certificates build-essential \ && rm -rf /var/lib/apt/lists/*
# uv (pinned standalone binary; avoids PEP 668 system-pip restrictions)COPY --from=ghcr.io/astral-sh/uv:0.12.17 /uv /usr/local/bin/uv
# ---------------------------------------------------------------------------# Core environment (base image Python 3.12.3 + system torch 2.13.0)# uv creates the venv; pip resolves against system-site-packages so torch is# reused instead of downloading a second CUDA stack.# ---------------------------------------------------------------------------RUN uv venv --system-site-packages --seed /opt/venv_coreRUN /opt/venv_core/bin/pip install --no-cache-dir \ "transformers>=5.15,<5.22" \ "trl>=0.12,<1.15" \ "peft>=0.18,<1" \ "huggingface-hub>=1.5,<2" \ "transformer-lens==3.8.0" \ "bitsandbytes>=0.41" \ "datasets>=3.0" \ "accelerate>=1.4" \ "sentencepiece" \ "protobuf" \ "scikit-learn" \ "hf_transfer" \ "curatorkit[hf,connectors]" \ "circuitkit==0.2.3" \ "safetune==0.1.18" \ "auditkit==1.1.11"
# ---------------------------------------------------------------------------# AlignTune environment (isolated; torchao only lives here)# ---------------------------------------------------------------------------RUN uv venv --system-site-packages --seed /opt/venv_aligntuneRUN /opt/venv_aligntune/bin/pip install --no-cache-dir \ "torchvision==0.28.0" \ "transformers>=5.15,<5.22" \ "peft>=0.18,<1" \ "datasets>=4.7.0" \ "accelerate>=1.6" \ "trl==1.7.1" \ "torchao==0.18.0" \ "aligntune==0.1.35"
# ---------------------------------------------------------------------------# Project code + hard import gates# ---------------------------------------------------------------------------COPY docker/verify_imports.py /opt/zombie-weights/docker/verify_imports.pyCOPY src/ /opt/zombie-weights/src/COPY scripts/ /opt/zombie-weights/scripts/
RUN /opt/venv_core/bin/python /opt/zombie-weights/docker/verify_imports.py core \ && /opt/venv_aligntune/bin/python /opt/zombie-weights/docker/verify_imports.py aligntune
WORKDIR /opt/zombie-weightsCMD ["bash"]20 unmodified lines2122232425261 unmodified line2829303132333420 unmodified linesdef check_core() -> dict:import torchimport transformersimport trl1 unmodified lineimport huggingface_hubimport transformer_lensimport curatorkitimport circuitkitimport safetuneimport auditkit20 unmodified lines212223242526271 unmodified line29303132333420 unmodified linesdef check_core() -> dict:import circuitkit # must be imported before transformer_lens to install Cohere/Gemma patchesimport torchimport transformersimport trl1 unmodified lineimport huggingface_hubimport transformer_lensimport curatorkitimport safetuneimport auditkit
docker/Dockerfile.l4Added+77
docker/__pycache__/verify_imports.cpython-312.pycAdded
docker/verify_imports.py+1-1