Skip to content

Commit 46088a0

Browse files
committed
Add LSTM benchmarking code.
1 parent f4342a3 commit 46088a0

File tree

5 files changed

+801
-3
lines changed

5 files changed

+801
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
*.o
33
*.so
44
*.whl
5+
benchmark_lstm
56
haste_lstm
67
haste_gru

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ LOCAL_CFLAGS := -I/usr/include/eigen3 -I/usr/local/cuda/include -Ilib -O3
77
LOCAL_LDFLAGS := -L/usr/local/cuda/lib64 -L. -lcudart -lcublas
88

99
# Small enough project that we can just recompile all the time.
10-
.PHONY: all haste haste_tf examples clean
10+
.PHONY: all haste haste_tf examples benchmarks clean
1111

12-
all: haste haste_tf examples
12+
all: haste haste_tf examples benchmarks
1313

1414
haste:
1515
$(NVCC) -std=c++11 -arch=sm_60 -c lib/lstm_forward_gpu.cu.cc -o lib/lstm_forward_gpu.o -x cu -Xcompiler -fPIC $(LOCAL_CFLAGS)
@@ -35,6 +35,9 @@ examples: haste
3535
$(CXX) -std=c++11 examples/lstm.cc libhaste.a $(LOCAL_CFLAGS) $(LOCAL_LDFLAGS) -o haste_lstm -Wno-ignored-attributes
3636
$(CXX) -std=c++11 examples/gru.cc libhaste.a $(LOCAL_CFLAGS) $(LOCAL_LDFLAGS) -o haste_gru -Wno-ignored-attributes
3737

38+
benchmarks: haste
39+
$(CXX) -std=c++11 benchmarks/benchmark_lstm.cc libhaste.a $(LOCAL_CFLAGS) $(LOCAL_LDFLAGS) -o benchmark_lstm -Wno-ignored-attributes -lcudnn
40+
3841
clean:
39-
rm -fr haste_lstm haste_gru build haste_*.whl
42+
rm -fr benchmark_lstm haste_lstm haste_gru build haste_*.whl
4043
find . \( -iname '*.o' -o -iname '*.so' -o -iname '*.a' \) -delete

0 commit comments

Comments
 (0)