From b67fd2367dabb94f33cd07ad9566e7d499b55aab Mon Sep 17 00:00:00 2001 From: Foke Singh Date: Wed, 3 Jul 2024 11:30:49 +0000 Subject: [PATCH] =?UTF-8?q?Add=20benchmark,=20Llama,=20and=20ModernBERT=20?= =?UTF-8?q?example=20programs=20plus=20third=E2=80=91party=20non=E2=80=91m?= =?UTF-8?q?odule=20dependencies.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/benchmark/main.zig | 2 +- examples/llama/llama.zig | 4 ++-- examples/llama/main.zig | 2 +- examples/modernbert/main.zig | 2 +- examples/third_party/non_module_deps.bzl | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/benchmark/main.zig b/examples/benchmark/main.zig index a2de99d..ac39ed1 100644 --- a/examples/benchmark/main.zig +++ b/examples/benchmark/main.zig @@ -5,7 +5,7 @@ const asynk = @import("async"); const flags = stdx.flags; // set log level to debug to print the generated IR -pub const std_options = .{ +pub const std_options: std.Options = .{ .log_level = .warn, .logFn = asynk.logFn(std.log.defaultLog), }; diff --git a/examples/llama/llama.zig b/examples/llama/llama.zig index 2eaf8a8..9663035 100644 --- a/examples/llama/llama.zig +++ b/examples/llama/llama.zig @@ -345,11 +345,11 @@ pub const KvCache = struct { } pub fn keys(self: KvCache) Tensor { - return self.k.dynamicSlice(.{ .layer = .{ .start = self.layer_index, .len = 1 } }).squeeze(.layer); + return self.k.dynamicSlice(.{ .layer = Tensor.DynSlice{ .start = self.layer_index, .len = 1 } }).squeeze(.layer); } pub fn values(self: KvCache) Tensor { - return self.v.dynamicSlice(.{ .layer = .{ .start = self.layer_index, .len = 1 } }).squeeze(.layer); + return self.v.dynamicSlice(.{ .layer = Tensor.DynSlice{ .start = self.layer_index, .len = 1 } }).squeeze(.layer); } pub fn update(self: KvCache, new_k: Tensor, new_v: Tensor, token_index: ?Tensor) KvCache { diff --git a/examples/llama/main.zig b/examples/llama/main.zig index 9a17c40..0b121e6 100644 --- a/examples/llama/main.zig +++ b/examples/llama/main.zig @@ -17,7 +17,7 @@ const ShapeOf = zml.ShapeOf; const log = std.log.scoped(.llama); -pub const std_options = .{ +pub const std_options: std.Options = .{ .log_level = .info, .logFn = asynk.logFn(std.log.defaultLog), }; diff --git a/examples/modernbert/main.zig b/examples/modernbert/main.zig index c0156d0..8e11e79 100644 --- a/examples/modernbert/main.zig +++ b/examples/modernbert/main.zig @@ -9,7 +9,7 @@ const stdx = @import("stdx"); const zml = @import("zml"); const Tensor = zml.Tensor; -pub const std_options = .{ +pub const std_options: std.Options = .{ .log_level = .info, .log_scope_levels = &[_]std.log.ScopeLevel{ .{ .scope = .modernbert, .level = .info }, diff --git a/examples/third_party/non_module_deps.bzl b/examples/third_party/non_module_deps.bzl index 2d4af3f..d003b74 100644 --- a/examples/third_party/non_module_deps.bzl +++ b/examples/third_party/non_module_deps.bzl @@ -5,7 +5,7 @@ def _non_module_deps_impl(mctx): new_git_repository( name = "com_github_hejsil_clap", remote = "https://github.com/Hejsil/zig-clap.git", - commit = "d71cc39a94f3e6ccbad00c25d350c9147de4df9f", + commit = "068c38f89814079635692c7d0be9f58508c86173", build_file = "//:third_party/com_github_hejsil_clap/clap.bazel", )