Skip to content

1.2: Shape schemes

Latest

Choose a tag to compare

@lukstafi lukstafi released this 06 Nov 17:15
· 1656 commits to master since this release
c3e5975

From the README:

  • 1.2 (released November 6, 2026): Reusable, checked tensor programs.
    • A %op function gets a shape scheme, traced once and checked at every application: a contradictory application is refused before the body runs, naming the function and the argument, and an error no argument can fix is refused at the definition (gh-ocannl-404, gh-ocannl-1751). Tensor.checkpoint and rewind put back the open inference session, so a failed construction rewinds in a live session (gh-ocannl-903). Of the 14 refused programs in the error catalogue, 6 report earlier and none later.
    • Shape inference is 8–34× faster on depth-16 stacks, schemes or not (gh-ocannl-1802, gh-ocannl-1904, gh-ocannl-1891). Schemes only check: they cost about 2× on block stacks and 5× on a decoder, and did not make inference cheaper (gh-ocannl-1752).
    • Dropped graphs give their memory back (gh-ocannl-1745, gh-ocannl-1747, gh-ocannl-1762). Gradient compositions and writes that were silently wrong are refused (gh-ocannl-1744, gh-ocannl-1781, gh-ocannl-1876), and a family of silent inlining, mixed-precision and integer miscomputes is fixed (gh-ocannl-1953, gh-ocannl-1866, gh-ocannl-1884).
    • %cd statements now run in source order (gh-ocannl-1770), and Nn_blocks' ~train_step is a Tensor.t option (gh-ocannl-1792). The untuned cifar_resnet cc step is about 25% cheaper with bitwise-identical results (gh-ocannl-1630). Winograd's data gradient was tried and reverted, and pinned staging did not pay.

From the changelog:

Reusable, checked tensor programs. A %op function now gets a shape scheme, traced once and
checked at every application: a contradictory application is refused before its body runs,
naming the function and the argument, an error no argument can fix is refused at the
definition, and a failed construction rewinds in a live session. Of the 14 refused programs in
the error catalogue, 6 report in an earlier phase and none later. Shape inference itself got
8–34× faster on depth-16 stacks, schemes or not (one shared-box session, cc, M4 Max). Beyond the
milestone, among 183 issues completed: dropped graphs give their memory back, gradient
compositions and writes that were silently wrong are refused, a family of silent inlining,
mixed-precision and integer miscomputes is fixed, and the untuned cifar_resnet cc step is
about 25% cheaper with bitwise-identical results. The nulls: schemes only check, so they cost
time rather than save it, about 2× on block stacks and 5× on a decoder, and the row solver
still has open suspected defects. Winograd's data gradient was built and reverted, a pinned
staging pool for host transfers did not pay, and no GPT or ResNet benchmark was re-run at this
release's head. Existing code should expect new refusals (see ### Changed), %cd statements
that now run in source order, and ~train_step as a Tensor.t option.