File size: 1,696 Bytes
2e208c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM rocm/pytorch-training:v25.2

ENV DEBIAN_FRONTEND=noninteractive
# Required environment variables for ROCm
ENV HSA_NO_SCRATCH_RECLAIM=1
ENV PYTORCH_ROCM_ARCH="gfx90a;gfx942"

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git wget curl vim ca-certificates \
    build-essential python3-dev \
    && rm -rf /var/lib/apt/lists/*

# Downgrade transformers and install other dependencies
# Note: Do NOT reinstall PyTorch, base image already contains ROCm version
RUN pip install --upgrade pip && \
    pip install \
    transformers==4.31.0 \
    tokenizers==0.13.3 \
    sentencepiece==0.1.99 \
    accelerate==0.21.0 \
    peft==0.4.0 \
    einops==0.6.1 \
    einops-exts==0.0.4 \
    timm==0.6.13 \
    gradio==3.35.2 \
    gradio_client==0.2.9 \
    httpx==0.24.0 \
    scikit-learn==1.2.2 \
    supervision==0.10.0 \
    "pydantic>=1.10,<2.0" \
    shortuuid==1.0.11 \
    markdown2==2.4.10 \
    requests==2.31.0 \
    uvicorn==0.23.2 \
    fastapi==0.100.1 \
    pillow==10.0.0 \
    tqdm==4.66.1 \
    datasets==2.14.4 \
    deepspeed==0.9.5 \
    wandb==0.15.8

# Install additional utility packages
RUN pip install \
    numpy==1.24.4 \
    pyarrow==12.0.1 \
    packaging==23.1 \
    wheel==0.41.2 \
    setuptools==68.0.0 \
    ninja==1.11.1 \
    psutil==5.9.5


WORKDIR /workspace
CMD ["/bin/bash"]

# Build: docker build -t llava-rocm -f Dockerfile.llava-rocm .
# Run: docker run --shm-size=64g --device=/dev/kfd --device=/dev/dri --group-add video -it -v /home/amd/yueyuan:/workspace --name llava llava-rocm:latest
# Inside container: cd /workspace/Finance/fin-mm/code/LLaVA-Plus && pip install --no-deps -e . && pip install --no-deps -e ".[train]"