Skip to content
Closed
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
20 changes: 11 additions & 9 deletions docker/Dockerfile.rocm
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,23 @@ RUN git clone --depth 1 --branch ${RCCL_TESTS_BRANCH} ${RCCL_TESTS_REPO} /tmp/ro
rm -rf /tmp/rocm-systems

# ====================================== Python dependencies ====================================
# Install Transformer Engine from the requested branch. NVTE_FUSED_ATTN=0 is scoped to
# this build step only (skip the extra fused-attn kernel matrix rebuild), not the runtime env.
RUN pip uninstall -y transformer-engine transformer_engine transformer_engine_torch || true
RUN rm -rf /root/TransformerEngine && \
git clone --recursive --branch ${TRANSFORMER_ENGINE_BRANCH} ${TRANSFORMER_ENGINE_REPO} /root/TransformerEngine && \
cd /root/TransformerEngine && \
NVTE_FUSED_ATTN=0 pip install . --no-build-isolation -v

RUN pip install git+https://github.com/ISEEKYAN/mbridge.git@89eb10887887bc74853f89a4de258c0702932a1c --no-deps

# Prebuilt wheels from the miles-wheels-rocm release; flash-attn installs here, gateway below.
# Prebuilt wheels from the miles-wheels-rocm release (Transformer Engine, flash-attn; gateway below).
RUN mkdir -p /tmp/wheels && \
curl -fsSL "https://api.github.com/repos/${WHEELS_REPO}/releases/tags/${WHEELS_TAG_ROCM}" \
| python3 -c "import sys,json,subprocess,os; w='/tmp/wheels'; [subprocess.run(['curl','-fsSL','-o',os.path.join(w,a['name']),a['browser_download_url']],check=True) for a in json.load(sys.stdin).get('assets',[]) if a['name'].endswith(('.whl','.tar.gz'))]" && \
ls -lh /tmp/wheels/
# Transformer Engine: prebuilt fp8 wheel
ARG TE_USE_WHEEL=0
RUN pip uninstall -y transformer-engine transformer_engine transformer_engine_torch || true; \
if [ "${TE_USE_WHEEL}" = "1" ]; then \
pip install /tmp/wheels/transformer_engine-*.whl; \

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

Using a wildcard glob like transformer_engine-*.whl with pip install can cause the build to fail if the /tmp/wheels directory contains multiple wheels (for example, wheels built for different Python versions or architectures). In such cases, pip will attempt to install all matching wheels, and will fail with an error when encountering an incompatible wheel.

To make this more robust, use --find-links to let pip automatically select and install only the wheel that is compatible with the current Python environment.

      pip install --find-links=/tmp/wheels transformer_engine; \

else \
rm -rf /root/TransformerEngine && \
git clone --recursive --branch ${TRANSFORMER_ENGINE_BRANCH} ${TRANSFORMER_ENGINE_REPO} /root/TransformerEngine && \
cd /root/TransformerEngine && NVTE_FUSED_ATTN=0 pip install . --no-build-isolation -v; \
fi
RUN pip install /tmp/wheels/flash_attn-*.whl

RUN pip install flash-linear-attention==0.4.2
Expand Down
1 change: 1 addition & 0 deletions docker/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"GPU_ARCH": "gfx950",
"SGLANG_IMAGE_TAG": "v0.5.10-rocm720-mi35x",
"APPLY_ROCR_VMMFIX": "1",
"TE_USE_WHEEL": "1",
},
},
}
Expand Down
Loading