Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anonymizing code #50

Merged
merged 1 commit into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions enzyme/Enzyme/ActiveVariable.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
/*
* ActiveVariable.cpp - Active Varaible Detection Utilities
*
* Copyright (C) 2019 William S. Moses (enzyme@wsmoses.com) - All Rights Reserved
* Copyright (C) 2020 Anonymous Author(s) - All Rights Reserved
*
* For commercial use of this code please contact the author(s) above.
*
* For research use of the code please use the following citation.
*
* \misc{mosesenzyme,
author = {William S. Moses, Tim Kaler},
title = {Enzyme: LLVM Automatic Differentiation},
year = {2019},
howpublished = {\url{https://github.com/wsmoses/Enzyme/}},
note = {commit xxxxxxx}
*/

#include <cstdint>
Expand Down
11 changes: 1 addition & 10 deletions enzyme/Enzyme/ActiveVariable.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
/*
* ActiveVariable.h - Active Varaible Detection Utilities
*
* Copyright (C) 2019 William S. Moses (enzyme@wsmoses.com) - All Rights Reserved
* Copyright (C) 2020 Anonymous Author(s) - All Rights Reserved
*
* For commercial use of this code please contact the author(s) above.
*
* For research use of the code please use the following citation.
*
* \misc{mosesenzyme,
author = {William S. Moses, Tim Kaler},
title = {Enzyme: LLVM Automatic Differentiation},
year = {2019},
howpublished = {\url{https://github.com/wsmoses/Enzyme/}},
note = {commit xxxxxxx}
*/
#ifndef ENZYME_ACTIVE_VAR_H
#define ENZYME_ACTIVE_VAR_H 1
Expand Down
13 changes: 2 additions & 11 deletions enzyme/Enzyme/Enzyme.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
/*
* Enzyme.cpp - Lower autodiff intrinsic
* Enzyme.cpp - Lower Enzyme calls
*
* Copyright (C) 2019 William S. Moses (enzyme@wsmoses.com) - All Rights Reserved
* Copyright (C) 2020 Anonymous Author(s) - All Rights Reserved
*
* For commercial use of this code please contact the author(s) above.
*
* For research use of the code please use the following citation.
*
* \misc{mosesenzyme,
author = {William S. Moses, Tim Kaler},
title = {Enzyme: LLVM Automatic Differentiation},
year = {2019},
howpublished = {\url{https://github.com/wsmoses/Enzyme/}},
note = {commit xxxxxxx}
*/

#include "SCEV/ScalarEvolutionExpander.h"
Expand Down
11 changes: 1 addition & 10 deletions enzyme/Enzyme/EnzymeLogic.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
/*
* EnzymeLogic.cpp
*
* Copyright (C) 2019 William S. Moses (enzyme@wsmoses.com) - All Rights Reserved
* Copyright (C) 2020 Anonymous Author(s) - All Rights Reserved
*
* For commercial use of this code please contact the author(s) above.
*
* For research use of the code please use the following citation.
*
* \misc{mosesenzyme,
author = {William S. Moses, Tim Kaler},
title = {Enzyme: LLVM Automatic Differentiation},
year = {2019},
howpublished = {\url{https://github.com/wsmoses/Enzyme/}},
note = {commit xxxxxxx}
*/

#include "EnzymeLogic.h"
Expand Down
11 changes: 1 addition & 10 deletions enzyme/Enzyme/EnzymeLogic.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
/*
* EnzymeLogic.h
*
* Copyright (C) 2019 William S. Moses (enzyme@wsmoses.com) - All Rights Reserved
* Copyright (C) 2020 Anonymous Author(s) - All Rights Reserved
*
* For commercial use of this code please contact the author(s) above.
*
* For research use of the code please use the following citation.
*
* \misc{mosesenzyme,
author = {William S. Moses, Tim Kaler},
title = {Enzyme: LLVM Automatic Differentiation},
year = {2019},
howpublished = {\url{https://github.com/wsmoses/Enzyme/}},
note = {commit xxxxxxx}
*/

#ifndef ENZYME_LOGIC_H
Expand Down
11 changes: 1 addition & 10 deletions enzyme/Enzyme/FunctionUtils.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
/*
* FunctionUtils.cpp
*
* Copyright (C) 2019 William S. Moses (enzyme@wsmoses.com) - All Rights Reserved
* Copyright (C) 2020 Anonymous Author(s) - All Rights Reserved
*
* For commercial use of this code please contact the author(s) above.
*
* For research use of the code please use the following citation.
*
* \misc{mosesenzyme,
author = {William S. Moses, Tim Kaler},
title = {Enzyme: LLVM Automatic Differentiation},
year = {2019},
howpublished = {\url{https://github.com/wsmoses/Enzyme/}},
note = {commit xxxxxxx}
*/

