From 549e9ecbe5437ce5ec7487618544b50b17934aa8 Mon Sep 17 00:00:00 2001 From: vadseshu Date: Thu, 16 Apr 2026 13:10:31 +0000 Subject: [PATCH 1/3] Added gfx950a to pyt_mochi_inference.ubuntu dockerfile to enable fa --- docker/pyt_mochi_inference.ubuntu.amd.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/pyt_mochi_inference.ubuntu.amd.Dockerfile b/docker/pyt_mochi_inference.ubuntu.amd.Dockerfile index 4cbbd1ef..fb9426f2 100644 --- a/docker/pyt_mochi_inference.ubuntu.amd.Dockerfile +++ b/docker/pyt_mochi_inference.ubuntu.amd.Dockerfile @@ -33,7 +33,7 @@ RUN mkdir -p $WORKSPACE_DIR WORKDIR $WORKSPACE_DIR ARG FA_REPO="https://github.com/Dao-AILab/flash-attention.git" -ARG PYTORCH_ROCM_ARCH=gfx90a;gfx942;gfx1100;gfx1101;gfx1200;gfx1201 +ARG PYTORCH_ROCM_ARCH=gfx950;gfx90a;gfx942;gfx1100;gfx1101;gfx1200;gfx1201 RUN git clone ${FA_REPO} RUN cd flash-attention \ && git submodule update --init \ From 263425bc0bec79d9c7a62dee0cb7a7c9f1b7a33e Mon Sep 17 00:00:00 2001 From: vadseshu Date: Wed, 22 Apr 2026 12:05:22 +0000 Subject: [PATCH 2/3] steps are updated for FA for wan2.1 --- ...pyt_wan2.1_inference.ubuntu.amd.Dockerfile | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/docker/pyt_wan2.1_inference.ubuntu.amd.Dockerfile b/docker/pyt_wan2.1_inference.ubuntu.amd.Dockerfile index 55e0504e..6a2dbb69 100644 --- a/docker/pyt_wan2.1_inference.ubuntu.amd.Dockerfile +++ b/docker/pyt_wan2.1_inference.ubuntu.amd.Dockerfile @@ -64,21 +64,29 @@ RUN apt-get install -y locales RUN locale-gen en_US.UTF-8 # Install flash attention -ARG BUILD_FA="1" -ARG FA_BRANCH="v3.0.0.r1-cktile" -ARG FA_REPO="https://github.com/ROCm/flash-attention.git" -RUN if [ "$BUILD_FA" = "1" ]; then \ - cd ${WORKSPACE_DIR} \ - && pip uninstall -y flash-attention \ - && rm -rf flash-attention \ - && git clone ${FA_REPO} \ - && cd flash-attention \ - && git checkout ${FA_BRANCH} \ - && git submodule update --init \ - && GPU_ARCHS=${HIP_ARCHITECTURES} python3 setup.py bdist_wheel --dist-dir=dist \ - && pip install dist/*.whl \ - && python -c "import flash_attn; print(f'Flash Attention version == {flash_attn.__version__}')"; \ - fi +#ARG BUILD_FA="1" +#ARG FA_BRANCH="v3.0.0.r1-cktile" +#ARG FA_REPO="https://github.com/ROCm/flash-attention.git" +#RUN if [ "$BUILD_FA" = "1" ]; then \ +# cd ${WORKSPACE_DIR} \ +# && pip uninstall -y flash-attention \ +# && rm -rf flash-attention \ +# && git clone ${FA_REPO} \ +# && cd flash-attention \ +# && git checkout ${FA_BRANCH} \ +# && git submodule update --init \ +# && GPU_ARCHS=${HIP_ARCHITECTURES} python3 setup.py bdist_wheel --dist-dir=dist \ +# && pip install dist/*.whl \ +# && python -c "import flash_attn; print(f'Flash Attention version == {flash_attn.__version__}')"; \ +# fi +# install flash attention +ENV FLASH_ATTENTION_TRITON_AMD_ENABLE="TRUE" + +RUN git clone https://github.com/ROCm/flash-attention.git &&\ + cd flash-attention &&\ + python setup.py install + + #Download wan2.1 source code RUN cd $WORKSPACE_DIR \ From 9c8c16fe6facadd8ae5346c2b4de952ddd3bd235 Mon Sep 17 00:00:00 2001 From: vadseshu <120715651+vadseshu@users.noreply.github.com> Date: Wed, 24 Jun 2026 17:17:41 +0530 Subject: [PATCH 3/3] Update pyt_wan2.1_inference.ubuntu.amd.Dockerfile 1. Replace deprecated apt-key usage by securely adding the ROCm GPG key to /etc/apt/keyrings, configuring the ROCm APT repository with proper signing, and updating package lists. 2. Comment out the fixed Flash Attention branch argument to allow flexibility in selecting or defaulting the repository version during build. --- ...pyt_wan2.1_inference.ubuntu.amd.Dockerfile | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/docker/pyt_wan2.1_inference.ubuntu.amd.Dockerfile b/docker/pyt_wan2.1_inference.ubuntu.amd.Dockerfile index 6a2dbb69..a6c19e87 100644 --- a/docker/pyt_wan2.1_inference.ubuntu.amd.Dockerfile +++ b/docker/pyt_wan2.1_inference.ubuntu.amd.Dockerfile @@ -54,7 +54,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN pip install "xfuser>=0.4.1" # ROCm gpg key -RUN wget -q -O - http://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add - +#RUN wget -q -O - http://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add - +RUN apt-get update && apt-get install -y --no-install-recommends wget gnupg ca-certificates \ + && mkdir -p /etc/apt/keyrings \ + && wget -qO- https://repo.radeon.com/rocm/rocm.gpg.key \ + | gpg --dearmor --yes -o /etc/apt/keyrings/rocm.gpg \ + && . /etc/os-release \ + && echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/latest ${VERSION_CODENAME} main" \ + > /etc/apt/sources.list.d/rocm.list \ + && printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600\n' \ + > /etc/apt/preferences.d/rocm-pin-600 \ + && apt-get update RUN apt update && apt install -y \ unzip \ jq @@ -62,31 +72,22 @@ RUN apt update && apt install -y \ # add locale en_US.UTF-8 RUN apt-get install -y locales RUN locale-gen en_US.UTF-8 - # Install flash attention -#ARG BUILD_FA="1" +ARG BUILD_FA="1" #ARG FA_BRANCH="v3.0.0.r1-cktile" -#ARG FA_REPO="https://github.com/ROCm/flash-attention.git" -#RUN if [ "$BUILD_FA" = "1" ]; then \ -# cd ${WORKSPACE_DIR} \ -# && pip uninstall -y flash-attention \ -# && rm -rf flash-attention \ -# && git clone ${FA_REPO} \ -# && cd flash-attention \ -# && git checkout ${FA_BRANCH} \ -# && git submodule update --init \ -# && GPU_ARCHS=${HIP_ARCHITECTURES} python3 setup.py bdist_wheel --dist-dir=dist \ -# && pip install dist/*.whl \ -# && python -c "import flash_attn; print(f'Flash Attention version == {flash_attn.__version__}')"; \ -# fi -# install flash attention -ENV FLASH_ATTENTION_TRITON_AMD_ENABLE="TRUE" - -RUN git clone https://github.com/ROCm/flash-attention.git &&\ - cd flash-attention &&\ - python setup.py install - - +ARG FA_REPO="https://github.com/ROCm/flash-attention.git" +RUN if [ "$BUILD_FA" = "1" ]; then \ + cd ${WORKSPACE_DIR} \ + && pip uninstall -y flash-attention \ + && rm -rf flash-attention \ + && git clone ${FA_REPO} \ + && cd flash-attention \ + && git checkout ${FA_BRANCH} \ + && git submodule update --init \ + && GPU_ARCHS=${HIP_ARCHITECTURES} python3 setup.py bdist_wheel --dist-dir=dist \ + && pip install dist/*.whl \ + && python -c "import flash_attn; print(f'Flash Attention version == {flash_attn.__version__}')"; \ + fi #Download wan2.1 source code RUN cd $WORKSPACE_DIR \ @@ -97,4 +98,3 @@ RUN cd $WORKSPACE_DIR \ # Display installed packages for verification RUN pip list -