All problems
Throughput Estimate
Problem
Estimate token throughput in tokens per second: batch_size * seq_len / seconds.
The signature is throughput_tokens(batch_size, seq_len, seconds).
Hint
Tokens per step is batch times sequence length.
Test cases
case 1
in: [8,128,2]
expected: 512
case 2
in: [1,1,0.5]
expected: 2
case 3
in: [32,512,4]
expected: 4096
case 4
in: [1,1,3]
expected: 0.3333333333
Starter codePython
def throughput_tokens(batch_size, seq_len, seconds):
# Your code here
pass4 test cases · run your code against them in the editor