#include "FunctionUtils.h"
Expand Down
11 changes: 1 addition & 10 deletions enzyme/Enzyme/FunctionUtils.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
/*
* FunctionUtils.h
*
* Copyright (C) 2019 William S. Moses (enzyme@wsmoses.com) - All Rights Reserved
* Copyright (C) 2020 Anonymous Author(s) - All Rights Reserved
*
* For commercial use of this code please contact the author(s) above.
*
* For research use of the code please use the following citation.
*
* \misc{mosesenzyme,
author = {William S. Moses, Tim Kaler},
title = {Enzyme: LLVM Automatic Differentiation},
year = {2019},
howpublished = {\url{https://github.com/wsmoses/Enzyme/}},
note = {commit xxxxxxx}
*/

#ifndef ENZYME_FUNCTION_UTILS_H
Expand Down
11 changes: 1 addition & 10 deletions enzyme/Enzyme/GradientUtils.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
/*
* GradientUtils.cpp - Gradient Utility data structures and functions
*
* Copyright (C) 2019 William S. Moses (enzyme@wsmoses.com) - All Rights Reserved
* Copyright (C) 2020 Anonymous Author(s) - All Rights Reserved
*
* For commercial use of this code please contact the author(s) above.
*
* For research use of the code please use the following citation.
*
* \misc{mosesenzyme,
author = {William S. Moses, Tim Kaler},
title = {Enzyme: LLVM Automatic Differentiation},
year = {2019},
howpublished = {\url{https://github.com/wsmoses/Enzyme/}},
note = {commit xxxxxxx}
*/

#include "GradientUtils.h"
Expand Down
12 changes: 1 addition & 11 deletions enzyme/Enzyme/GradientUtils.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@

/*
* GradientUtils.h - Gradient Utility data structures and functions
*
* Copyright (C) 2019 William S. Moses (enzyme@wsmoses.com) - All Rights Reserved
* Copyright (C) 2020 Anonymous Author(s) - All Rights Reserved
*
* For commercial use of this code please contact the author(s) above.
*
* For research use of the code please use the following citation.
*
* \misc{mosesenzyme,
author = {William S. Moses, Tim Kaler},
title = {Enzyme: LLVM Automatic Differentiation},
year = {2019},
howpublished = {\url{https://github.com/wsmoses/Enzyme/}},
note = {commit xxxxxxx}
*/

#ifndef ENZYME_GUTILS_H_
Expand Down
11 changes: 1 addition & 10 deletions enzyme/Enzyme/LibraryFuncs.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
/*
* LibraryFuncs.h - Library Function Utilities
*
* Copyright (C) 2019 William S. Moses (enzyme@wsmoses.com) - All Rights Reserved
* Copyright (C) 2020 Anonymous Author(s) - All Rights Reserved
*
* For commercial use of this code please contact the author(s) above.
*
* For research use of the code please use the following citation.
*
* \misc{mosesenzyme,
author = {William S. Moses, Tim Kaler},
title = {Enzyme: LLVM Automatic Differentiation},
year = {2019},
howpublished = {\url{https://github.com/wsmoses/Enzyme/}},
note = {commit xxxxxxx}
*/

#ifndef LIBRARYFUNCS_H_
Expand Down
11 changes: 1 addition & 10 deletions enzyme/Enzyme/TypeAnalysis.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
/*
* TypeAnalysis.cpp - Type Analysis Detection Utilities
*
* Copyright (C) 2019 William S. Moses (enzyme@wsmoses.com) - All Rights Reserved
* Copyright (C) 2020 Anonymous Author(s) - All Rights Reserved
*
* For commercial use of this code please contact the author(s) above.
*
* For research use of the code please use the following citation.
*
* \misc{mosesenzyme,
author = {William S. Moses, Tim Kaler},
title = {Enzyme: LLVM Automatic Differentiation},
year = {2019},
howpublished = {\url{https://github.com/wsmoses/Enzyme/}},
note = {commit xxxxxxx}
*/


