0
Fork 0
mirror of https://github.com/zml/zml.git synced 2026-11-16 19:11:09 +00:00
zml/docs/learn
Benjamin Rabier 2accfb1515 docs: add the loader guide and a loading-weights tutorial step
docs/learn/loader.md is the guide to zml.io.Loader: the recipe over a
VFS with Remotes, placing tensors on a mesh or in host memory,
composite tensors built from Source's shape ops, programs bound with
bindProgram, and what each handle borrows and how a load fails. The
errors get a short summary that points at Loader's doc comment, which
holds the contract. The docs index, the README's taste of ZML,
Buffer's doc and the headers of zml/io.zig and zml/io/loader.zig link
it.

write_first_model gains a last step, 'Loading weights': a few lines of
Python write the layer's weight and bias to a .safetensors file, the
layer binds them through a TensorStore view, and main loads them over
a VFS with Remotes through the loader before calling the executable.
The TensorStore paragraph now says the store holds the shapes and the
loader fills the buffers.

zml.io.next goes: nothing in zml or llmd names it any more.

The tutorial's program and every snippet of the guide were built and run
on 4 CPU devices from a scratch target that is not committed: the
tutorial prints {6,11,16} from the Python-written checkpoint, and the
placement (host_mapped included) and composite snippets load the values
they describe. The program snippet stands alone: it defines its sources
and its forward dequantizes by block and places its result as the output
is, without which the load fails with InvalidBinding; on an 8x256 weight
with one scale per row and 128 columns it loads every value as expected,
row-sharded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
History 2026-11-08 07:35:32 +01:00
..
concepts.md zml: refactor module.zig into Compiler.zig (#736) 2026-08-27 18:31:50 +02:00
loader.md docs: add the loader guide and a loading-weights tutorial step 2026-11-08 07:35:32 +01:00