From eb2054824169625a8bb4eb7b87e7b7809e2d0d67 Mon Sep 17 00:00:00 2001 From: Foke Singh Date: Thu, 26 Oct 2023 13:56:56 +0000 Subject: [PATCH] update instructions following, `prepare` doesn't alloc anymore, `ExeWithWeights` is `ModuleExe` --- docs/learn/concepts.md | 4 ++-- docs/tutorials/write_first_model.md | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/learn/concepts.md b/docs/learn/concepts.md index 93e0d9b..5bcc3b6 100644 --- a/docs/learn/concepts.md +++ b/docs/learn/concepts.md @@ -144,12 +144,12 @@ corresponding types. 3. Compile the model struct and its `forward` function into an executable. `foward` is a `Tensor -> Tensor` function, executable is a - `zml.Exe(Model.forward)` + `zml.FnExe(Model.forward)` 4. Load the model weights from disk, onto accelerator memory -> `zml.Bufferized(Model)` struct (with `zml.Buffer` inside) -5. Bind the model weights to the executable `zml.ExeWithWeight(Model.forward)` +5. Bind the model weights to the executable `zml.ModuleExe(Model.forward)` 6. Load some user inputs (custom struct), encode them into arrays of numbers (`zml.HostBuffer`), and copy them to the accelerator (`zml.Buffer`). diff --git a/docs/tutorials/write_first_model.md b/docs/tutorials/write_first_model.md index 39cecc2..8b4d925 100644 --- a/docs/tutorials/write_first_model.md +++ b/docs/tutorials/write_first_model.md @@ -282,7 +282,8 @@ executable. ```zig // pass the model weights to the compiled module to create an executable module -var executable = try compiled.prepare(arena, model_weights); +// all required memory has been allocated in `compile`. +var executable = compiled.prepare(model_weights); defer executable.deinit(); ``` @@ -498,7 +499,7 @@ pub fn asyncMain() !void { // pass the model weights to the compiled module to create an executable // module - var executable = try compiled.prepare(arena, model_weights); + var executable = compiled.prepare(model_weights); defer executable.deinit(); // prepare an input buffer