Expand Down
11 changes: 1 addition & 10 deletions enzyme/Enzyme/TypeAnalysis.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
/*
* TypeAnalysis.h - Type Analysis Detection Utilities
*
* Copyright (C) 2019 William S. Moses (enzyme@wsmoses.com) - All Rights Reserved
* Copyright (C) 2020 Anonymous Author(s) - All Rights Reserved
*
* For commercial use of this code please contact the author(s) above.
*
* For research use of the code please use the following citation.
*
* \misc{mosesenzyme,
author = {William S. Moses, Tim Kaler},
title = {Enzyme: LLVM Automatic Differentiation},
year = {2019},
howpublished = {\url{https://github.com/wsmoses/Enzyme/}},
note = {commit xxxxxxx}
*/

#ifndef ENZYME_TYPE_ANALYSIS_H
Expand Down
11 changes: 1 addition & 10 deletions enzyme/Enzyme/Utils.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
/*
* Utils.cpp
*
* Copyright (C) 2019 William S. Moses (enzyme@wsmoses.com) - All Rights Reserved
* Copyright (C) 2020 Anonymous Author(s) - All Rights Reserved
*
* For commercial use of this code please contact the author(s) above.
*
* For research use of the code please use the following citation.
*
* \misc{mosesenzyme,
author = {William S. Moses, Tim Kaler},
title = {Enzyme: LLVM Automatic Differentiation},
year = {2019},
howpublished = {\url{https://github.com/wsmoses/Enzyme/}},
note = {commit xxxxxxx}
*/

#include "Utils.h"
Expand Down
11 changes: 1 addition & 10 deletions enzyme/Enzyme/Utils.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
/*
* Utils.h
*
* Copyright (C) 2019 William S. Moses (enzyme@wsmoses.com) - All Rights Reserved
* Copyright (C) 2020 Anonymous Author(s) - All Rights Reserved
*
* For commercial use of this code please contact the author(s) above.
*
* For research use of the code please use the following citation.
*
* \misc{mosesenzyme,
author = {William S. Moses, Tim Kaler},
title = {Enzyme: LLVM Automatic Differentiation},
year = {2019},
howpublished = {\url{https://github.com/wsmoses/Enzyme/}},
note = {commit xxxxxxx}
*/

#ifndef ENZYME_UTILS_H
Expand Down
6 changes: 1 addition & 5 deletions enzyme/bench/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ OPT=../../build/bin/opt
$(CLANG) -fno-unroll-loops $^ -O1 -fno-vectorize -fno-slp-vectorize -S -emit-llvm -o - -ffast-math -o $@

%-unopt.ll: %.cpp
#$(CLANG)++ -fno-exceptions -fno-use-cxa-atexit -fno-unroll-loops $^ -O0 -fno-vectorize -fno-slp-vectorize -S -emit-llvm -o $@ -ffast-math -Wno-error=non-pod-varargs -DEIGEN_UNROLLING_LIMIT=0 -I/home/wmoses/autodiff/adept-2.0.5/include #-ggdb
$(CLANG)++ -std=c++2a -fno-exceptions -fno-use-cxa-atexit -fno-unroll-loops $^ -O1 -fno-vectorize -fno-slp-vectorize -S -emit-llvm -o $@ -ffast-math -Wno-error=non-pod-varargs -DEIGEN_UNROLLING_LIMIT=0 -I/home/wmoses/autodiff/adept-2.0.5/include #-ggdb
#$(CLANG)++ -fno-exceptions -fno-use-cxa-atexit -fno-unroll-loops $^ -O3 -fno-vectorize -fno-slp-vectorize -S -emit-llvm -o $@ -ffast-math -Wno-error=non-pod-varargs -DEIGEN_UNROLLING_LIMIT=0 -I/home/wmoses/autodiff/adept-2.0.5/include #-ggdb
#$(CLANG)++ -fno-exceptions -fno-use-cxa-atexit -fno-unroll-loops $^ -O3 -fno-vectorize -fno-slp-vectorize -S -emit-llvm -o $@ -ffast-math -Wno-error=non-pod-varargs -DEIGEN_UNROLLING_LIMIT=0 -I/home/wmoses/autodiff/adept-2.0.5/include -march=atom #-ggdb
#$(CLANG)++ -fno-exceptions -fno-unroll-loops $^ -O3 -fno-vectorize -fno-slp-vectorize -S -emit-llvm -o $@ -ffast-math -Wno-error=non-pod-varargs -DEIGEN_UNROLLING_LIMIT=0 -I/home/wmoses/autodiff/adept-2.0.5/include -ggdb
$(CLANG)++ -std=c++2a -fno-exceptions -fno-use-cxa-atexit -fno-unroll-loops $^ -O1 -fno-vectorize -fno-slp-vectorize -S -emit-llvm -o $@ -ffast-math -Wno-error=non-pod-varargs -DEIGEN_UNROLLING_LIMIT=0

