MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / assert_valid_partition

Function assert_valid_partition

tests/unit/runtime/utils/test_partition.py:82–88  ·  view source on GitHub ↗
(weights, parts, P)

Source from the content-addressed store, hash-verified

80
81
82def assert_valid_partition(weights, parts, P):
83 N = len(weights)
84 assert len(parts) == P + 1
85 assert parts[0] == 0
86 assert parts[P] == N
87 for idx in range(P):
88 assert parts[idx] <= parts[idx + 1]
89
90
91def get_partition_weights(weights, parts):

Callers 10

test_valid_partitionFunction · 0.85
test_short_partitionFunction · 0.85
test_int_balancedFunction · 0.85
test_float_balancedFunction · 0.85
test_float_lastheavyFunction · 0.85
test_float_midheavyFunction · 0.85
test_balance_bertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected