Repository navigation
Dockerfile - Add ROCm 10.1 dockerfile with MI455X (gfx1250) support #867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Nguyen Vuong (normanvuong)
wants to merge
8
commits into
microsoft:main
Choose a base branch
from
normanvuong:nguyenvuong/rocm_10.0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f30b558
Document ROCm image validation and ROCm 10 migration requirements
3e60284
Scaffold ROCm 10 on AMD Ubuntu 26.04 with packaged RCCL
8f1de72
experimental rocm10 support
a7ef18c
Add rocm10 + mi455x sb config
8590af6
Address review: inline framework build, split benchmarks, drop config
767c91d
Address review: build TE for AMDGPU_TARGETS, correct SDK path docs
95f1559
Dockerfile - Move experimental ROCm 10 image to ROCm 10.1
69da834
Docs - Require NUMA auto-balancing disabled on AMD GPU hosts
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,332 @@ | ||
| ARG BASE_IMAGE=rocm/pytorch:rocm10.1.0_ubuntu26.04_py3.14_pytorch_release_2.13.0@sha256:1d3ebef7da1df35f0c103ed038521933ebaeaf6f8c8d710168d8c294efdc59d9 | ||
| FROM ${BASE_IMAGE} | ||
|
|
||
| LABEL maintainer="SuperBench" | ||
| SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"] | ||
|
|
||
| # Experimental scaffold: preserve AMD's matched Python 3.14 / PyTorch 2.13 stack. | ||
| # SDK packages include all devices; this argument selects the targets of locally | ||
| # built kernels (SuperBench benchmarks, RCCL and TransformerEngine). | ||
| ARG AMDGPU_TARGETS="gfx942 gfx950 gfx1250" | ||
| ARG NUM_MAKE_JOBS=64 | ||
| ARG ROCM_VERSION=10.1.0 | ||
| # rocm-systems revision selected by TheRock's therock-10.1 release. | ||
| ARG ROCM_SYSTEMS_COMMIT=7da43026e4f2ef7600433c38c820732f7a205d22 | ||
| # Retain the source override for MI455X (gfx1250) RCCL fixes, including | ||
| # ROCm/rocm-systems#12051 (GPU->NIC distance and GDR on gfx1250 | ||
| # MLOPart partitions) and the gfx1250 symmetric-memory/VMM teardown fixes. | ||
| # RCCL and RCCL-tests are built from this revision into RCCL_SOURCE_PREFIX. | ||
| # Pass an empty value to keep the packaged RCCL with release-matched RCCL-tests. | ||
| ARG RCCL_SOURCE_COMMIT=2a0c58ec63ea22487ea65458b68b92426119eb11 | ||
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive \ | ||
| AMDGPU_TARGETS="${AMDGPU_TARGETS}" \ | ||
| CMAKE_BUILD_PARALLEL_LEVEL="${NUM_MAKE_JOBS}" \ | ||
| CMAKE_POLICY_VERSION_MINIMUM=3.5 \ | ||
| MPI_HOME=/usr/local/mpi \ | ||
| RCCL_SOURCE_PREFIX=/opt/rccl \ | ||
| EXTRAS_PATH=/opt/rocm/extras-10 \ | ||
| SB_HOME=/opt/superbench \ | ||
| SB_MICRO_PATH=/opt/superbench \ | ||
| ANSIBLE_DEPRECATION_WARNINGS=FALSE \ | ||
| ANSIBLE_COLLECTIONS_PATH=/usr/share/ansible/collections | ||
|
|
||
| # The 10.1 base runs the system /usr/bin/python3 (the 10.0 base used /opt/venv). | ||
| # TE's AOTriton build creates a venv from that interpreter and needs liblzma. | ||
| RUN apt-get update && \ | ||
| apt-get install -y --no-install-recommends \ | ||
| autoconf automake bc build-essential ca-certificates cmake curl \ | ||
| dmidecode flex gfortran git gnupg iproute2 jq libaio-dev \ | ||
| libatomic1 libboost-program-options-dev libcap2 libcurl4-openssl-dev \ | ||
| libdrm-dev libibumad-dev libibverbs-dev liblzma-dev libnuma-dev libpci-dev libquadmath0 librdmacm-dev \ | ||
| libssl-dev libtinfo6 libtool lshw net-tools ninja-build numactl \ | ||
| openssh-client openssh-server pciutils pkg-config python3-dev python3-venv rsync sudo \ | ||
| util-linux wget && \ | ||
| pkg-config --exists liblzma && \ | ||
| /usr/bin/python3 -m venv /tmp/sb-aotriton-venv-check && \ | ||
| /tmp/sb-aotriton-venv-check/bin/python -m pip --version && \ | ||
| rm -rf /tmp/sb-aotriton-venv-check && \ | ||
| apt-get clean | ||
|
|
||
| # Install the Docker CLI client only. | ||
| ARG DOCKER_VERSION=29.6.2 | ||
| RUN curl -fsSL "https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz" -o /tmp/docker.tgz && \ | ||
| tar --extract --file /tmp/docker.tgz --strip-components 1 --directory /usr/local/bin/ docker/docker && \ | ||
| rm /tmp/docker.tgz | ||
|
|
||
| # Update system config. | ||
| RUN mkdir -p /root/.ssh /var/run/sshd && \ | ||
| touch /root/.ssh/authorized_keys && \ | ||
| sed -i 's/[# ]*PermitRootLogin prohibit-password/PermitRootLogin yes/; s/[# ]*PermitUserEnvironment no/PermitUserEnvironment yes/' /etc/ssh/sshd_config && \ | ||
| printf '%s\n' '* soft nofile 1048576' '* hard nofile 1048576' >> /etc/security/limits.conf | ||
|
|
||
| # Match the Ubuntu 26.04 Azure HPC userspace stack; never install host drivers here. | ||
| # TODO: Add a selectable alternative networking stack after its qualification. | ||
| ARG DOCA_VERSION=3.4.0 | ||
| ARG DOCA_PACKAGE_VERSION=3.4.0-085000 | ||
| ARG DOCA_OPENMPI_VERSION=5.0.10rc2.2605121430-1.b99be7132e | ||
| ARG DOCA_BUNDLE_SHA256=60789bbbfc9b283a87a64589a0d4bd5d08d1b746494c24ce05e10bbd694de6bb | ||
| # Use NVIDIA's signed local repository bundle: the online repository's TLS EOF | ||
| # handling fails with Ubuntu 26.04 APT. Do not disable certificate/signature checks. | ||
| RUN curl -fsSL "https://content.mellanox.com/DOCA/DOCA_v${DOCA_VERSION}/host/doca-host_${DOCA_PACKAGE_VERSION}-26.04-ubuntu2604_amd64.deb" -o /tmp/doca-host.deb && \ | ||
| printf '%s %s\n' "${DOCA_BUNDLE_SHA256}" /tmp/doca-host.deb | sha256sum --check --strict && \ | ||
| dpkg -i /tmp/doca-host.deb && \ | ||
| apt-get update && \ | ||
| apt-get install -y --no-install-recommends \ | ||
| "doca-ofed-userspace=${DOCA_PACKAGE_VERSION}" "openmpi=${DOCA_OPENMPI_VERSION}" && \ | ||
| mpi_prefix=$(dpkg-query -L openmpi | sed -n 's#/bin/mpirun$##p') && \ | ||
| test -n "${mpi_prefix}" && \ | ||
| test -x "${mpi_prefix}/bin/mpicc" && \ | ||
| ln -s "${mpi_prefix}" "${MPI_HOME}" && \ | ||
| printf '%s\n' "${MPI_HOME}/lib" > /etc/ld.so.conf.d/superbench-mpi.conf && \ | ||
| ldconfig && \ | ||
| "${MPI_HOME}/bin/mpirun" --version && \ | ||
| apt-get purge -y doca-host && \ | ||
| rm /tmp/doca-host.deb && \ | ||
| apt-get update && apt-get clean | ||
|
|
||
| # Add development files to the base's SDK and use AMD's path discovery directly. | ||
| # The SDK's prebuilt RCCL remains installed; RCCL_SOURCE_COMMIT may add an override. | ||
| RUN python3 -m pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ \ | ||
| "rocm[devel,libraries,device-all]==${ROCM_VERSION}" && \ | ||
| rocm-sdk init && \ | ||
| ROCM_PATH="$(rocm-sdk path --root)" && \ | ||
| test -r "${ROCM_PATH}/.info/version" && \ | ||
| test -r "${ROCM_PATH}/lib/librccl.so" && \ | ||
| printf 'export ROCM_PATH=%q\n' "${ROCM_PATH}" > /etc/profile.d/rocm10-env.sh && \ | ||
| printf '%s\n' \ | ||
| 'export ROCM_HOME="${ROCM_PATH}" HIP_PATH="${ROCM_PATH}" RCCL_HOME="${ROCM_PATH}"' \ | ||
| 'export PATH="${EXTRAS_PATH}/bin:${MPI_HOME}/bin:${SB_MICRO_PATH}/bin:${ROCM_PATH}/bin:${PATH}"' \ | ||
| 'export LD_LIBRARY_PATH="${EXTRAS_PATH}/lib:${MPI_HOME}/lib:${ROCM_PATH}/lib:${ROCM_PATH}/lib/llvm/lib:${ROCM_PATH}/lib/host-math/lib:${ROCM_PATH}/lib/rocm_sysdeps/lib"' \ | ||
| >> /etc/profile.d/rocm10-env.sh | ||
|
|
||
| # Resolve the SDK once at build time; shell startup must not reinitialize it. | ||
| ENV BASH_ENV=/etc/profile.d/rocm10-env.sh | ||
| ENTRYPOINT ["/bin/bash", "-e", "-c", "exec \"$@\"", "--"] | ||
| CMD ["/bin/bash"] | ||
|
|
||
| # Register the bundled module until https://github.com/ROCm/TheRock/issues/3054 | ||
| # is fixed (upstream registration: https://github.com/ROCm/TheRock/pull/8424). | ||
| # A relative .pth entry preserves the wrapper's lookup of its matching library. | ||
| RUN python3 -c 'import sysconfig; from pathlib import Path; Path(sysconfig.get_path("purelib"), "amdsmi.pth").write_text("_rocm_sdk_core/share/amd_smi\n")' && \ | ||
| python3 -c 'import amdsmi' | ||
|
|
||
| # Built-in MPI calls exchange host data; RCCL exchanges GPU buffers. The DOCA | ||
| # Open MPI package needs neither a ROCm-aware rebuild nor unused OpenSHMEM. | ||
| ENV SB_ROCM_MEM_BW_BACKEND=transferbench \ | ||
|
normanvuong marked this conversation as resolved.
Resolved
|
||
| USE_HIP_DATATYPE=1 \ | ||
| USE_HIPBLAS_COMPUTETYPE=1 | ||
|
|
||
| # Install RVS through AMD's signed Ubuntu 26.04 repositories. Explicitly select | ||
| # matching ROCm 10.1 native dependencies instead of legacy distro packages. | ||
| ARG RVS_VERSION=1.6.122-708 | ||
| ARG ROCM_APT_VERSION=10.1.0-3 | ||
| RUN install -d -m 0755 /etc/apt/keyrings && \ | ||
| curl -fsSL https://stable.repo.amd.com/rocm/gpg/packages.gpg | \ | ||
| gpg --batch --yes --dearmor -o /etc/apt/keyrings/amdrocm.gpg && \ | ||
| printf '%s\n' 'Types: deb' \ | ||
| 'URIs: https://stable.repo.amd.com/rocm/core/packages/ubuntu2604/' \ | ||
| 'Suites: stable' 'Components: main' 'Architectures: amd64' \ | ||
| 'Signed-By: /etc/apt/keyrings/amdrocm.gpg' > /etc/apt/sources.list.d/amdrocm-core.sources && \ | ||
| printf '%s\n' 'Types: deb' \ | ||
| 'URIs: https://stable.repo.amd.com/rocm/extras/rvs/packages/ubuntu2604/' \ | ||
| 'Suites: stable' 'Components: main' 'Architectures: amd64' \ | ||
| 'Signed-By: /etc/apt/keyrings/amdrocm.gpg' > /etc/apt/sources.list.d/amdrocm-rvs.sources && \ | ||
| apt-get update && \ | ||
| apt-get install -y --no-install-recommends \ | ||
| "amdrocm-runtime=${ROCM_APT_VERSION}" "amdrocm-base=${ROCM_APT_VERSION}" \ | ||
| "amdrocm-amdsmi=${ROCM_APT_VERSION}" "amdrocm-blas=${ROCM_APT_VERSION}" \ | ||
| "amdrocm-rand=${ROCM_APT_VERSION}" "amdrocm-llvm=${ROCM_APT_VERSION}" \ | ||
| "amdrocm10-rvs=${RVS_VERSION}" && \ | ||
| apt-get clean && \ | ||
| test -x "${EXTRAS_PATH}/bin/rvs" && \ | ||
| test -x "${EXTRAS_PATH}/bin/TransferBench" | ||
|
|
||
| WORKDIR ${SB_HOME} | ||
| COPY third_party third_party | ||
|
|
||
| # Build RCCL-tests, and RCCL itself when RCCL_SOURCE_COMMIT is set, from one | ||
| # rocm-systems revision. The source-built library precedes the SDK library on | ||
| # LD_LIBRARY_PATH, which RUNPATH alone cannot override, so soname lookups | ||
| # (including SuperBench's mpirun -x LD_LIBRARY_PATH) resolve the fixed RCCL. | ||
| RUN rccl_architectures=$(printf '%s' "${AMDGPU_TARGETS}" | tr -s '[:space:]' ';' | sed 's/^;//; s/;$//') && \ | ||
| if [ -z "${rccl_architectures}" ]; then \ | ||
| echo 'AMDGPU_TARGETS must contain at least one GPU architecture.' >&2; exit 1; \ | ||
| fi && \ | ||
| if [ -n "${RCCL_SOURCE_COMMIT}" ]; then \ | ||
| rocm_systems_commit="${RCCL_SOURCE_COMMIT}"; rccl_prefix="${RCCL_SOURCE_PREFIX}"; \ | ||
| rccl_projects='projects/rccl projects/rccl-tests'; \ | ||
| else \ | ||
| rocm_systems_commit="${ROCM_SYSTEMS_COMMIT}"; rccl_prefix="${ROCM_PATH}"; \ | ||
| rccl_projects='projects/rccl-tests'; \ | ||
| fi && \ | ||
| git init /tmp/rocm-systems && \ | ||
| git -C /tmp/rocm-systems remote add origin https://github.com/ROCm/rocm-systems.git && \ | ||
| git -C /tmp/rocm-systems sparse-checkout set ${rccl_projects} && \ | ||
| git -C /tmp/rocm-systems fetch --depth 1 --filter=blob:none origin "${rocm_systems_commit}" && \ | ||
| git -C /tmp/rocm-systems checkout --detach FETCH_HEAD && \ | ||
| if [ -n "${RCCL_SOURCE_COMMIT}" ]; then \ | ||
| cmake -S /tmp/rocm-systems/projects/rccl -B /tmp/rccl-build -G Ninja \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_CXX_COMPILER="${ROCM_PATH}/bin/hipcc" \ | ||
| -DCMAKE_PREFIX_PATH="${ROCM_PATH}" \ | ||
| -DROCM_PATH="${ROCM_PATH}" \ | ||
| -DGPU_TARGETS="${rccl_architectures}" \ | ||
| -DBUILD_TESTS=OFF \ | ||
| -DCMAKE_INSTALL_PREFIX="${rccl_prefix}" \ | ||
| -DCMAKE_INSTALL_LIBDIR=lib \ | ||
| -DCMAKE_INSTALL_RPATH="${ROCM_PATH}/lib" && \ | ||
| cmake --build /tmp/rccl-build -j"${NUM_MAKE_JOBS}" && \ | ||
| cmake --install /tmp/rccl-build && \ | ||
| test -r "${rccl_prefix}/lib/librccl.so" && \ | ||
| printf 'export RCCL_HOME=%q\n' "${rccl_prefix}" >> /etc/profile.d/rocm10-env.sh && \ | ||
| printf 'export LD_LIBRARY_PATH=%q:"${LD_LIBRARY_PATH}"\n' "${rccl_prefix}/lib" >> /etc/profile.d/rocm10-env.sh; \ | ||
| fi && \ | ||
| cmake -S /tmp/rocm-systems/projects/rccl-tests -B /tmp/rccl-tests-build \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_PREFIX_PATH="${rccl_prefix};${ROCM_PATH};${MPI_HOME}" \ | ||
| -DROCM_PATH="${ROCM_PATH}" \ | ||
| -DGPU_TARGETS="${rccl_architectures}" \ | ||
| -DUSE_MPI=ON \ | ||
| -DCMAKE_INSTALL_PREFIX="${SB_HOME}" \ | ||
| -DCMAKE_INSTALL_RPATH="${rccl_prefix}/lib;${ROCM_PATH}/lib;${MPI_HOME}/lib" \ | ||
| -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON && \ | ||
| cmake --build /tmp/rccl-tests-build -j"${NUM_MAKE_JOBS}" && \ | ||
| cmake --install /tmp/rccl-tests-build && \ | ||
| rm -rf /tmp/rocm-systems /tmp/rccl-build /tmp/rccl-tests-build && \ | ||
| bash -c 'ldd "${SB_HOME}/bin/all_reduce_perf"' | grep -F "${rccl_prefix}/lib/librccl.so" | ||
|
|
||
| # Do not invoke the legacy ROCm aggregate target: it clones HIP 5.5 samples, | ||
| # rebuilds math libraries, and installs unqualified Megatron/DeepSpeed dependencies. | ||
| RUN test -f third_party/fio/Makefile && \ | ||
| test -f third_party/perftest/autogen.sh && \ | ||
| make -C third_party fio rocm_perftest | ||
|
|
||
| # Extract only matching prebuilt clients and their external GPU kernel packs. | ||
| # The ELFs alone cannot initialize matrices without the blas_test_*.kpack files. | ||
| ARG ROCM_TESTS_SHA256=c6d6afe27474badb88793330278616caf74c40d647ea2d26457352d7dfc0ace8 | ||
| RUN curl -fsSL "https://stable.repo.amd.com/rocm/core/tarball/therock-dist-linux-multiarch-tests-${ROCM_VERSION}.tar.gz" -o /tmp/rocm-tests.tar.gz && \ | ||
| printf '%s %s\n' "${ROCM_TESTS_SHA256}" /tmp/rocm-tests.tar.gz | sha256sum --check --strict && \ | ||
| tar -xzf /tmp/rocm-tests.tar.gz -C "${SB_HOME}" --wildcards --no-wildcards-match-slash \ | ||
| './bin/rocblas-bench' './bin/hipblaslt-bench' './.kpack/blas_test_*.kpack' && \ | ||
| rm /tmp/rocm-tests.tar.gz && \ | ||
| test -x "${SB_HOME}/bin/rocblas-bench" && \ | ||
| test -x "${SB_HOME}/bin/hipblaslt-bench" && \ | ||
| test -s "${SB_HOME}/.kpack/blas_test_gfx942.kpack" && \ | ||
| test -s "${SB_HOME}/.kpack/blas_test_gfx950.kpack" && \ | ||
| test -s "${SB_HOME}/.kpack/blas_test_gfx1250.kpack" | ||
|
|
||
| COPY . . | ||
| # Keep AMD's framework and all-device SDK packages when resolving SuperBench deps. | ||
| # The same constraints protect them while building the frameworks below. | ||
| # The SDK supplies amdsmi via .pth, not a separate distribution; use the torch | ||
| # extra so amdworker does not install a PyPI wrapper that shadows the SDK module. | ||
| # Drop stale setuptools output from the build context before installing. | ||
| RUN rm -rf build *.egg-info && \ | ||
| python3 -m pip freeze | grep -Ei '^(torch|torchvision|torchaudio|triton|apex|rocm|rocm[-_][^=]+)==' > /tmp/rocm10-constraints.txt && \ | ||
| python3 -m pip install -c /tmp/rocm10-constraints.txt '.[torch]' && \ | ||
| python3 -m pip install pytest pytest-timeout vcrpy | ||
|
|
||
| # This TE revision still includes the legacy ROCm SMI header, which the SDK omits. | ||
| # Build that library from the release's rocm-systems revision under /usr/local, | ||
| # separate from the SDK and its AMD SMI. | ||
| RUN git init -q /tmp/rocm-smi-source && \ | ||
| git -C /tmp/rocm-smi-source remote add origin https://github.com/ROCm/rocm-systems.git && \ | ||
| git -C /tmp/rocm-smi-source sparse-checkout set projects/rocm-smi-lib && \ | ||
| git -C /tmp/rocm-smi-source fetch -q --depth 1 --filter=blob:none origin "${ROCM_SYSTEMS_COMMIT}" && \ | ||
| git -C /tmp/rocm-smi-source checkout -q --detach FETCH_HEAD && \ | ||
| cmake -S /tmp/rocm-smi-source/projects/rocm-smi-lib -B /tmp/rocm-smi-build -G Ninja \ | ||
| -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \ | ||
| -DCMAKE_INSTALL_LIBDIR=lib -DROCM_SMI_DISABLE=OFF -DBUILD_TESTS=OFF && \ | ||
| cmake --build /tmp/rocm-smi-build -j"${NUM_MAKE_JOBS}" && \ | ||
| cmake --install /tmp/rocm-smi-build && \ | ||
| printf '%s\n' /usr/local/lib > /etc/ld.so.conf.d/superbench-rocm-smi.conf && \ | ||
| ldconfig && \ | ||
| test -r /usr/local/include/rocm_smi/rocm_smi.h && \ | ||
| printf '#include <rocm_smi/rocm_smi.h>\n' | \ | ||
| "${ROCM_PATH}/lib/llvm/bin/clang++" -x c++ -fsyntax-only - && \ | ||
| python3 -c 'import ctypes; ctypes.CDLL("/usr/local/lib/librocm_smi64.so").rsmi_init' && \ | ||
| rm -rf /tmp/rocm-smi-source /tmp/rocm-smi-build | ||
|
|
||
| # Build TransformerEngine, AITER and Megatron-LM from pinned sources against the | ||
| # base's PyTorch, Triton and SDK, without build isolation or dependency resolution. | ||
| # TE v2.15_rocm, AITER snapshot 2026-09-30, Megatron Core v0.19.2. The TE 2.18-dev | ||
| # alternative cannot compile its BF16 small-sequence attention for gfx1250. | ||
| # TE uses its own pinned AITER/CK. CK attention excludes gfx1250 and AOTriton ships | ||
| # only gfx942/gfx950 images, so gfx1250 gets TE's common kernels. | ||
| ARG TE_COMMIT=e7835ed1b134f56e58c575fba2455471064cab9b | ||
| ARG AITER_COMMIT=89a47b84ac4b576339a50047e290c383c2377389 | ||
| ARG MEGATRON_COMMIT=4b4acac9a1d28ea6829c8d4f566d75698a21249d | ||
| ENV SB_ROCM10_FRAMEWORK_ROOT=/opt/rocm10-frameworks \ | ||
| SB_MEGATRON_PATH=/opt/rocm10-frameworks/Megatron-LM \ | ||
| AITER_USE_SYSTEM_TRITON=1 \ | ||
| TRITON_F32_DEFAULT=ieee \ | ||
| MAX_JOBS=16 \ | ||
| CUDA_DEVICE_MAX_CONNECTIONS=1 \ | ||
| NVTE_FLASH_ATTN=0 \ | ||
| NVTE_FUSED_ATTN=1 \ | ||
| NVTE_FUSED_ATTN_CK=1 \ | ||
| NVTE_FUSED_ATTN_AOTRITON=0 | ||
| RUN framework_jobs="${NUM_MAKE_JOBS}" && \ | ||
| if [ "${framework_jobs}" -gt 16 ]; then framework_jobs=16; fi && \ | ||
| te_architectures=$(printf '%s' "${AMDGPU_TARGETS}" | tr -s '[:space:]' ';' | sed 's/^;//; s/;$//') && \ | ||
| export MAX_JOBS="${framework_jobs}" CMAKE_BUILD_PARALLEL_LEVEL="${framework_jobs}" \ | ||
| NVTE_BUILD_MAX_JOBS="${framework_jobs}" PIP_CONSTRAINT=/tmp/rocm10-constraints.txt \ | ||
| TMPDIR=/tmp/rocm10-frameworks-scratch NVTE_USE_ROCM=1 NVTE_FRAMEWORK=pytorch \ | ||
| NVTE_ROCM_ARCH="${te_architectures}" NVTE_NO_LOCAL_VERSION=1 NVTE_CK_JIT=1 \ | ||
| NVTE_FUSED_ATTN_AOTRITON=1 PREBUILD_KERNELS=0 BUILD_TARGET=rocm RCCL_HOME="${ROCM_PATH}" && \ | ||
| python3 -c 'import sys; from importlib.metadata import version; expected = {"torch": "2.13.0+rocm10.1.0", "triton": "3.8.0+git669b31ac.rocm10.1.0", "rocm-sdk-core": "10.1.0", "rocm-sdk-devel": "10.1.0"}; wrong = ["{}=={} (found {})".format(name, value, version(name)) for name, value in expected.items() if version(name) != value]; sys.exit("Unexpected base packages: " + ", ".join(wrong) if wrong else 0)' && \ | ||
| mkdir -p "${TMPDIR}" && \ | ||
| python3 -m pip install \ | ||
| pybind11==3.0.1 pydantic==2.13.5 einops==0.8.2 psutil==7.2.2 mpi4py==4.1.1 \ | ||
| flydsl==0.3.4.1 pandas==3.0.5 nvdlfw-inspect==0.2.2 \ | ||
| onnxscript==0.7.2 onnx-ir==1.0.0 onnx==1.23.1 ml_dtypes==0.6.0 && \ | ||
| for source in "TransformerEngine https://github.com/ROCm/TransformerEngine.git ${TE_COMMIT}" \ | ||
| "aiter https://github.com/ROCm/aiter.git ${AITER_COMMIT}" \ | ||
| "Megatron-LM https://github.com/NVIDIA/Megatron-LM.git ${MEGATRON_COMMIT}"; do \ | ||
| set -- ${source} && \ | ||
| git init -q "${SB_ROCM10_FRAMEWORK_ROOT}/$1" && \ | ||
| git -C "${SB_ROCM10_FRAMEWORK_ROOT}/$1" remote add origin "$2" && \ | ||
| git -C "${SB_ROCM10_FRAMEWORK_ROOT}/$1" fetch -q --depth 1 origin "$3" && \ | ||
| git -C "${SB_ROCM10_FRAMEWORK_ROOT}/$1" checkout -q --detach FETCH_HEAD && \ | ||
| git -C "${SB_ROCM10_FRAMEWORK_ROOT}/$1" submodule update --init --recursive --depth 1 || exit 1; \ | ||
| done && \ | ||
| git -C "${SB_MEGATRON_PATH}" apply "${SB_HOME}/third_party/Megatron/megatron_core_0.19.2_rocm10.patch" && \ | ||
|
normanvuong marked this conversation as resolved.
Resolved
|
||
| python3 -m pip wheel --no-build-isolation --no-deps -w /tmp/rocm10-wheels \ | ||
| "${SB_ROCM10_FRAMEWORK_ROOT}/TransformerEngine" "${SB_ROCM10_FRAMEWORK_ROOT}/aiter" "${SB_MEGATRON_PATH}" && \ | ||
| python3 -m pip install --no-deps /tmp/rocm10-wheels/*.whl && \ | ||
| python3 -m pip check && \ | ||
| python3 -m pip freeze | grep -Ei '^(torch|torchvision|torchaudio|triton|apex|rocm|rocm[-_][^=]+)==' | \ | ||
| diff -u /tmp/rocm10-constraints.txt - && \ | ||
| rm -rf /tmp/rocm10-wheels "${TMPDIR}" | ||
|
|
||
| # Build-only framework settings above stay out of the runtime environment. | ||
| RUN printf '%s\n' \ | ||
| "PATH=${PATH}" \ | ||
| "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" \ | ||
| "SB_MICRO_PATH=${SB_MICRO_PATH}" \ | ||
| "SB_ROCM_MEM_BW_BACKEND=${SB_ROCM_MEM_BW_BACKEND}" \ | ||
| "ROCM_PATH=${ROCM_PATH}" \ | ||
| "ROCM_HOME=${ROCM_HOME}" \ | ||
| "HIP_PATH=${HIP_PATH}" \ | ||
| "RCCL_HOME=${RCCL_HOME}" \ | ||
| "SB_ROCM10_FRAMEWORK_ROOT=${SB_ROCM10_FRAMEWORK_ROOT}" \ | ||
| "SB_MEGATRON_PATH=${SB_MEGATRON_PATH}" \ | ||
| "AITER_USE_SYSTEM_TRITON=${AITER_USE_SYSTEM_TRITON}" \ | ||
| "TRITON_F32_DEFAULT=${TRITON_F32_DEFAULT}" \ | ||
| "MAX_JOBS=${MAX_JOBS}" \ | ||
| "CUDA_DEVICE_MAX_CONNECTIONS=${CUDA_DEVICE_MAX_CONNECTIONS}" \ | ||
| "NVTE_FLASH_ATTN=${NVTE_FLASH_ATTN}" \ | ||
| "NVTE_FUSED_ATTN=${NVTE_FUSED_ATTN}" \ | ||
| "NVTE_FUSED_ATTN_CK=${NVTE_FUSED_ATTN_CK}" \ | ||
| "NVTE_FUSED_ATTN_AOTRITON=${NVTE_FUSED_ATTN_AOTRITON}" \ | ||
| > /etc/environment | ||
|
|
||
| # Build SuperBench and finish installation. | ||
| RUN CXX="${ROCM_PATH}/bin/hipcc" make cppbuild && \ | ||
| make postinstall | ||
|
|
||
| RUN python3 -m pip check && \ | ||
| sb --help && \ | ||
| rm /tmp/rocm10-constraints.txt && \ | ||
| rm -rf .git | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.