Function
our_method
(vocab_size: int, hidden_size: int, n_hidden_states: int)
Source from the content-addressed store, hash-verified
| 5 | |
| 6 | |
| 7 | def our_method(vocab_size: int, hidden_size: int, n_hidden_states: int): |
| 8 | m = vocab_size |
| 9 | n = n_hidden_states |
| 10 | k = hidden_size |
| 11 | # theory: fused matmul + reduction |
| 12 | # we write only bsz results back to HBM |
| 13 | reads = m * k + n * k |
| 14 | writes = n |
| 15 | return reads, writes |
| 16 | |
| 17 | |
| 18 | def naive_method(vocab_size: int, hidden_size: int, n_hidden_states: int): |
Tested by
no test coverage detected