Skip to content
DeepForgeby svx
All problems
EasyDeep Learningdl-188

Draft Model Size Ratio

Problem

Compute the parameter ratio between a speculative draft model and its target model: draft_params / target_params.

The signature is draft_size_ratio(draft_params, target_params).

Hint

Small draft models are cheap to run repeatedly and are verified in parallel by the target.

Test cases

case 1
in: [1000000,10000000]
expected: 0.1
case 2
in: [0,1]
expected: 0
case 3
in: [1,2]
expected: 0.5
case 4
in: [5000000,5000000]
expected: 1
Starter codePython
def draft_size_ratio(draft_params, target_params):
    # Your code here
    pass

4 test cases · run your code against them in the editor