BendMlTensorArray.split_pick: def of bend-ml-tensor-array@0.1.19.0 Import: import bend-ml-tensor-array@0.1.19.0/main.bend as BendMlTensorArray Lines 1185-1198 of bend-ml-tensor-array@0.1.19.0/main.bend: https://jend.leeeet.dev/read.txt?path=bend-ml-tensor-array@0.1.19.0/main.bend&start_line=1185&end_line=1198 import Base # ---- the split depth of a product (0.1.11.0): par is an upper bound, and a product too small to gain splits 0 times ---- # # A product of n x k by k x m splits into 2^par blocks only when it does at least 2^23 multiply-adds and each cell of C # sums at least 64 of them; otherwise it runs sequentially. Measured on 16 threads (2026-10-16, 18 shapes): below 2^23 the # split costs more than it saves, and with a short inner dimension (a weight gradient over a few tokens) every split # was 2-3.6x slower, because each block hands its rows of C back as a list that is then written into C, a cost per cell # of C that k multiply-adds per cell do not pay for. The result does not depend on the depth: the same bits at every # depth (tests/t8.bend, tests/acc.bend, tests/split.bend). def split_pick(big: Bool, d: Nat) -> Nat: match big: case True{}: d case False{}: 0n Uses (2): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat