-
Notifications
You must be signed in to change notification settings - Fork 144
Bump CI to TheRock 7.14 #4952
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
Bump CI to TheRock 7.14 #4952
Changes from all commits
4b874e9
02eb46e
4a33d5b
2b99bc5
95c06bf
d46f5ed
b2062a0
1752d9a
0eb9aa7
bcff450
af8b994
f59ad70
5fd06be
ba77cd3
c42edbd
9f8b92b
2157cf0
475c9b0
da9b507
ddee6e8
4a73bc0
170560d
b100786
a24d0e9
da5d4e8
e2795bb
0d18824
24cc94a
c397c38
ef54b36
e74e85d
b42e79d
ebe13d3
5b2b24e
df6821b
a79b3c0
29efc7e
20d7acb
69ab77c
a5a0cbb
b184510
bbac04e
36e4edf
8f446c2
4cea119
dea39d4
2caa6ca
e517ba1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,57 @@ | ||
| FROM ubuntu:22.04 | ||
| # MIGraphX build environment with TheRock (amdrocm-*) deb packages. | ||
| # | ||
| # Build args: | ||
| # ROCM_VERSION ROCm release version for versioned package names (e.g. 7.13) | ||
| # GPU_ARCH GPU architecture family (e.g. gfx120x, gfx94x) | ||
| # USE_WHL Set to a non-empty value to install ROCm from Python | ||
| # wheels (pip) instead of system packages | ||
| # INDEX_URL pip --index-url used when installing ROCm from wheels | ||
| # (only effective together with USE_WHL) | ||
| # | ||
| # Build: | ||
| # docker build --build-arg GPU_ARCH=<gpu_arch> \ | ||
| # --build-arg ROCM_VERSION=<rocm_version> \ | ||
| # -t migraphx-therock . | ||
| # | ||
| # Run: | ||
| # docker run -it --device=/dev/kfd --device=/dev/dri --group-add video \ | ||
| # -v $(pwd):/code/AMDMIGraphX migraphx-therock | ||
| # | ||
| # Build MIGraphX inside the container: | ||
| # cd /code/AMDMIGraphX | ||
| # rbuild build -d depend -B build | ||
| # | ||
|
|
||
| FROM ubuntu:24.04 | ||
|
|
||
| ARG PREFIX=/usr/local | ||
| # ROCm release version (used in versioned package names, e.g. amdrocm-developer-tools7.13) | ||
| ARG ROCM_VERSION="7.14" | ||
| # GPU architecture family (e.g. gfx942, gfx120x); leave empty for arch-independent packages | ||
| ARG GPU_ARCH="" | ||
| # Install location for the prebuilt MIGraphX dependencies. | ||
| ARG PREFIX=/usr/local | ||
| # Install the MIGraphX build prerequisites (system packages + ROCm components). | ||
| # Set USE_WHL to any non-empty value to install ROCm from Python wheels instead | ||
| # of system packages (passes --whl to the prereqs script). | ||
| ARG USE_WHL="" | ||
| # pip index URL for the wheel-based ROCm install (only used when USE_WHL is set). | ||
| ARG INDEX_URL="https://repo.amd.com/rocm/whl-multi-arch/" | ||
|
|
||
| # Support multiarch | ||
| RUN dpkg --add-architecture i386 | ||
|
|
||
| # Install rocm key | ||
| RUN apt-get update && apt-get install -y software-properties-common gnupg2 --no-install-recommends curl && \ | ||
| mkdir -p /etc/apt/keyrings && \ | ||
| curl -fsSL https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor -o /etc/apt/keyrings/rocm.gpg | ||
| curl -fsSL https://repo.amd.com/rocm/packages/gpg/rocm.gpg | gpg --dearmor -o /etc/apt/keyrings/amdrocm.gpg | ||
|
|
||
| # Add rocm repository | ||
| RUN sh -c 'echo deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/7.2.3/ jammy main > /etc/apt/sources.list.d/rocm.list' | ||
|
|
||
| # From docs.amd.com for installing rocm. Needed to install properly | ||
| RUN sh -c "echo 'Package: *\nPin: release o=repo.radeon.com\nPin-priority: 600' > /etc/apt/preferences.d/rocm-pin-600" | ||
|
|
||
| # rocgdb doesn't work on 22.04, workaround by installing the older python packages that are in 20.04 | ||
| RUN add-apt-repository -y ppa:deadsnakes/ppa | ||
| RUN sh -c 'echo deb [arch=amd64 signed-by=/etc/apt/keyrings/amdrocm.gpg] https://repo.amd.com/rocm/packages-multi-arch/ubuntu2404 stable main > /etc/apt/sources.list.d/rocm.list' | ||
|
|
||
| # Add LLVM repository for Clang 17 (ROCm 7.x ships with Clang 20 which has ODR false positives in ASAN) | ||
| RUN curl -sL https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ | ||
| add-apt-repository -y "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" | ||
| add-apt-repository -y "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-17 main" | ||
|
|
||
| # Install dependencies | ||
| RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
|
|
@@ -44,84 +74,69 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ | |
| python3-full \ | ||
| libpython3.8 \ | ||
| wget \ | ||
| rocm-device-libs \ | ||
| hip-dev \ | ||
| libnuma-dev \ | ||
| miopen-hip \ | ||
| libomp-17-dev \ | ||
| rocblas \ | ||
| hipfft \ | ||
| hipsolver \ | ||
| rocthrust \ | ||
| rocrand \ | ||
| rocprofiler-sdk \ | ||
| hipsparse \ | ||
| rccl \ | ||
| rocm-smi-lib \ | ||
| rocminfo \ | ||
| roctracer-dev \ | ||
| hipcub \ | ||
| hipblas \ | ||
| hipify-clang \ | ||
| hiprand-dev \ | ||
| hipsparselt \ | ||
| hsa-amd-aqlprofile \ | ||
| half \ | ||
| libssl-dev \ | ||
| zlib1g-dev && \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are missing packages here, like clang-17.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While checking the ASAN issue I'm going to go with a suggested workaround using the clang version provided by TheRock since clang-17 didn't have a fix. runtime ASAN_OPTIONS=detect_odr_violation=0, or compile-time -mllvm -asan-use-private-alias=1 + use_odr_indicator=1.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That workaround never fixed the issue in the past.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, this is just making more unnecessary changes in this PR. This PR should only focus on updating to rocm 7.13, it shouldn't be making these change. The docker file should have a minimal amount of changes with most of the changes in |
||
| apt-get clean && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
|
|
||
| # Install pytorch | ||
| RUN pip3 install https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2.3/torch-2.8.0%2Brocm7.2.3.lw.git2742f6d1-cp310-cp310-linux_x86_64.whl \ | ||
| https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2.3/torchvision-0.24.0%2Brocm7.2.3.gitb919bd0c-cp310-cp310-linux_x86_64.whl \ | ||
| https://repo.radeon.com/rocm/manylinux/rocm-rel-7.2.3/triton-3.4.0%2Brocm7.2.3.git0cace8d2-cp310-cp310-linux_x86_64.whl | ||
|
|
||
|
causten marked this conversation as resolved.
|
||
| # add this for roctracer dependencies | ||
| RUN pip3 install CppHeaderParser | ||
|
|
||
| # Workaround broken rocm packages | ||
| RUN ln -s /opt/rocm-* /opt/rocm | ||
| RUN echo "/opt/rocm/lib" > /etc/ld.so.conf.d/rocm.conf | ||
| RUN echo "/opt/rocm/llvm/lib" > /etc/ld.so.conf.d/rocm-llvm.conf | ||
| RUN ldconfig | ||
|
|
||
| # ATT library | ||
| RUN wget -O /opt/rocm/lib/librocprof-trace-decoder.so https://github.com/ROCm/rocprof-trace-decoder/raw/7e58204a955e5787b9b38087f3ad502f07ff78ef/releases/linux_glibc_2_28_x86_64/librocprof-trace-decoder.so | ||
|
causten marked this conversation as resolved.
|
||
|
|
||
| # Workaround broken miopen cmake files | ||
| RUN sed -i 's,;/usr/lib/x86_64-linux-gnu/librt.so,,g' /opt/rocm/lib/cmake/miopen/miopen-targets.cmake | ||
|
|
||
| # Workaround for distributions running cmake < 3.25 | ||
| RUN sed -i -e 's/^block/if(COMMAND block)\nblock/g' -e 's/^endblock/endblock\(\)\nendif/g' /opt/rocm/lib/cmake/hipblaslt/hipblaslt-config.cmake | ||
|
|
||
| RUN locale-gen en_US.UTF-8 | ||
| RUN update-locale LANG=en_US.UTF-8 | ||
|
|
||
| ENV LC_ALL=C.UTF-8 | ||
| ENV LANG=C.UTF-8 | ||
|
|
||
| ENV PIP_BREAK_SYSTEM_PACKAGES=1 | ||
|
|
||
| # Install dependencies | ||
| ADD dev-requirements.txt /dev-requirements.txt | ||
| ADD requirements.txt /requirements.txt | ||
| ADD rbuild.ini /rbuild.ini | ||
|
|
||
| # Location where onnx unit tests models are cached | ||
| ENV ONNX_HOME=/.onnx | ||
| RUN mkdir -p $ONNX_HOME/models && chmod 777 $ONNX_HOME/models | ||
|
|
||
| COPY ./tools/install_prereqs.sh / | ||
| COPY ./tools/requirements-py.txt /requirements-py.txt | ||
| RUN /install_prereqs.sh /usr/local / && rm /install_prereqs.sh && rm /requirements-py.txt | ||
| RUN ./install_prereqs.sh \ | ||
| --rocm-version ${ROCM_VERSION} \ | ||
| ${GPU_ARCH:+--gpu ${GPU_ARCH}} \ | ||
| --index-url ${INDEX_URL} \ | ||
| ${USE_WHL:+--whl} | ||
| RUN rm /install_prereqs.sh && rm /*.txt | ||
| RUN test -f /usr/local/hash || exit 1 | ||
|
|
||
| # Workaround broken rocm packages | ||
| RUN echo "/opt/rocm/lib" > /etc/ld.so.conf.d/rocm.conf | ||
| RUN echo "/opt/rocm/llvm/lib" > /etc/ld.so.conf.d/rocm-llvm.conf | ||
| RUN ldconfig | ||
|
|
||
| # Manually remove rocm-cmake, since it shouldnt be installed in the first place | ||
| RUN rm -rf /opt/rocm/share/rocmcmakebuildtools | ||
|
|
||
| # Install pytorch | ||
| RUN pip3 install --index-url "${INDEX_URL}" \ | ||
| "torch==2.11.0+rocm${ROCM_VERSION}.0" \ | ||
| "torchvision==0.26.0+rocm${ROCM_VERSION}.0" \ | ||
| "torchaudio==2.11.0+rocm${ROCM_VERSION}.0" | ||
|
|
||
| # Location where onnx unit tests models are cached | ||
| ENV ONNX_HOME=/.onnx | ||
| RUN mkdir -p $ONNX_HOME/models && chmod 777 $ONNX_HOME/models | ||
|
|
||
| # Install yapf | ||
| RUN pip3 install yapf==0.28.0 | ||
| RUN pipx install --global yapf==0.28.0 | ||
|
|
||
| # Install clang format | ||
| RUN pipx install --global clang-format==22.1.5 | ||
|
|
||
| # Install doc requirements | ||
| ADD docs/sphinx/requirements.txt /doc-requirements.txt | ||
| RUN pip3 install -r /doc-requirements.txt | ||
| # pip rejects extras in a constraints file (the pip-compile output pins | ||
| # pyjwt[crypto]), and extras carry no meaning in a constraint, so strip them to | ||
| # pin the sphinx install. | ||
| RUN sed 's/\[[^][]*\]//' /doc-requirements.txt > /doc-constraints.txt && \ | ||
| pipx install --global sphinx --pip-args="-c /doc-constraints.txt" && \ | ||
| rm /doc-constraints.txt | ||
| RUN pipx inject --global sphinx -r /doc-requirements.txt | ||
|
|
||
| # Install latest ccache version | ||
| RUN cget -p $PREFIX install facebook/zstd@v1.4.5 -X subdir -DCMAKE_DIR=build/cmake | ||
|
|
@@ -139,3 +154,4 @@ ENV UBSAN_OPTIONS=print_stacktrace=1 | |
| # See: https://github.com/google/sanitizers/issues/1017 | ||
| ENV ASAN_OPTIONS=detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1 | ||
| RUN ln -s /opt/rocm/llvm/bin/llvm-symbolizer /usr/bin/llvm-symbolizer | ||
|
causten marked this conversation as resolved.
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are the clang_tidy flags being changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume these are new warnings from newer cland tidy version. We should address these in a seperate PR.