-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New release v0.5.0 - Use verificarlo:v0.5.0 instead of v0.4.1 - Fix issue #34 on vectorized instructions with numpy - Add CHANGELOG - Add verificarlo_version as parameter in Dockerfile files * Add conservative mode in libmath
- Loading branch information
1 parent
4484855
commit 06c8059
Showing
10 changed files
with
157 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# [v0.5.0] 2021/06/18 | ||
|
||
## Changed | ||
* Changed verificarlo version to compile fuzzy images [v0.4.1 -> v0.5.0] | ||
|
||
## Deprecated | ||
* Version v0.4.1 should not be used anymore because it contains a bug | ||
on vectorized instructions. | ||
|
||
# [v0.4.1] 2021/06/18 | ||
|
||
## Added | ||
* Add build script to wrap an existing docker image with the fuzzy-libmath | ||
* Add dockerfile for base3 + sklearn:0.23.2 (base 4) | ||
* Add dockerfile for base2 + scipy:1.5.4 (base 3) | ||
* Add dockerfile for base1 + numpy:1.19.1 (base 2) | ||
* Add dockerfile for base0 + python:3.8.5 (base 1) | ||
* Add dockerfile for fuzzy lapack:3.9.0 + libmath (base 0) | ||
* Add fuzzy libmath project from https://github.com/big-data-lab-team/MCA-libmath | ||
|
||
# [v0] 2021/05/12 | ||
|
||
This release is merely being issued such that the project can begin indexing on Zenodo, and a DOI can be referenced for this project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
FROM verificarlo/fuzzy:v0.4.1-lapack-python3.8.5 | ||
ARG VERIFICARLO_VERSION=v0.5.0 | ||
FROM verificarlo/fuzzy:${VERIFICARLO_VERSION}-lapack-python3.8.5 | ||
|
||
RUN cat /proc/cpuinfo | grep flags | uniq | ||
RUN cat /proc/cpuinfo | grep "model name" | uniq | ||
|
||
|
||
# Unset LD_PRELOAD because it will open VFC_BACKENDS_FROM_FILE | ||
# and causes bug | ||
RUN LD_PRELOAD_OLD=${LD_PRELOAD} | ||
ENV LD_PRELOAD="" | ||
|
||
# Use IEEE mode for compiling with verificarlo | ||
RUN echo "libinterflop_ieee.so" > $VFC_BACKENDS_FROM_FILE | ||
|
@@ -11,22 +21,29 @@ RUN git config --global user.email "[email protected]" &&\ | |
git config --global user.name "Anonymous Patcher" | ||
|
||
# Build numpy from sources and link with the local BLAS and LAPACK | ||
RUN pip3.8 install cython | ||
RUN python3 -m pip install cython | ||
RUN cd /opt/build &&\ | ||
git clone -b v1.19.1 --depth=1 https://github.com/numpy/numpy.git &&\ | ||
cd /opt/build/numpy &&\ | ||
git checkout v1.19.1 &&\ | ||
git am /tmp/numpy-verificarlo.patch &&\ | ||
CFLAGS="--exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument" \ | ||
OPT="--exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument --conservative" \ | ||
FOPT="--exclude-file=/tmp/numpy-vfc-exclude.txt -Wunused-command-line-argument --conservative" \ | ||
NPY_BLAS_ORDER=BLAS NPY_LAPACK_ORDER=LAPACK \ | ||
python3 setup.py config --compiler=verificarlo --fcompiler=verificarlof build_clib \ | ||
--compiler=verificarlo --fcompiler=verificarlof build_ext \ | ||
--compiler=verificarlo --fcompiler=verificarlof build -j 4 install | ||
|
||
# Smoked test for vectorization. | ||
# We should run the full numpy test suit in next versions | ||
RUN python3 -c "import numpy as np; x = np.array(range(4),dtype=np.float64); z=[i**2 for i in range(4)]; assert((x**2==z).all())" | ||
|
||
# Remove temporary files | ||
RUN rm -rf /opt/build/* | ||
|
||
# Restore default MCA mode | ||
RUN echo "libinterflop_mca.so -m rr" > $VFC_BACKENDS_FROM_FILE | ||
|
||
ENV LD_PRELOAD=${LD_PRELOAD_OLD} | ||
|
||
ENTRYPOINT [ "/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,45 @@ | ||
--- verificarlo 2020-12-17 11:27:57.074070576 -0500 | ||
+++ /home/yohan/local/bin/verificarlo 2020-12-16 18:37:46.866142995 -0500 | ||
@@ -294,11 +294,17 @@ | ||
diff --git a/verificarlo.in.in b/verificarlo.in.in | ||
index 14cd655..a9090b8 100644 | ||
--- a/verificarlo.in.in | ||
+++ b/verificarlo.in.in | ||
@@ -136,7 +136,8 @@ def compile_vfcwrapper(source, output, args, emit_llvm=False): | ||
|
||
internal_options = (" -S -emit-llvm " if emit_llvm else "") + \ | ||
f" -c -Wno-varargs -I {mcalib_includes} " | ||
- shell(f'{clang} -O3 -march=native {internal_options} {extra_args} {source} -o {output} ') | ||
+ conservative = '-march=x86-64' if args.conservative else '-march=native' | ||
+ shell(f'{clang} -O3 {conservative} {internal_options} {extra_args} {source} -o {output} ') | ||
|
||
|
||
def linker_mode(sources, options, libraries, output, args): | ||
@@ -204,9 +205,11 @@ def compiler_mode(sources, options, output, args): | ||
compile_only([source], ' -c ' + options, basename_output, args) | ||
continue | ||
|
||
+ conservative = '-march=x86-64' if args.conservative else '' | ||
+ | ||
# Compile to ir (fortran uses flang, c uses clang) | ||
shell( | ||
- f'{compiler} -c -S {debug} {source} {include} -emit-llvm {options} -o {ir.name}') | ||
+ f'{compiler} -c -S {debug} {source} {include} -emit-llvm {options} -o {ir.name} {conservative}') | ||
|
||
selectfunction = "" | ||
if args.function: | ||
@@ -246,7 +249,7 @@ def compiler_mode(sources, options, output, args): | ||
basename_output = output | ||
|
||
# Produce object file | ||
- shell(f'{compiler} -c {basename_output} {ins.name} {options}') | ||
+ shell(f'{compiler} -c {basename_output} {ins.name} {options} {conservative}') | ||
|
||
|
||
if __name__ == "__main__": | ||
@@ -282,6 +285,8 @@ if __name__ == "__main__": | ||
parser.add_argument('--version', action='version', version=PACKAGE_STRING) | ||
parser.add_argument('--linker', choices=linkers.keys(), default=default_linker, | ||
help="linker to use, {dl} by default".format(dl=default_linker)) | ||
+ parser.add_argument('--disable-debug-flag', action="store_true", | ||
+ help="Remove -g from the flag since it can cause error with flang") | ||
+ parser.add_argument( | ||
+ '--conservative', action='store_true', help='conservative') | ||
|
||
args, other = parser.parse_known_args() | ||
|
||
sources, llvm_options = parse_extra_args(other) | ||
|
||
+ if args.disable_debug_flag: | ||
+ if "-g" in llvm_options: | ||
+ llvm_options = llvm_options.replace("-g", "") | ||
+ | ||
# check input files | ||
if (args.E or args.S or args.c) and len(sources) > 1 and args.o: | ||
fail('cannot specify -o when generating multiple output files') |
Oops, something went wrong.