%-preopt.ll: %-unopt.ll
$(OPT) $^ -indvars $(LOADSO) -enzyme -mem2reg -sroa -early-cse-memssa -adce -bdce -simplifycfg -inline -adce -aggressive-instcombine -O2 -S -o $@
Expand Down
1 change: 0 additions & 1 deletion enzyme/benchmarks/ba/Makefile.make
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ clean:
#opt $^ -O2 -o $@ -S

ba.o: ba-opt.ll
#clang++ $^ -o $@ -lblas $(BENCHLINK)
clang++ -O2 $^ -o $@ -lblas $(BENCHLINK)

results.txt: ba.o
Expand Down
23 changes: 23 additions & 0 deletions enzyme/benchmarks/ba/Makefile.makeafter
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# RUN: cd %desired_wd/ba && LD_LIBRARY_PATH="%bldpath:$LD_LIBRARY_PATH" BENCH="%bench" BENCHLINK="%blink" LOAD="%loadEnzyme" make -B ba-unopt.ll ba-raw.ll resultsafter.txt -f %s

.PHONY: clean

clean:
rm -f *.ll *.o resultsafter.txt

%-unopt.ll: %.cpp
#clang++ $(BENCH) $^ -O2 -fno-vectorize -fno-slp-vectorize -ffast-math -fno-unroll-loops -Xclang -new-struct-path-tbaa -o $@ -S -emit-llvm
clang++ $(BENCH) $^ -O1 -Xclang -disable-llvm-passes -fno-vectorize -fno-slp-vectorize -ffast-math -fno-unroll-loops -Xclang -new-struct-path-tbaa -o $@ -S -emit-llvm

%-raw.ll: %-unopt.ll
opt $^ $(LOAD) -enzyme -o $@ -S

%-opt.ll: %-raw.ll
#opt $^ -o $@ -S
opt $^ -O2 -o $@ -S

ba.o: ba-opt.ll
clang++ -O2 $^ -o $@ -lblas $(BENCHLINK)

resultsafter.txt: ba.o
./$^ | tee $@
45 changes: 45 additions & 0 deletions enzyme/benchmarks/cleantest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

BENCHDIR="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"

# install dependencies
sudo apt update -y
sudo apt install gcc g++ gfortran cmake libboost-all-dev python autoconf libblas-dev -y

# Disable hyperthreading/etc
cd "$BENCHDIR"
sudo ./hyper.sh

# Build LLVM 8
git clone https://github.com/llvm/llvm-project -b release/8.x ~/llvm-project
cd ~/llvm-project
mkdir build
cd build
cmake ../llvm -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release
make -j16

# Build Enzyme
cd "$BENCHDIR"/..
mkdir build
cd build
cmake .. -DLLVM_DIR="$HOME/llvm-project/build/lib/cmake/llvm" -DLLVM_EXTERNAL_LIT="$HOME/llvm-project/build/bin/llvm-lit"
make -j16

make bench-ba bench-lstm bench-gmm bench-odeconst bench-ode bench-fft bench-odereal

cd "$BENCHDIR"
#echo "Pre optimization"
#./getdata.sh

for z in ba lstm gmm ode-const ode fft ode-real;
do
cp $z/Makefile.makeafter $z/Makefile.make
done

cd "$BENCHDIR"/../build
make bench-ba bench-lstm bench-gmm bench-odeconst bench-ode bench-fft bench-odereal

#echo "Post optimization"
#cd "$BENCHDIR"
#./getdataafter.sh

3 changes: 1 addition & 2 deletions enzyme/benchmarks/fft/Makefile.make
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ clean:

%-opt.ll: %-raw.ll
opt $^ -o $@ -S
#opt-8 $^ -O2 -o $@ -S
#opt $^ -O2 -o $@ -S

fft.o: fft-opt.ll
#clang++ $^ -o $@ -lblas $(BENCHLINK)
clang++ -O2 $^ -o $@ -lblas $(BENCHLINK)

results.txt: fft.o
Expand Down
Loading