Skip to content

[AMD] install Transformer Engine from prebuilt wheel on rocm720#1692

Open
XinyuJiangCMU wants to merge 1 commit into
radixark:mainfrom
XinyuJiangCMU:pr/rocm72-te-wheel
Open

[AMD] install Transformer Engine from prebuilt wheel on rocm720#1692
XinyuJiangCMU wants to merge 1 commit into
radixark:mainfrom
XinyuJiangCMU:pr/rocm72-te-wheel

Conversation

@XinyuJiangCMU

@XinyuJiangCMU XinyuJiangCMU commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Co-authored-with: @JessicaJiang-123

Install Transformer Engine from a prebuilt wheel on rocm720-mi35x instead of building from source, gated on a new TE_USE_WHEEL arg (docker/build.py sets it to 1 for that variant; other variants keep the source build). Cuts the rocm720 image build from ~30 min to ~2 min.

The wheel (transformer_engine-2.14.0.dev0, built by build_te_wheel.py, in the miles-wheels-rocm rocm720-gfx950-v0.5.14 release) comes from the fp8 fork XinyuJiangCMU/TransformerEngine @ miles-dev (based on ROCm/TransformerEngine 9c19ec7, "Add gfx1250 support to CK tile group GEMM", 2026-06-21); its Triton blockwise FP8 path for gfx950 (XinyuJiangCMU/TransformerEngine#4) isn't in the stock v2.8_rocm source. Verified on MI355X: full build succeeds, Float8BlockScaling Linear forward runs on GPU.

Gate the TE install on TE_USE_WHEEL, which docker/build.py sets for the
rocm720-mi35x variant: install the prebuilt fp8 blockwise wheel from the
miles-wheels-rocm release instead of building from source. Other variants
keep the source build via the else branch.

Co-authored-by: Xinyu Jiang <xinyuj2@andrew.cmu.edu>
Co-authored-by: Zhiyao Jiang <jessicajiang324@gmail.com>

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces a conditional build argument TE_USE_WHEEL in docker/Dockerfile.rocm to allow installing Transformer Engine from a prebuilt wheel instead of building it from source, and enables this flag in docker/build.py for a specific ROCm build configuration. Feedback was provided regarding the use of a wildcard glob (transformer_engine-*.whl) with pip install, which could cause build failures if multiple wheels are present in the directory; using --find-links was suggested as a more robust alternative.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread docker/Dockerfile.rocm
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; \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant