Skip to content

Commit cadbf0d

Browse files
Pre-release v2.0.0
- Update numpy version from 1.22.0 to 1.22.4 - Update sklearn version from 1.0.2 to 1.3.2 - Refactore docker images - Add test for scikit-learn
1 parent f2018c2 commit cadbf0d

15 files changed

+226
-232
lines changed
Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
ARG VERIFICARLO_VERSION=v0.9.1
2-
FROM verificarlo/verificarlo:${VERIFICARLO_VERSION}
1+
ARG ORG=verificarlo
2+
ARG VERIFICARLO_VERSION=v2.0.0
3+
FROM ${ORG}/verificarlo:${VERIFICARLO_VERSION}
34

45
# Setup build dependencies
56
RUN apt-get update -qqq &&\
@@ -14,59 +15,56 @@ RUN apt-get update -qqq &&\
1415

1516
# Copy verificarlo's exclusion file for Python 3
1617
COPY docker/resources/python-vfc-exclude.txt /tmp/python-vfc-exclude.txt
17-
COPY docker/resources/verificarlo.patch /tmp/verificarlo.patch
1818
COPY docker/resources/libmath/set-fuzzy-libmath.py /usr/local/bin/set-fuzzy-libmath
19-
RUN patch $(which verificarlo) /tmp/verificarlo.patch
2019

2120
# Setting compilers and linkers to use verificarlo
2221
ENV CC "verificarlo-c"
2322
ENV CXX "verificarlo-c++"
2423
ENV FC "verificarlo-f"
2524
ENV LDSHARED "verificarlo-c"
2625

27-
# Load backend IEEE
28-
RUN mkdir -p /opt/ && touch /opt/vfc-backends.txt
26+
# Setting verificarlo's backend file
2927
ENV VFC_BACKENDS_FROM_FILE=/opt/vfc-backends.txt
30-
RUN echo "libinterflop_ieee.so" > $VFC_BACKENDS_FROM_FILE
3128

32-
# Create instrumented shared mathematical library
29+
# Copy libmath source code
3330
COPY docker/resources/libmath/ /opt/mca-libmath/
34-
RUN cd /opt/mca-libmath/ &&\
35-
make CONSERVATIVE=True &&\
36-
make test
3731

32+
# Load backend IEEE and
33+
# create instrumented shared mathematical library
34+
RUN mkdir -p /opt/ && \
35+
echo "libinterflop_ieee.so" > /opt/vfc-backends.txt && \
36+
cd /opt/mca-libmath/ && \
37+
make && \
38+
make test
3839

