Prasham.Jain Claude Sonnet 4.6 commited on
Commit
15e36fe
·
1 Parent(s): 8580936

fix(training): upgrade base image to torch 2.6.0+cu126

Browse files

unsloth-zoo 2026.4.x requires torchao>=0.13.0 which uses torch.int1 —
a dtype added in PyTorch 2.6.0. The previous 2.5.1 image caused a hard
import failure cascading through transformers→peft→trl.

Changes:
- FROM pytorch/pytorch:2.5.1-cuda12.4 → pytorch/pytorch:2.6.0-cuda12.6
- unsloth extras: cu124-torch251 → cu126-torch260
- Remove torchao==0.5.0 pin (no longer needed, torch 2.6 supports 0.13+)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. Dockerfile.train +10 -14
Dockerfile.train CHANGED
@@ -9,8 +9,9 @@
9
  # HF_SCENARIOS_REPO, HF_SFT_DATASET_REPO, HF_MODEL_REPO (optional)
10
  # GRPO_STEPS (optional, default 100)
11
 
12
- # torch 2.5.1 + CUDA 12.4 — minimum needed for unsloth + transformers>=4.51 + Qwen3.
13
- FROM pytorch/pytorch:2.5.1-cuda12.4-cudnn9-devel
 
14
 
15
  ENV DEBIAN_FRONTEND=noninteractive
16
  ENV PYTHONUNBUFFERED=1
@@ -21,26 +22,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
21
 
22
  WORKDIR /workspace
23
 
24
- # 1. Install unsloth for this exact torch/CUDA combo.
25
- # This resolves and installs compatible versions of:
26
- # transformers>=4.51 (Qwen3 + CompileConfig), peft, trl, accelerate, xformers.
27
  RUN pip install --no-cache-dir \
28
- "unsloth[cu124-torch251] @ git+https://github.com/unslothai/unsloth.git"
29
 
30
- # 1b. Pin torchao to a version compatible with torch 2.5.1.
31
- # unsloth pulls torchao>=0.8 which references torch.int1 (added in torch 2.6.0).
32
- # Forcing 0.5.0 keeps the import chain clean; we use bitsandbytes, not torchao.
33
- RUN pip install --no-cache-dir "torchao==0.5.0" --force-reinstall
34
-
35
- # 2. Install project deps (unsloth already locked transformers/trl/peft above).
36
  COPY pyproject.toml README.md ./
37
  COPY src/ src/
38
  RUN pip install --no-cache-dir -e ".[data,training]"
39
 
40
- # 3. JupyterLab for interactive mode
41
  RUN pip install --no-cache-dir jupyterlab ipywidgets
42
 
43
- # 4. Copy notebooks and training scripts
44
  COPY notebooks/ notebooks/
45
  COPY train.py ./
46
 
 
9
  # HF_SCENARIOS_REPO, HF_SFT_DATASET_REPO, HF_MODEL_REPO (optional)
10
  # GRPO_STEPS (optional, default 100)
11
 
12
+ # torch 2.6.0 + CUDA 12.6 — minimum required by unsloth-zoo 2026.4.x
13
+ # (torchao>=0.13 needed by unsloth-zoo uses torch.int1, added in torch 2.6.0)
14
+ FROM pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel
15
 
16
  ENV DEBIAN_FRONTEND=noninteractive
17
  ENV PYTHONUNBUFFERED=1
 
22
 
23
  WORKDIR /workspace
24
 
25
+ # Install unsloth for torch 2.6.0 + CUDA 12.6.
26
+ # This pulls compatible: transformers>=4.51 (Qwen3), peft, trl, accelerate,
27
+ # xformers, and torchao>=0.13 (all compatible with torch 2.6.0).
28
  RUN pip install --no-cache-dir \
29
+ "unsloth[cu126-torch260] @ git+https://github.com/unslothai/unsloth.git"
30
 
31
+ # Install project deps (transformers/trl/peft already resolved by unsloth above).
 
 
 
 
 
32
  COPY pyproject.toml README.md ./
33
  COPY src/ src/
34
  RUN pip install --no-cache-dir -e ".[data,training]"
35
 
36
+ # JupyterLab for interactive mode
37
  RUN pip install --no-cache-dir jupyterlab ipywidgets
38
 
39
+ # Copy notebooks and training scripts
40
  COPY notebooks/ notebooks/
41
  COPY train.py ./
42