Skip to content
DeepForgeby svx
All problems
EasyDeep Learningdl-285

Per-Channel Scale Count

Problem

Count per-channel, per-group quantization scales for a weight matrix: out_features * ceil(in_features / group_size).

The signature is per_channel_scale_count(out_features, in_features, group_size). Return an integer.

Hint

Group size 128 is the common sweet spot between accuracy and scale overhead.

Test cases

case 1
in: [4096,4096,128]
expected: 131072
case 2
in: [4096,4096,4096]
expected: 4096
case 3
in: [8,16,4]
expected: 32
case 4
in: [1,1,1]
expected: 1
Starter codePython
def per_channel_scale_count(out_features, in_features, group_size):
    # Your code here
    pass

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