3940
# Build BLAS and LAPACK from the following URL's instructions:
4041
# http://ab-initio.mit.edu/wiki/index.php/Template:Installing_BLAS_and_LAPACK
41-
RUN cd /opt/build/ &&\
42-
wget http://www.netlib.org/lapack/lapack-3.9.0.tgz &&\
43-
gunzip lapack-3.9.0.tgz &&\
44-
tar xf lapack-3.9.0.tar &&\
45-
cd /opt/build/lapack-3.9.0/ &&\
46-
cp make.inc.example make.inc &&\
47-
sed -i 's/= gcc/= verificarlo-c/g' make.inc &&\
48-
sed -i 's/= gfortran/= verificarlo-f/g' make.inc &&\
49-
sed -i 's/TIMER = INT_ETIME/#TIMER = INT_ETIME/g' make.inc &&\
50-
sed -i 's/# TIMER = NONE/TIMER = NONE/g' make.inc &&\
51-
mkdir build &&\
52-
cd /opt/build/lapack-3.9.0/build &&\
53-
cmake FC=verificarlo-f -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_C_COMPILER=verificarlo-c -DCMAKE_Fortran_COMPILER=verificarlo-f \
54-
-DCBLAS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_C_FLAGS="--conservative" -DCMAKE_Fortran_FLAGS="--conservative" .. &&\
55-
make -j $(nproc) &&\
56-
make install
57-
58-
# Remove temporary files
59-
RUN rm -rf /opt/build/*
42+
RUN cd /opt/build/ && \
43+
wget http://www.netlib.org/lapack/lapack-3.9.0.tgz && \
44+
gunzip lapack-3.9.0.tgz && \
45+
tar xf lapack-3.9.0.tar && \
46+
cd /opt/build/lapack-3.9.0/ && \
47+
cp make.inc.example make.inc && \
48+
sed -i 's/= gcc/= verificarlo-c/g' make.inc && \
49+
sed -i 's/= gfortran/= verificarlo-f/g' make.inc && \
50+
sed -i 's/TIMER = INT_ETIME/#TIMER = INT_ETIME/g' make.inc && \
51+
sed -i 's/# TIMER = NONE/TIMER = NONE/g' make.inc && \
52+
mkdir build && \
53+
cd /opt/build/lapack-3.9.0/build && \
54+
cmake FC=verificarlo-f -DCMAKE_BUILD_TYPE=RELEASE \
55+
-DCMAKE_C_COMPILER=verificarlo-c -DCMAKE_Fortran_COMPILER=verificarlo-f \
56+
-DCBLAS=ON -DBUILD_SHARED_LIBS=ON .. && \
57+
make -j $(nproc) && \
58+
make install && \
59+
rm -rf /opt/build/*
6060

61-
# Restore default behavior for verificarlo's CC
62-
ENV CC "verificarlo-c"
61+
# Preload the instrumented shared library
6362
ENV VFC_BACKENDS_LOGGER="False"
6463
ENV VFC_BACKENDS_SILENT_LOAD="True"
65-
RUN echo "libinterflop_mca_int.so -m rr" > $VFC_BACKENDS_FROM_FILE
66-
67-
# Preloading the instrumented shared library
6864
ARG FUZZY_LIBMATH_VERSION=standard
69-
RUN set-fuzzy-libmath --version=${FUZZY_LIBMATH_VERSION}
65+
66+
RUN echo "libinterflop_mca.so -m rr" > $VFC_BACKENDS_FROM_FILE && \
67+
set-fuzzy-libmath --version=${FUZZY_LIBMATH_VERSION}
7068

7169
# Set bash shell as entrypoint
7270
ENTRYPOINT [ "/bin/bash"]
Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
1-
ARG VERIFICARLO_VERSION=v0.9.1
2-
FROM verificarlo/fuzzy:${VERIFICARLO_VERSION}-lapack
1+
ARG ORG=verificarlo
2+
ARG VERIFICARLO_VERSION=v2.0.0
3+
FROM ${ORG}/fuzzy:${VERIFICARLO_VERSION}-lapack
34

4-
# Use IEEE mode for compiling with verificarlo
5-
RUN echo "libinterflop_ieee.so" > $VFC_BACKENDS_FROM_FILE
6-
7-
# Remove any existing python packages
8-
RUN apt -y -qqq remove python3
5+
ARG PYTHON_VERSION=3.8.5
96

10-
## Build Python 3.8.5 from source and the associated pip
11-
RUN cd /opt/build/ && \
12-
wget https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz && \
13-
tar xvf Python-3.8.5.tgz && \
14-
cd Python-3.8.5 && \
15-
LDFLAGS="--conservative --exclude-file=/tmp/python-vfc-exclude.txt" \
16-
CFLAGS="--conservative --exclude-file=/tmp/python-vfc-exclude.txt" \
7+
# Use IEEE mode for compiling with verificarlo
8+
RUN echo "libinterflop_ieee.so" > $VFC_BACKENDS_FROM_FILE && \
9+
# Remove any existing python packages
10+
apt -y -qqq remove python3 && \
11+
# Build Python from source and the associated pip
12+
cd /opt/build/ && \
13+
wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
14+
tar xvf Python-${PYTHON_VERSION}.tgz && \
15+
cd Python-${PYTHON_VERSION} && \
16+
LDFLAGS="--exclude-file=/tmp/python-vfc-exclude.txt" \
17+
CFLAGS="--exclude-file=/tmp/python-vfc-exclude.txt" \
1718
LDSHARED='verificarlo-c -shared' \
18-
./configure --with-ensurepip=install &&\
19-
make -j $(nproc) &&\
20-
make install &&\
21-
wget https://bootstrap.pypa.io/get-pip.py &&\
22-
python3 get-pip.py
23-
24-
# Remove temporary files
25-
RUN rm -rf /opt/build/*
26-
27-
# Restore default MCA mode
28-
RUN echo "libinterflop_mca_int.so -m rr" > $VFC_BACKENDS_FROM_FILE
19+
./configure --with-ensurepip=install && \
20+
make -j $(nproc) && \
21+
make install && \
22+
wget https://bootstrap.pypa.io/get-pip.py && \
23+
python3 get-pip.py && \
24+
# Remove temporary files
25+
rm -rf /opt/build/* && \
26+
# Restore default MCA mode
27+
echo "libinterflop_mca.so -m rr" > $VFC_BACKENDS_FROM_FILE
2928

3029
# Set entrypoint
3130
ENTRYPOINT [ "/bin/bash"]
Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
1-
ARG VERIFICARLO_VERSION=v0.9.1
2-
FROM verificarlo/fuzzy:${VERIFICARLO_VERSION}-lapack-python3.8.5
1+
ARG ORG=verificarlo
2+
ARG VERIFICARLO_VERSION=v2.0.0
3+
FROM ${ORG}/fuzzy:${VERIFICARLO_VERSION}-lapack-python3.8.5
34

4-
# Use IEEE mode for compiling with verificarlo
5-
RUN echo "libinterflop_ieee.so" > $VFC_BACKENDS_FROM_FILE
5+
ARG NUMPY_VERSION=1.22.4
66

77
# Copy verificarlo's exclusion file for Python 3
88
COPY docker/resources/numpy-vfc-exclude.txt /tmp/numpy-vfc-exclude.txt
99
COPY docker/resources/numpy-sanity-check.py /tmp/numpy-sanity-check.py
1010

11-
# Build numpy from sources and link with the local BLAS and LAPACK
12-
RUN python3 -m pip install cython
13-
14-
RUN cd /opt/build/ &&\
15-
wget https://github.com/numpy/numpy/releases/download/v1.22.0/numpy-1.22.0.tar.gz &&\
16-
tar xvf numpy-1.22.0.tar.gz &&\
17-
cd numpy-1.22.0 &&\
11+
# Use IEEE mode for compiling with verificarlo
12+
RUN echo "libinterflop_ieee.so" > $VFC_BACKENDS_FROM_FILE && \
13+
# Build numpy from sources and link with the local BLAS and LAPACK
14+
python3 -m pip install cython==0.29.30 && \
15+
cd /opt/build/ &&\
16+
wget https://github.com/numpy/numpy/releases/download/v${NUMPY_VERSION}/numpy-${NUMPY_VERSION}.tar.gz &&\
17+
tar xvf numpy-${NUMPY_VERSION}.tar.gz &&\
18+
cd numpy-${NUMPY_VERSION} &&\
1819
CC="verificarlo-c" FC="verificarlo-f" CXX="verificarlo-c++" LDSHARED='verificarlo-c -shared' \
19-
CFLAGS="--conservative --exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument" \
20-
LDFLAGS="--conservative --exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument" \
21-
python3 setup.py build -j $(nproc) --disable-optimization install
22-
23-
24-
# Smoked test for vectorization.
25-
# We should run the full numpy test suit in next versions
26-
RUN python3 /tmp/numpy-sanity-check.py
27-
28-
# Remove temporary files
29-
RUN rm -rf /opt/build/*
30-
31-
# Restore default MCA mode
32-
RUN echo "libinterflop_mca_int.so -m rr" > $VFC_BACKENDS_FROM_FILE
20+
CFLAGS="--exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument" \
21+
FCFLAGS="--exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument" \
22+
CXXFLAGS="--exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument" \
23+
LDFLAGS="--exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument" \
24+
python3 setup.py build -j $(nproc) --disable-optimization install && \
25+
# Smoked test for vectorization.
26+
# We should run the full numpy test suit in next versions
27+
cd && python3 /tmp/numpy-sanity-check.py && \
28+
# Remove temporary files
29+
rm -rf /opt/build/* && \
30+
# Restore default MCA mode
31+
echo "libinterflop_mca.so -m rr" > $VFC_BACKENDS_FROM_FILE
3332

3433
ENTRYPOINT [ "/bin/bash"]
Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
1-
ARG VERIFICARLO_VERSION=v0.9.1
2-
FROM verificarlo/fuzzy:${VERIFICARLO_VERSION}-lapack
1+
ARG ORG=verificarlo
2+
ARG VERIFICARLO_VERSION=v2.0.0
3+
FROM ${ORG}/fuzzy:${VERIFICARLO_VERSION}-lapack
34

4-
# Use IEEE mode for compiling with verificarlo
5-
RUN echo "libinterflop_ieee.so" > $VFC_BACKENDS_FROM_FILE
5+
ARG NUMPY_VERSION=1.22.4
66

77
# Copy verificarlo's exclusion file for Python 3
88
COPY docker/resources/numpy-vfc-exclude.txt /tmp/numpy-vfc-exclude.txt
99
COPY docker/resources/numpy-sanity-check.py /tmp/numpy-sanity-check.py
1010

11-
# Build numpy from sources and link with the local BLAS and LAPACK
12-
RUN python3 -m pip install --upgrade pip && python3 -m pip install --ignore-installed cython==0.29.24
13-
14-
RUN cd /opt/build/ &&\
15-
wget https://github.com/numpy/numpy/releases/download/v1.22.0/numpy-1.22.0.tar.gz &&\
16-
tar xvf numpy-1.22.0.tar.gz &&\
17-
cd numpy-1.22.0 &&\
11+
# Use IEEE mode for compiling with verificarlo
12+
RUN echo "libinterflop_ieee.so" > $VFC_BACKENDS_FROM_FILE && \
13+
# Build numpy from sources and link with the local BLAS and LAPACK
14+
python3 -m pip install cython==0.29.30 && \
15+
cd /opt/build/ &&\
16+
wget https://github.com/numpy/numpy/releases/download/v${NUMPY_VERSION}/numpy-${NUMPY_VERSION}.tar.gz &&\
17+
tar xvf numpy-${NUMPY_VERSION}.tar.gz &&\
18+
cd numpy-${NUMPY_VERSION} &&\
1819
CC="verificarlo-c" FC="verificarlo-f" CXX="verificarlo-c++" LDSHARED='verificarlo-c -shared' \
19-
CFLAGS="--conservative --exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument" \
20-
LDFLAGS="--conservative --exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument" \
21-
python3 setup.py build -j $(nproc) --disable-optimization install
22-
23-
24-
# Smoked test for vectorization.
25-
# We should run the full numpy test suit in next versions
26-
RUN python3 /tmp/numpy-sanity-check.py
27-
28-
# Remove temporary files
29-
RUN rm -rf /opt/build/*
30-
31-
# Restore default MCA mode
32-
RUN echo "libinterflop_mca_int.so -m rr" > $VFC_BACKENDS_FROM_FILE
20+
CFLAGS="--exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument" \
21+
FCFLAGS="--exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument" \
22+
CXXFLAGS="--exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument" \
23+
LDFLAGS="--exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument" \
24+
python3 setup.py build -j $(nproc) --disable-optimization install && \
25+
# Smoked test for vectorization.
26+
# We should run the full numpy test suit in next versions
27+
cd && python3 /tmp/numpy-sanity-check.py && \
28+
# Remove temporary files
29+
rm -rf /opt/build/* && \
30+
# Restore default MCA mode
31+
echo "libinterflop_mca.so -m rr" > $VFC_BACKENDS_FROM_FILE
3332

3433
ENTRYPOINT [ "/bin/bash"]
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
ARG VERIFICARLO_VERSION=v0.9.1
2-
FROM verificarlo/fuzzy:${VERIFICARLO_VERSION}-lapack-python3.8.5-numpy
1+
ARG ORG=verificarlo
2+
ARG VERIFICARLO_VERSION=v2.0.0
3+
FROM ${ORG}/fuzzy:${VERIFICARLO_VERSION}-lapack-python3.8.5-numpy
34

4-
# Load backend IEEE
5-
RUN echo "libinterflop_ieee.so" > $VFC_BACKENDS_FROM_FILE
5+
ARG SCIPY_VERSION=1.7.3
66

77
# Copy sanity check for SciPy
8-
COPY docker/resources/numpy-sanity-check.py /tmp/scipy-sanity-check.py
9-
10-
# Install SciPy dependencies
11-
RUN pip3 install joblib pythran pybind11
12-
# Replace gfortran with verificarlo-f
13-
RUN cp /usr/local/bin/verificarlo-f /usr/bin/gfortran
14-
15-
# Remove debug flag which makes flag crash
16-
RUN sed -i "302s/.*/ llvm_options = llvm_options.replace(\"'-g'\",'') if \"'-g'\" in llvm_options else llvm_options/" $(which verificarlo)
17-
18-
RUN cd /opt/build/ &&\
19-
wget https://github.com/scipy/scipy/releases/download/v1.7.3/scipy-1.7.3.tar.gz &&\
20-
tar xvf scipy-1.7.3.tar.gz &&\
21-
cd scipy-1.7.3 &&\
22-
CC="verificarlo-c" FC="verificarlo-f" CXX="verificarlo-c++" LDSHARED='verificarlo-c -shared' \
23-
CFLAGS="--conservative -Wunused-command-line-argument" \
24-
LDFLAGS="--conservative -Wunused-command-line-argument" \
25-
python3 setup.py build --disable-optimization -j $(nproc) install
8+
COPY docker/resources/scipy-sanity-check.py /tmp/
269

27-
# Restore original verificarlo
28-
RUN sed -i "302s/ llvm_options = llvm_options.replace(\"'-g'\",'') if \"'-g'\" in llvm_options else llvm_options//" $(which verificarlo)
29-
30-
# Sanity check
31-
RUN python3 /tmp/scipy-sanity-check.py
32-
33-
# Remove temporary files
34-
RUN rm -rf /opt/build/*
10+
# Load backend IEEE
11+
RUN echo "libinterflop_ieee.so" > $VFC_BACKENDS_FROM_FILE && \
12+
# Install SciPy dependencies
13+
pip3 install joblib pythran pybind11 && \
14+
# Replace gfortran with verificarlo-f
15+
cp /usr/local/bin/verificarlo-f /usr/bin/gfortran && \
16+
# Remove debug flag which makes compilation crash
17+
sed -i "397s/.*/ llvm_options = llvm_options.replace(\"'-g'\",'') if \"'-g'\" in llvm_options else llvm_options/" $(which verificarlo) && \
18+
cd /opt/build/ &&\
19+
wget https://github.com/scipy/scipy/releases/download/v${SCIPY_VERSION}/scipy-${SCIPY_VERSION}.tar.gz &&\
20+
tar xvf scipy-${SCIPY_VERSION}.tar.gz &&\
21+
cd scipy-${SCIPY_VERSION} &&\
22+
CC="verificarlo-c" FC="verificarlo-f" CXX="verificarlo-c++" \
23+
LDSHARED='verificarlo-c -shared' \
24+
CFLAGS="-Wunused-command-line-argument" \
25+
CXXFLAGS="-Wunused-command-line-argument" \
26+
FCFLAGS="-Wunused-command-line-argument" \
27+
LDFLAGS="-Wunused-command-line-argument" \
28+
python3 setup.py build --disable-optimization -j $(nproc) install && \
29+
# Restore original verificarlo
30+
sed -i "397s/ llvm_options = llvm_options.replace(\"'-g'\",'') if \"'-g'\" in llvm_options else llvm_options//" $(which verificarlo) && \
31+
# Set default MCA mode
32+
echo "libinterflop_mca.so -m rr" > $VFC_BACKENDS_FROM_FILE && \
33+
# Sanity check
34+
cd && python3 /tmp/scipy-sanity-check.py && \
35+
rm -rf /opt/build/*
3536

3637
# Restore default behavior for verificarlo's CC
3738
ENV CC "verificarlo-c"
38-
RUN echo "libinterflop_mca_int.so -m rr" > $VFC_BACKENDS_FROM_FILE
3939

4040
ENTRYPOINT [ "/bin/bash"]

0 commit comments

Comments
 (0)