From cbccbee29af9ae87d873459bcca6a02e4963a7ab Mon Sep 17 00:00:00 2001 From: mertalev <101130780+mertalev@users.noreply.github.com> Date: Mon, 26 Jan 2026 16:02:35 -0500 Subject: [PATCH 1/3] reduce targets --- machine-learning/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/machine-learning/Dockerfile b/machine-learning/Dockerfile index dfc217c118060..f9f968f113df7 100644 --- a/machine-learning/Dockerfile +++ b/machine-learning/Dockerfile @@ -47,17 +47,17 @@ RUN /bin/sh ./dockerfiles/scripts/install_common_deps.sh ENV PATH=/opt/rocm-venv/bin:/code/cmake-3.31.9-linux-x86_64/bin:${PATH} ENV CCACHE_DIR="/ccache" # Note: the `parallel` setting uses a substantial amount of RAM -RUN --mount=type=cache,target=/ccache \ +RUN --mount=type=cache,target=/ccache,id=rocm-ccache \ ./build.sh \ --allow_running_as_root \ --config Release \ --build_wheel \ --update \ --build \ - --parallel 17 \ + --parallel 21 \ --cmake_extra_defines \ ONNXRUNTIME_VERSION="${ONNXRUNTIME_VERSION}" \ - CMAKE_HIP_ARCHITECTURES="gfx900;gfx906;gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201" \ + CMAKE_HIP_ARCHITECTURES="gfx900;gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201" \ --skip_tests \ --use_rocm \ --rocm_home=/opt/rocm \ From 85137f5887fe99dfbf6e39da1c0b60f131e0a053 Mon Sep 17 00:00:00 2001 From: mertalev <101130780+mertalev@users.noreply.github.com> Date: Wed, 28 Jan 2026 09:27:28 -0500 Subject: [PATCH 2/3] disable cache --- machine-learning/Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/machine-learning/Dockerfile b/machine-learning/Dockerfile index f9f968f113df7..273f4f718322f 100644 --- a/machine-learning/Dockerfile +++ b/machine-learning/Dockerfile @@ -45,10 +45,8 @@ RUN git apply /tmp/*.patch RUN /bin/sh ./dockerfiles/scripts/install_common_deps.sh ENV PATH=/opt/rocm-venv/bin:/code/cmake-3.31.9-linux-x86_64/bin:${PATH} -ENV CCACHE_DIR="/ccache" # Note: the `parallel` setting uses a substantial amount of RAM -RUN --mount=type=cache,target=/ccache,id=rocm-ccache \ - ./build.sh \ +RUN ./build.sh \ --allow_running_as_root \ --config Release \ --build_wheel \ @@ -61,7 +59,6 @@ RUN --mount=type=cache,target=/ccache,id=rocm-ccache \ --skip_tests \ --use_rocm \ --rocm_home=/opt/rocm \ - --use_cache \ --compile_no_warning_as_error RUN mv /code/onnxruntime/build/Linux/Release/dist/*.whl /opt/ From c7315bf05f20b95e877aa0e84f3be9ac154fbe7b Mon Sep 17 00:00:00 2001 From: mertalev <101130780+mertalev@users.noreply.github.com> Date: Thu, 5 Feb 2026 11:02:27 -0500 Subject: [PATCH 3/3] add build flag arg --- machine-learning/Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/machine-learning/Dockerfile b/machine-learning/Dockerfile index 273f4f718322f..ec401f6ccf384 100644 --- a/machine-learning/Dockerfile +++ b/machine-learning/Dockerfile @@ -44,22 +44,26 @@ RUN git apply /tmp/*.patch RUN /bin/sh ./dockerfiles/scripts/install_common_deps.sh +ARG ORT_BUILD_FLAGS="" ENV PATH=/opt/rocm-venv/bin:/code/cmake-3.31.9-linux-x86_64/bin:${PATH} +ENV CCACHE_DIR="/ccache" # Note: the `parallel` setting uses a substantial amount of RAM -RUN ./build.sh \ +RUN --mount=type=cache,target=/ccache,id=rocm-ccache \ + ./build.sh \ --allow_running_as_root \ --config Release \ --build_wheel \ --update \ --build \ - --parallel 21 \ + --parallel 17 \ --cmake_extra_defines \ ONNXRUNTIME_VERSION="${ONNXRUNTIME_VERSION}" \ CMAKE_HIP_ARCHITECTURES="gfx900;gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201" \ --skip_tests \ --use_rocm \ --rocm_home=/opt/rocm \ - --compile_no_warning_as_error + --compile_no_warning_as_error \ + $ORT_BUILD_FLAGS RUN mv /code/onnxruntime/build/Linux/Release/dist/*.whl /opt/ FROM builder-${DEVICE} AS builder