@@ -10,11 +10,17 @@ RUN microdnf update -y && \
1010 microdnf install -y --nodocs \
1111 git gcc-toolset-13 rust cargo wget unzip && \
1212 pip install --upgrade --no-cache-dir 'cmake<4' ; \
13+ elif [ "$TARGETARCH" = "s390x" ]; then \
14+ microdnf install -y --nodocs \
15+ git gcc-toolset-13 make wget unzip rust cargo \
16+ gcc-gfortran python3-devel openblas-devel pkgconfig && \
17+ pip install --upgrade --no-cache-dir 'cmake<4' \
18+ setuptools wheel ; \
1319 fi && \
1420 microdnf clean all
1521
1622
17- RUN if [ "$TARGETARCH" != "ppc64le" ]; then \
23+ RUN if [ "$TARGETARCH" != "ppc64le" ] && [ "$TARGETARCH" != "s390x" ]; then \
1824 pip install --no-cache-dir torch ; \
1925 fi
2026
@@ -29,7 +35,7 @@ ARG TARGETARCH
2935ENV TORCH_VERSION=2.6.0
3036ENV PATH="$HOME/.cargo/bin:$PATH"
3137
32- RUN if [ "$TARGETARCH" = "ppc64le" ]; then \
38+ RUN if [ "$TARGETARCH" = "ppc64le" ] || [ "$TARGETARCH" = "s390x" ]; then \
3339 source /opt/rh/gcc-toolset-13/enable && \
3440 git clone --recursive https://github.com/pytorch/pytorch.git -b v${TORCH_VERSION} && \
3541 cd pytorch && pip install -r requirements.txt && \
@@ -64,7 +70,7 @@ ARG TARGETARCH
6470
6571# Install PyTorch for ppc64le
6672RUN --mount=type=bind,from=torch-builder,source=/tmp/,target=/wheels/,ro \
67- if [ "$TARGETARCH" = "ppc64le" ]; then \
73+ if [ "$TARGETARCH" = "ppc64le" ] || [ "$TARGETARCH" = "s390x" ]; then \
6874 HOME=/root pip install /wheels/torchwheels/*.whl ;\
6975 fi
7076
@@ -78,7 +84,7 @@ COPY ./common/requirements.txt .
7884RUN pip install --no-cache-dir -r requirements.txt
7985
8086COPY ./huggingface/requirements.txt .
81- RUN if [ "$TARGETARCH" = "ppc64le" ]; then \
87+ RUN if [ "$TARGETARCH" = "ppc64le" ] || [ "$TARGETARCH" = "s390x" ]; then \
8288 source /opt/rh/gcc-toolset-13/enable ; \
8389 fi && \
8490 pip install --no-cache-dir -r requirements.txt
0 commit comments