Skip to content

Commit 5304da2

Browse files
SendoRayHuangJoJo
authored andcommitted
(feat): add ROLL PPU dockerfile with SAIL pypi source, full megatron-core and FLA for Qwen3.5
1 parent c699908 commit 5304da2

3 files changed

Lines changed: 86 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
FROM pkg.flytiger-eco.com/docker_release/llm:v2.1.1-pytorch2.10.0-ubuntu24.04-cuda13.0-vllm0.17.1-py312
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
ENV TERM=xterm-256color
5+
ENV PIP_ROOT_USER_ACTION=ignore
6+
7+
# Internal PyPI index; packages missing from it fall back to the Aliyun mirror
8+
ENV PIP_INDEX_URL=https://pkg.flytiger-eco.com/artifactory/api/pypi/pypi_index/simple
9+
ENV PIP_TRUSTED_HOST=pkg.flytiger-eco.com
10+
ENV PIP_EXTRA_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
11+
12+
# Base image /tmp lacks write permission which breaks apt; restore standard permission first
13+
RUN chmod 1777 /tmp && apt-get update \
14+
&& apt-get install -y --no-install-recommends iproute2 tmux zip git curl \
15+
&& rm -rf /var/lib/apt/lists/*
16+
17+
COPY . /opt/ROLL
18+
WORKDIR /opt/ROLL
19+
20+
# Pin PPU-custom versions of torch/vllm/flash-attn etc. so public indexes cannot override them
21+
ENV PIP_CONSTRAINT=/opt/ROLL/docker/constraints_ppu.txt
22+
23+
RUN pip install --upgrade pip setuptools wheel
24+
25+
# gem-llm==0.0.4 wrongly excludes Python 3.12.x; install it separately with --ignore-requires-python.
26+
# --no-build-isolation: SAIL PPU sdist packages import torch in setup.py.
27+
RUN sed -e '/^gem-llm/d' \
28+
-e '\|^\./mcore_adapter|d' \
29+
-e 's|^-r requirements_vision.txt|-r /opt/ROLL/requirements_vision.txt|' \
30+
requirements_common.txt > /tmp/requirements_common_ppu.txt \
31+
&& sed 's|-r requirements_common.txt|-r /tmp/requirements_common_ppu.txt|' requirements_torch2100_vllm_ppu.txt > /tmp/requirements_ppu.txt \
32+
&& pip install --no-build-isolation -r /tmp/requirements_ppu.txt \
33+
&& pip install --no-build-isolation --ignore-requires-python gem-llm==0.0.4
34+
35+
# Install mcore_adapter with deps: pulls full megatron-core to replace the base image's stripped stub.
36+
RUN pip install --no-build-isolation /opt/ROLL/mcore_adapter
37+
38+
# torchvision (needed by vLLM Qwen3.5 VL) from SAIL only: clear PIP_EXTRA_INDEX_URL so the
39+
# stock mirror wheel is not preferred over the PPU build.
40+
RUN PIP_EXTRA_INDEX_URL= pip install --no-deps --no-build-isolation torchvision==0.25.0 \
41+
-i https://pkg.flytiger-eco.com/artifactory/api/pypi/pypi_index/simple \
42+
--trusted-host pkg.flytiger-eco.com
43+
44+
# FLA for Qwen3.5 hybrid attention: install internal fla to back up the PPU kda shims,
45+
# replace with fla-org build, restore shims. Must precede 'pip install -e .'.
46+
RUN pip install -q --no-deps --no-build-isolation fla \
47+
&& mkdir -p /tmp/fla_ppu_backup \
48+
&& cp /usr/local/lib/python3.12/site-packages/fla/kda.py \
49+
/usr/local/lib/python3.12/site-packages/fla/_fused_sigmoid_gating_cuda.cpython-312-x86_64-linux-gnu.so \
50+
/tmp/fla_ppu_backup/ \
51+
&& pip uninstall -y -q fla \
52+
&& cd /tmp && curl -sL -o fla.tar.gz https://github.com/fla-org/flash-linear-attention/archive/refs/heads/main.tar.gz \
53+
&& pip install -q --no-deps --no-build-isolation ./fla.tar.gz \
54+
&& cp /tmp/fla_ppu_backup/kda.py \
55+
/tmp/fla_ppu_backup/_fused_sigmoid_gating_cuda.cpython-312-x86_64-linux-gnu.so \
56+
/usr/local/lib/python3.12/site-packages/fla/
57+
58+
RUN pip install -e .
59+
60+
RUN python -c "import torch, vllm, roll; print('torch:', torch.__version__); print('vllm:', vllm.__version__)" \
61+
&& python -c "import transformers, megatron.core; from transformers.models.qwen3_5 import modeling_qwen3_5; from vllm.transformers_utils.configs.qwen3_5 import Qwen3_5TextConfig; import importlib.metadata as md; print('transformers:', transformers.__version__); print('megatron_core:', md.version('megatron_core'))" \
62+
&& python -c "from megatron.core import DistributedDataParallel; import mcore_adapter; print('megatron DDP + mcore_adapter OK')" \
63+
&& python -c "from fla.modules import FusedRMSNormGated; from fla.ops.gated_delta_rule import chunk_gated_delta_rule; import fla.kda; print('FLA (fla.modules + fla.kda) OK')"

docker/constraints_ppu.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Pin the PPU-custom components in the base image (torch/vllm/flash-attn etc. with the
2+
# +vX.X.X.ppu suffix) via PIP_CONSTRAINT so public-index versions cannot override them
3+
# while installing ROLL's dependencies.
4+
torch==2.10.0+v0.1.0.ppu2.1.1
5+
vllm==0.17.1+v0.1.0.ppu2.1.1
6+
flash-attn==2.7.4.post1+v0.1.0.ppu2.1.1
7+
flash-attn-3==2.8.2+v0.1.0.ppu2.1.1
8+
flash_mla==2.0.0+v0.1.0.ppu2.1.1
9+
flashinfer-python==0.6.4+v0.1.0.ppu2.1.1
10+
xformers==0.0.30+v0.1.0.ppu2.1.1
11+
triton==3.6.0+v0.2.0.ppu2.1.1
12+
deepspeed==0.14.4
13+
# omegaconf 2.3.1 requires antlr4 4.9.x; keep later-installed packages like gem-llm from bumping it to 4.11+
14+
antlr4-python3-runtime==4.9.3
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-r requirements_common.txt
2+
3+
# torch==2.10.0+ppu / vllm==0.17.1+ppu / flash-attn / transformer-engine / deepspeed are
4+
# preinstalled in the PPU base image (custom builds) and pinned by docker/constraints_ppu.txt;
5+
# do not install them again here.
6+
7+
# Qwen3.5 (qwen3_5) model support requires transformers >= 5.2.0
8+
transformers==5.2.0
9+
accelerate==1.14.0

0 commit comments

Comments
 (0)