0
Fork 0
mirror of https://github.com/zml/zml.git synced 2026-11-16 19:11:09 +00:00
zml/docs
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
..
howtos docs: show the loader recipe in the README and testing.load in the torch2zml howto 2026-11-08 07:35:32 +01:00
learn docs: add the loader guide and a loading-weights tutorial step 2026-11-08 07:35:32 +01:00
misc Update doc for V2 (#428) 2026-03-24 17:00:10 +01:00
tutorials docs: add the loader guide and a loading-weights tutorial step 2026-11-08 07:35:32 +01:00
README.md docs: add the loader guide and a loading-weights tutorial step 2026-11-08 07:35:32 +01:00

Greetings, Programs!

If you want to run our example models, please head over to Getting Started.

Ready to write some code? Try starting with your first model in ZML, or familiarize yourself with the high-level ZML concepts first.

MENU:

Tutorials

How to ?

Learn more...

Contribute