Skip to content

Commit 7b87c29

Browse files
authored
[circle-mlir] Revise U22.04 Dockerfile (#15173)
This will revise U22.04 Dockerfile - use numpy==1.24.3 for compatibility - use torch+cpu not to install cuda - update onnx-mlir build options - relocate llvm-project cleanup ONE-DCO-1.0-Signed-off-by: SaeHie Park <saehie.park@gmail.com>
1 parent c6eb5a0 commit 7b87c29

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

circle-mlir/infra/docker/u2204/Dockerfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ RUN apt-get update \
1919
RUN apt-get update \
2020
&& apt-get -qqy install python3 python3-pip python3-venv python3-dev python3-all dh-python
2121
RUN python3 -m pip install --upgrade pip setuptools
22-
RUN python3 -m pip install yapf==0.43.0 numpy==2.2.4 h5py==3.8.0 einops
22+
RUN python3 -m pip install yapf==0.43.0 h5py==3.8.0 einops
2323

2424
# TODO upgrade
25-
ARG VER_TORCH=2.6.0
25+
ARG VER_TORCH=2.6.0+cpu
2626
ARG VER_ONNX=1.17.0
2727
ARG VER_ONNXRUNTIME=1.21.0
2828

29-
RUN python3 -m pip install torch==${VER_TORCH} onnx==${VER_ONNX} onnxruntime==${VER_ONNXRUNTIME}
29+
RUN python3 -m pip install numpy==1.24.3 torch==${VER_TORCH} -f https://download.pytorch.org/whl/torch
30+
RUN python3 -m pip install onnx==${VER_ONNX} onnxruntime==${VER_ONNXRUNTIME}
3031

3132
# Clean archives (to reduce image size)
3233
RUN apt-get clean -y
@@ -122,6 +123,10 @@ RUN mkdir llvm-project-build && cd llvm-project-build \
122123

123124
RUN cd llvm-project-build && cmake --build . && cmake --install .
124125

126+
# LLVM/MLIR clean up
127+
RUN rm -rf llvm-project
128+
RUN rm -rf llvm-project-build
129+
125130
# ONNX-MLIR build from source
126131
# Patch to accept INT16 for QuantizeLinear/DequantizeLinear and fix ONNX passes
127132
RUN cd onnx-mlir \
@@ -133,15 +138,12 @@ RUN mkdir onnx-mlir-build && cd onnx-mlir-build \
133138
-DPython3_ROOT_DIR=/usr/bin \
134139
-DCMAKE_JOB_POOL_COMPILE:STRING=compile -DCMAKE_JOB_POOL_LINK:STRING=link \
135140
-DCMAKE_JOB_POOLS:STRING='compile=4;link=1' \
136-
-DONNX_MLIR_BUILD_TESTS=OFF -DONNX_MLIR_ENABLE_MHLO=OFF -DLLVM_ENABLE_ASSERTIONS=ON \
141+
-DONNX_MLIR_BUILD_TESTS=OFF -DONNX_MLIR_ENABLE_STABLEHLO=OFF \
142+
-DONNX_MLIR_ENABLE_JAVA=OFF -DLLVM_ENABLE_ASSERTIONS=ON \
137143
../onnx-mlir
138144

139145
RUN cd onnx-mlir-build && cmake --build . && cmake --install .
140146

141-
# LLVM/MLIR clean up
142-
RUN rm -rf llvm-project
143-
RUN rm -rf llvm-project-build
144-
145147
# ONNX-MLIR clean up
146148
RUN rm -rf onnx-mlir/.git \
147149
&& rm -rf onnx-mlir/third_party/* \

0 commit comments

Comments
 (0)