harmdevries commited on
Commit
f86ffab
·
1 Parent(s): f98bc09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -7,6 +7,21 @@ d = st.number_input('Dimension: ', value=768)
7
  n = st.number_input('Seq length: ', value=1024)
8
 
9
  st.header('Query, Key, Value projection')
 
10
  mha_flop = 2*bs*n*d*3*d
11
  mha_bytes = 2*bs*n*d + 2*3*d*d + 2*bs*n*3*d
12
- st.write()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  n = st.number_input('Seq length: ', value=1024)
8
 
9
  st.header('Query, Key, Value projection')
10
+
11
  mha_flop = 2*bs*n*d*3*d
12
  mha_bytes = 2*bs*n*d + 2*3*d*d + 2*bs*n*3*d
13
+
14
+ st.write("Multi-query Attention")
15
+ st.write("FLOP: " + mha_flop)
16
+ st.write("bytes: " + mha_bytes)
17
+ st.write("Arithm. intensity:" + (mha_flop/mha_bytes))
18
+
19
+ mqa_flop = 2*bs*n*d*(1+2/h)*d
20
+ mqa_bytes = 2*bs*n*d + 2*(2/h)*d*d + 2*bs*n*(2/h)*d
21
+
22
+ st.write("Multi-query Attention")
23
+ st.write("FLOP: " + mqa_flop)
24
+ st.write("bytes: " + mqa_bytes)
25
+ st.write("Arithm. intensity:" + (mqa_flop/mqa_bytes))
26
+
27
+ st.header('Query, Key, Value projection')