Skip to content

Commit b7dec57

Browse files
committed
add rope benchmarks
1 parent b7b5e26 commit b7dec57

16 files changed

+29
-28
lines changed

benchmark/benchmark_geglu.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def full():
9090
full, quantiles=QUANTILES, grad_to_none=[x], rep=10
9191
)
9292

93-
return ms, max_ms, min_ms
93+
return ms, min_ms, max_ms
9494

9595

9696
def benchmark_speed_geglu_wrapper():

benchmark/benchmark_rope.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def full():
109109
ms, min_ms, max_ms = triton.testing.do_bench(
110110
full, quantiles=QUANTILES, grad_to_none=[q, k], rep=400
111111
)
112-
return ms, max_ms, min_ms
112+
return ms, min_ms, max_ms
113113

114114

115115
def benchmark_speed_rope_wrapper():
@@ -158,8 +158,9 @@ def full():
158158
(q_out, k_out), (q, k), (dq, dk), allow_unused=True, retain_graph=True
159159
)
160160

161-
mem = _test_memory(full)
162-
return mem / 2**20
161+
mem, min_mem, max_mem = _test_memory(full, quantiles=QUANTILES)
162+
return (mem / 2**20, min_mem / 2**20, max_mem / 2**20)
163+
163164

164165

165166
def benchmark_memory_rope_wrapper():
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
total_hidden_size,Liger,Hugging Face
2-
512.000000,0.046912,0.153600
3-
2048.000000,0.021344,0.189792
4-
8192.000000,0.058720,0.619296
2+
512.000000,0.048880,0.173376
3+
2048.000000,0.050368,0.190304
4+
8192.000000,0.058784,0.621280
Loading
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
seq_len,Liger,Hugging Face
2-
1024.000000,0.033824,0.328864
3-
2048.000000,0.059200,0.619296
4-
4096.000000,0.109568,1.186832
5-
8192.000000,0.209344,2.317760
6-
16384.000000,0.410304,4.547232
2+
1024.000000,0.033760,0.329920
3+
2048.000000,0.058784,0.621312
4+
4096.000000,0.109664,1.189088
5+
8192.000000,0.210016,2.320608
6+
16384.000000,0.409984,4.549056
Loading
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
total_hidden_size,Liger,Hugging Face
2-
512.000000,0.010272,0.078816
3-
2048.000000,0.021184,0.156160
4-
8192.000000,0.059232,0.512704
2+
512.000000,0.011360,0.078816
3+
2048.000000,0.020576,0.157344
4+
8192.000000,0.058720,0.516448
Loading
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
seq_len,Liger,Hugging Face
2-
1024.000000,0.033536,0.277696
3-
2048.000000,0.058528,0.512928
4-
4096.000000,0.109504,0.986304
5-
8192.000000,0.209920,1.920208
6-
16384.000000,0.409840,3.790624
2+
1024.000000,0.034240,0.280288
3+
2048.000000,0.059296,0.516512
4+
4096.000000,0.109056,0.993184
5+
8192.000000,0.209376,1.933456
6+
16384.000000,0.410464,3.816672
Loading
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
total_hidden_size,Liger,Hugging Face
2-
512.000000,0.120384,0.350336
3-
2048.000000,0.122208,0.341728
4-
8192.000000,0.115936,1.128096
2+
512.000000,0.159264,0.429248
3+
2048.000000,0.158368,0.342784
4+
8192.000000,0.114720,1.134144
Loading
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
seq_len,Liger,Hugging Face
2-
1024.000000,0.120064,0.601600
3-
2048.000000,0.114944,1.127872
4-
4096.000000,0.214656,2.167280
5-
8192.000000,0.415552,4.232288
6-
16384.000000,0.816928,8.331616
2+
1024.000000,0.109088,0.605088
3+
2048.000000,0.114336,1.134048
4+
4096.000000,0.214880,2.176800
5+
8192.000000,0.415680,4.246112
6+
16384.000000,0.816704,8.356367
Loading

0 commit comments

Comments
 (0)