Matmul.splits: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matmul Lines 336-343 of bendtorch-core@0.1.0.0/src/tensor/matmul.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&start_line=336&end_line=343 import Base # Split by work, not by cell count: a cell costs one term per inner index. # The build forks until a subtree holds about 2^13 terms, and at most six # levels, 64 subtrees, each with its own copy of both inputs: an output of # 2^depth cells of `inner` terms forks depth + log2(inner) - 13 levels. On # medusa2 at 8 threads a product of 2^15 terms or more ran faster with every # extra level up to six, and forking cost nothing measurable on one thread. def splits(+depth: Nat, +inner: Nat) -> Nat: at_most(at_most(Nat.sub(Nat.add(depth, halvings(inner, inner)), 13n), 6n), depth) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=at_most https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=halvings