MCPcopy Create free account
hub / github.com/FlashSampling/FlashSampling / naive_method

Function naive_method

benchmarking/hbm-access.py:18–28  ·  view source on GitHub ↗
(vocab_size: int, hidden_size: int, n_hidden_states: int)

Source from the content-addressed store, hash-verified

16
17
18def naive_method(vocab_size: int, hidden_size: int, n_hidden_states: int):
19 n = n_hidden_states
20 m = vocab_size
21 k = hidden_size
22 # first stage: matmul
23 reads1 = m * k + n * k
24 writes1 = m * n
25 # second stage: sampling
26 reads2 = writes1
27 writes2 = n
28 return reads1 + reads2, writes1 + writes2
29
30
31class Args(BaseSettings):

Callers 1

hbm-access.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected