harmdevries commited on
Commit
622e054
·
1 Parent(s): 1adbed4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -18,15 +18,21 @@ st.header('Query, Key, Value projection')
18
 
19
  mha_flop = 2*bs*n*d*3*d
20
  mha_bytes = 2*bs*n*d + 2*3*d*d + 2*bs*n*3*d
 
 
 
 
 
21
 
22
  st.subheader("Multi-query Attention")
23
  c1, c2 = st.columns([2, 3])
24
- c1.write("FLOP:")
25
  c2.write(str(mha_flop))
26
- c1.write("Bytes: ")
27
  c2.write(str(mha_bytes))
28
  c1.write("Arithm. intensity:")
29
- c2.write(str(mha_flop/mha_bytes))
 
30
 
31
  mqa_flop = 2*bs*n*d*(1+2/h)*d
32
  mqa_bytes = 2*bs*n*d + 2*(2/h)*d*d + 2*bs*n*(2/h)*d
 
18
 
19
  mha_flop = 2*bs*n*d*3*d
20
  mha_bytes = 2*bs*n*d + 2*3*d*d + 2*bs*n*3*d
21
+ mha_int = mha_flop/mha_bytes
22
+
23
+ mha_flop = round(mha_flop/1e9, 2)
24
+ mha_bytes = round(mha_bytes/1e6, 2)
25
+
26
 
27
  st.subheader("Multi-query Attention")
28
  c1, c2 = st.columns([2, 3])
29
+ c1.write("GFLOP:")
30
  c2.write(str(mha_flop))
31
+ c1.write("MB: ")
32
  c2.write(str(mha_bytes))
33
  c1.write("Arithm. intensity:")
34
+ c2.write(str(mha_int))
35
+
36
 
37
  mqa_flop = 2*bs*n*d*(1+2/h)*d
38
  mqa_bytes = 2*bs*n*d + 2*(2/h)*d*d + 2*bs*n*(2/h)*d