Skip to content
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
4 changes: 2 additions & 2 deletions enzyme/benchmarks/ReverseMode/adbench/gmm.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ int main(const int argc, const char* argv[]) {

struct GMMOutput result = { 0, std::vector<double>(Jcols) };

if (0) {
if (1) {
try {
struct timeval start, end;
gettimeofday(&start, NULL);
Expand Down Expand Up @@ -350,7 +350,7 @@ int main(const int argc, const char* argv[]) {
test_suite["tools"].push_back(enzyme);
}
}

{

struct GMMInput input;
Expand Down
8 changes: 4 additions & 4 deletions enzyme/benchmarks/ReverseMode/adbench/lstm.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ int main(const int argc, const char* argv[]) {

std::vector<std::string> paths = { "lstm_l2_c1024.txt", "lstm_l4_c1024.txt", "lstm_l2_c4096.txt", "lstm_l4_c4096.txt" };
//std::vector<std::string> paths = { "lstm_l4_c4096.txt" };

std::ofstream jsonfile("results.json", std::ofstream::trunc);
json test_results;

Expand Down Expand Up @@ -289,7 +289,7 @@ int main(const int argc, const char* argv[]) {

}

if (0){
if (1){

struct LSTMInput input = {};

Expand Down Expand Up @@ -385,7 +385,7 @@ int main(const int argc, const char* argv[]) {
enzyme["result"].push_back(result.gradient[i]);
}
test_suite["tools"].push_back(enzyme);

printf("\n");
}
}
Expand Down Expand Up @@ -418,7 +418,7 @@ int main(const int argc, const char* argv[]) {
enzyme["result"].push_back(result.gradient[i]);
}
test_suite["tools"].push_back(enzyme);

printf("\n");
}

Expand Down
2 changes: 2 additions & 0 deletions enzyme/benchmarks/ReverseMode/ba/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ lto = "fat"

[dependencies]
libm = { version = "0.2.8", optional = true }

[workspace]
2 changes: 1 addition & 1 deletion enzyme/benchmarks/ReverseMode/ba/Makefile.make
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: cd %S && LD_LIBRARY_PATH="%bldpath:$LD_LIBRARY_PATH" PTR="%ptr" BENCH="%bench" BENCHLINK="%blink" LOAD="%loadEnzyme" LOADCLANG="%loadClangEnzyme" ENZYME="%enzyme" make -B ba-raw.ll results.json -f %s
# RUN: cd %S && LD_LIBRARY_PATH="%bldpath:$LD_LIBRARY_PATH" PTR="%ptr" BENCH="%bench" BENCHLINK="%blink" LOAD="%loadEnzyme" LOADCLANG="%loadClangEnzyme" ENZYME="%enzyme" make -B results.json -f %s

.PHONY: clean

Expand Down
2 changes: 2 additions & 0 deletions enzyme/benchmarks/ReverseMode/fft/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ strip = true

[profile.dev]
lto = "fat"

[workspace]
2 changes: 2 additions & 0 deletions enzyme/benchmarks/ReverseMode/gmm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ lto = "fat"

[dependencies]
libm = { version = "0.2.8", optional = true }

[workspace]
18 changes: 6 additions & 12 deletions enzyme/benchmarks/ReverseMode/gmm/src/safe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ fn lgamma(x: f64) -> f64 {

#[no_mangle]
pub extern "C" fn rust_dgmm_objective(
d: i32,
k: i32,
n: i32,
d: usize,
k: usize,
n: usize,
alphas: *const f64,
dalphas: *mut f64,
means: *const f64,
Expand All @@ -33,9 +33,6 @@ pub extern "C" fn rust_dgmm_objective(
err: *mut f64,
derr: *mut f64,
) {
let k = k as usize;
let n = n as usize;
let d = d as usize;
let alphas = unsafe { std::slice::from_raw_parts(alphas, k) };
let means = unsafe { std::slice::from_raw_parts(means, k * d) };
let icf = unsafe { std::slice::from_raw_parts(icf, k * d * (d + 1) / 2) };
Expand Down Expand Up @@ -85,19 +82,16 @@ pub extern "C" fn rust_dgmm_objective(

#[no_mangle]
pub extern "C" fn rust_gmm_objective(
d: i32,
k: i32,
n: i32,
d: usize,
k: usize,
n: usize,
alphas: *const f64,
means: *const f64,
icf: *const f64,
x: *const f64,
wishart: *const Wishart,
err: *mut f64,
) {
let k = k as usize;
let n = n as usize;
let d = d as usize;
let alphas = unsafe { std::slice::from_raw_parts(alphas, k) };
let means = unsafe { std::slice::from_raw_parts(means, k * d) };
let icf = unsafe { std::slice::from_raw_parts(icf, k * d * (d + 1) / 2) };
Expand Down
2 changes: 2 additions & 0 deletions enzyme/benchmarks/ReverseMode/lstm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ strip = true

[profile.dev]
lto = "fat"

[workspace]
3 changes: 1 addition & 2 deletions enzyme/benchmarks/ReverseMode/lstm/Makefile.make
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: cd %S && LD_LIBRARY_PATH="%bldpath:$LD_LIBRARY_PATH" PTR="%ptr" BENCH="%bench" BENCHLINK="%blink" LOAD="%loadEnzyme" LOADCLANG="%loadClangEnzyme" ENZYME="%enzyme" make -B lstm-raw.ll results.json -f %s
# RUN: cd %S && LD_LIBRARY_PATH="%bldpath:$LD_LIBRARY_PATH" PTR="%ptr" BENCH="%bench" BENCHLINK="%blink" LOAD="%loadEnzyme" LOADCLANG="%loadClangEnzyme" ENZYME="%enzyme" make -B results.json -f %s

.PHONY: clean

Expand Down Expand Up @@ -41,7 +41,6 @@ $(dir)/benchmarks/ReverseMode/lstm/target/release/liblstm.a: src/lib.rs Cargo.to

lstm.o: lstm-opt.ll $(dir)/benchmarks/ReverseMode/lstm/target/release/liblstm.a
$(CLANG) -pthread -O3 $^ -o $@ $(BENCHLINK) -lm
#$(CLANG) -pthread -O3 -fno-math-errno $^ -o $@ $(BENCHLINK) -lm

results.json: lstm.o
numactl -C 1 ./$^
2 changes: 2 additions & 0 deletions enzyme/benchmarks/ReverseMode/ode-real/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ strip = true

[profile.dev]
lto = "fat"

[workspace]
2 changes: 1 addition & 1 deletion enzyme/benchmarks/ReverseMode/ode-real/Makefile.make
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: cd %S && LD_LIBRARY_PATH="%bldpath:$LD_LIBRARY_PATH" PTR="%ptr" BENCH="%bench" BENCHLINK="%blink" LOAD="%loadEnzyme" ENZYME="%enzyme" make -B ode-raw.ll ode-opt.ll results.json VERBOSE=1 -f %s
# RUN: cd %S && LD_LIBRARY_PATH="%bldpath:$LD_LIBRARY_PATH" PTR="%ptr" BENCH="%bench" BENCHLINK="%blink" LOAD="%loadEnzyme" ENZYME="%enzyme" make -B results.json VERBOSE=1 -f %s

.PHONY: clean

Expand Down
Loading