Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dockerfiles/Dockerfile_cu130
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ RUN pip install --no-cache-dir jsonschema pymongo mooncake-transfer-engine tos z

RUN pip install --no-cache-dir bson aio-pika PyJWT asyncpg>=0.27.0 aioboto3>=12.0.0 alibabacloud_dypnsapi20170525==1.2.2 redis==6.4.0

RUN pip install --no-cache-dir future easydict termcolor

RUN pip install --no-cache-dir -U setuptools wheel

RUN pip list

# FA2 Whl: https://github.com/alkemiik-coder/FlashAttention-2.8.3-Custom-Linux-Wheels
Expand Down
112 changes: 112 additions & 0 deletions dockerfiles/Dockerfile_cu130_conda
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
FROM nvidia/cuda:13.0.3-cudnn-devel-ubuntu24.04 AS base
# ubuntu 24.04 conda python 3.11 torch 2.11 cuda 13.0

WORKDIR /app

ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
ENV LIBRARY_PATH=/usr/local/cuda/lib64/stubs:$LIBRARY_PATH

RUN apt-get update && apt-get install -y vim tmux zip unzip bzip2 wget git git-lfs build-essential libibverbs-dev ca-certificates \
curl iproute2 libsm6 libxext6 kmod ccache libnuma-dev libssl-dev flex bison libgtk-3-dev libpango1.0-dev software-properties-common \
libsoup2.4-dev libnice-dev libopus-dev libvpx-dev libx264-dev libsrtp2-dev libglib2.0-dev libdrm-dev libjpeg-dev libpng-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/* && git lfs install

RUN add-apt-repository -y ppa:ubuntuhandbook1/ffmpeg8 && apt-get update && apt-get install -y ffmpeg

RUN curl -fsSL -v -o /app/miniconda.sh -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh"
RUN chmod +x /app/miniconda.sh && \
bash /app/miniconda.sh -b -p /app/miniconda && \
rm /app/miniconda.sh && \
/app/miniconda/bin/conda install python=3.11 -y && \
/app/miniconda/bin/conda clean -ya
ENV PATH="/app/miniconda/bin:$PATH"

RUN pip install --no-cache-dir packaging ninja cmake scikit-build-core uv meson ruff pre-commit fastapi uvicorn requests -U

RUN pip install torch==2.11.0 torchvision==0.26.0 torchaudio==2.11.0 --index-url https://download.pytorch.org/whl/cu130

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

PyTorch, torchvision, and torchaudio are extremely large packages. Installing them without --no-cache-dir causes pip to cache the downloaded wheels in /root/.cache/pip, which unnecessarily doubles the required disk space and significantly increases the final Docker image size. The same applies to vllm and sglang-kernel on lines 31 and 33.

RUN pip install --no-cache-dir torch==2.11.0 torchvision==0.26.0 torchaudio==2.11.0 --index-url https://download.pytorch.org/whl/cu130


RUN pip install vllm==0.24.0

RUN pip install sglang-kernel==0.4.4

RUN pip install --no-cache-dir diffusers transformers tokenizers accelerate safetensors opencv-python numpy

RUN pip install --no-cache-dir imageio imageio-ffmpeg einops loguru qtorch ftfy av decord matplotlib peft

RUN pip install --no-cache-dir torchao torchcodec modelscope Pillow omegaconf librosa scipy debugpy

RUN pip install --no-cache-dir jsonschema pymongo mooncake-transfer-engine tos zmq graphviz pybind11

RUN pip install --no-cache-dir bson aio-pika PyJWT asyncpg>=0.27.0 aioboto3>=12.0.0 alibabacloud_dypnsapi20170525==1.2.2 redis==6.4.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Installing the standalone bson package from PyPI alongside pymongo will cause a name clash and overwrite pymongo's internal bson module, leading to runtime import errors (e.g., AttributeError when using pymongo). Since pymongo already includes its own bson implementation, you should remove bson from this pip install command.

RUN pip install --no-cache-dir aio-pika PyJWT asyncpg>=0.27.0 aioboto3>=12.0.0 alibabacloud_dypnsapi20170525==1.2.2 redis==6.4.0


RUN pip install --no-cache-dir future easydict termcolor

RUN pip install --no-cache-dir -U setuptools wheel

RUN pip list

# FA2 Whl: https://github.com/alkemiik-coder/FlashAttention-2.8.3-Custom-Linux-Wheels
RUN pip install --no-cache-dir https://github.com/alkemiik-coder/FlashAttention-2.8.3-Custom-Linux-Wheels/releases/download/FA.2.8.3-custom-linux-wheels-x86_64/flash_attn-2.8.3+cu130torch2.11cxx11abiTRUEfullsm80sm90sm100sm120nvcc130-cp311-cp311-linux_x86_64.whl

# FA3 Whl: https://github.com/windreamer/flash-attention3-wheels
RUN pip install --no-cache-dir https://github.com/windreamer/flash-attention3-wheels/releases/download/2026.05.11-5e0e3b1/flash_attn_3-3.0.0%2B20260511.cu130torch2110cxx11abitrue.ab6632-cp39-abi3-linux_x86_64.whl

# FA4 build from source: https://github.com/Dao-AILab/flash-attention
RUN git clone https://github.com/Dao-AILab/flash-attention.git --recursive && cd flash-attention && pip install -e "flash_attn/cute[dev,cu13]"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Installing flash-attention in editable mode (-e) prevents you from deleting the cloned repository, which leaves a large amount of unnecessary source files in the Docker image. Since this is a production/runtime image, you should install it normally and clean up the cloned repository to reduce the image size.

RUN git clone https://github.com/Dao-AILab/flash-attention.git --recursive && \n    cd flash-attention && \n    pip install --no-cache-dir "flash_attn/cute[dev,cu13]" && \n    cd .. && \n    rm -rf flash-attention


RUN git clone https://github.com/ModelTC/SageAttention.git --depth 1

RUN cd SageAttention && \
CUDA_ARCHITECTURES="8.0,8.6,8.9,9.0,12.0" \
EXT_PARALLEL=4 \
NVCC_APPEND_FLAGS="--threads 8" \
MAX_JOBS=32 \
pip install --no-cache-dir --no-build-isolation -v -e .
Comment on lines +60 to +67

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Installing SageAttention in editable mode (-e) prevents cleaning up the cloned repository. Installing it normally and removing the cloned directory will significantly reduce the Docker image size.

RUN git clone https://github.com/ModelTC/SageAttention.git --depth 1 && \n    cd SageAttention && \n    CUDA_ARCHITECTURES="8.0,8.6,8.9,9.0,12.0" \n    EXT_PARALLEL=4 \n    NVCC_APPEND_FLAGS="--threads 8" \n    MAX_JOBS=32 \n    pip install --no-cache-dir --no-build-isolation -v . && \n    cd .. && \n    rm -rf SageAttention


RUN git clone https://github.com/ModelTC/SageAttention-1104.git --depth 1

RUN cd SageAttention-1104/sageattention3_blackwell && python setup.py install && rm -rf build
Comment on lines +69 to +71

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The cloned SageAttention-1104 repository is not cleaned up after installation, which unnecessarily increases the Docker image size. You should remove the directory at the end of the RUN instruction.

RUN git clone https://github.com/ModelTC/SageAttention-1104.git --depth 1 && \n    cd SageAttention-1104/sageattention3_blackwell && \n    python setup.py install && \n    cd /app && \n    rm -rf SageAttention-1104


RUN git clone https://github.com/SandAI-org/MagiAttention.git --recursive

RUN cd MagiAttention && MAGI_ATTENTION_BUILD_COMPUTE_CAPABILITY="90,100" pip install --no-cache-dir --no-build-isolation -v -e .
Comment on lines +73 to +75

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Installing MagiAttention in editable mode (-e) prevents cleaning up the cloned repository. Installing it normally and removing the cloned directory will significantly reduce the Docker image size.

RUN git clone https://github.com/SandAI-org/MagiAttention.git --recursive && \n    cd MagiAttention && \n    MAGI_ATTENTION_BUILD_COMPUTE_CAPABILITY="90,100" pip install --no-cache-dir --no-build-isolation -v . && \n    cd .. && \n    rm -rf MagiAttention


COPY lightx2v_kernel /app/lightx2v_kernel

RUN git clone https://github.com/NVIDIA/cutlass.git --depth 1 && cd /app/lightx2v_kernel && MAX_JOBS=32 && CMAKE_BUILD_PARALLEL_LEVEL=4 \
uv build --wheel \
-Cbuild-dir=build . \
-Ccmake.define.CUTLASS_PATH=/app/cutlass \
--verbose \
--color=always \
--no-build-isolation \
&& pip install dist/*whl --force-reinstall --no-deps \
&& rm -rf /app/lightx2v_kernel && rm -rf /app/cutlass
Comment on lines +79 to +87

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The environment variable MAX_JOBS=32 is separated from the uv build command by &&, which means it is treated as a separate shell command and will not be exported to the environment of uv build. To ensure MAX_JOBS is correctly passed to the build process, it should directly prefix the command or be exported. Also, adding --no-cache-dir to the pip install command is recommended to avoid caching the built wheel.

RUN git clone https://github.com/NVIDIA/cutlass.git --depth 1 && cd /app/lightx2v_kernel && \n    MAX_JOBS=32 CMAKE_BUILD_PARALLEL_LEVEL=4 uv build --wheel \n        -Cbuild-dir=build . \n        -Ccmake.define.CUTLASS_PATH=/app/cutlass \n        --verbose \n        --color=always \n        --no-build-isolation \n    && pip install --no-cache-dir dist/*whl --force-reinstall --no-deps \n    && rm -rf /app/lightx2v_kernel /app/cutlass


RUN git clone --depth 1 https://github.com/linux-rdma/rdma-core.git && \
cd rdma-core/ && \
mkdir build-ibv57 && \
cd build-ibv57 && \
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DNO_MAN_PAGES=1 && \
make -j"$(nproc)" && \
make install && \
ldconfig
Comment on lines +89 to +96

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The cloned rdma-core repository and its build directory are not cleaned up after installation, which unnecessarily increases the Docker image size. You should remove the rdma-core directory at the end of the RUN instruction.

RUN git clone --depth 1 https://github.com/linux-rdma/rdma-core.git && \n    cd rdma-core/ && \n    mkdir build-ibv57 && \n    cd build-ibv57 && \n    cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DNO_MAN_PAGES=1 && \n    make -j"$(nproc)" && \n    make install && \n    ldconfig && \n    cd /app && \n    rm -rf rdma-core


# for base docker
RUN git clone https://github.com/ModelTC/q8_kernels.git --depth 1
RUN cd q8_kernels && git submodule init && git submodule update && python setup.py install && rm -rf build
Comment on lines +99 to +100

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The cloned q8_kernels repository is not cleaned up after installation, which unnecessarily increases the Docker image size. You should remove the directory at the end of the RUN instruction.

RUN git clone https://github.com/ModelTC/q8_kernels.git --depth 1 && \n    cd q8_kernels && \n    git submodule init && \n    git submodule update && \n    python setup.py install && \n    cd .. && \n    rm -rf q8_kernels


RUN git clone https://github.com/ModelTC/SpargeAttn.git --depth 1
RUN cd SpargeAttn && TORCH_CUDA_ARCH_LIST="8.0;8.6;8.9;9.0" pip install --no-cache-dir --no-build-isolation -v -e .
Comment on lines +102 to +103

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Installing SpargeAttn in editable mode (-e) prevents cleaning up the cloned repository. Installing it normally and removing the cloned directory will significantly reduce the Docker image size.

RUN git clone https://github.com/ModelTC/SpargeAttn.git --depth 1 && \n    cd SpargeAttn && \n    TORCH_CUDA_ARCH_LIST="8.0;8.6;8.9;9.0" pip install --no-cache-dir --no-build-isolation -v . && \n    cd .. && \n    rm -rf SpargeAttn


# for 5090 docker
# RUN git clone https://github.com/ModelTC/LTX-Video-Q8-Kernels.git --depth 1
# RUN cd LTX-Video-Q8-Kernels && git submodule init && git submodule update && python setup.py install && rm -rf build

# RUN git clone https://github.com/ModelTC/SpargeAttn.git --depth 1
# RUN cd SpargeAttn && TORCH_CUDA_ARCH_LIST="12.0" pip install --no-cache-dir --no-build-isolation -v -e .

WORKDIR /workspace
6 changes: 3 additions & 3 deletions dockerfiles/Dockerfile_cu130_ros2_jazzy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM lightx2v/lightx2v:26062001-cu130 AS base
# ubuntu 24.04 python 3.12 torch 2.11 cuda 13.0
FROM lightx2v/lightx2v:26070401-cu130 AS base
# ubuntu 24.04 python 3.11 torch 2.11 cuda 13.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The base image lightx2v/lightx2v:26070401-cu130 is built from Dockerfile_cu130, which uses Python 3.12 (as seen in its base image pytorch/pytorch:2.11.0-cuda13.0-cudnn9-devel and its flash_attn wheel). Changing this comment to python 3.11 is incorrect and misleading.

# ubuntu 24.04 python 3.12 torch 2.11 cuda 13.0


RUN apt update && apt install locales
RUN locale-gen en_US en_US.UTF-8
Expand All @@ -22,7 +22,7 @@ RUN apt update --fix-missing && apt install -y ros-dev-tools

RUN pip uninstall setuptools-scm
RUN pip install catkin_pkg empy pyqt5-sip PyQt5 sip==6.15.3 setuptools==79.0.1
RUN pip install hydra-core==1.2.0 robosuite==1.4.0 bddl==1.0.1 coverage==7.6.1 gym==0.25.2 mujoco==3.9.0 future easydict termcolor
RUN pip install hydra-core==1.2.0 robosuite==1.4.0 bddl==1.0.1 coverage==7.6.1 gym==0.25.2 mujoco==3.9.0


# Install ROS2 Jazzy (Install from apt on Ubuntu 24.04)
Expand Down
Loading