|
| 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')" |
0 commit comments