Add benchmark, Llama, and ModernBERT example programs plus third‑party non‑module dependencies.
This commit is contained in:
parent
30f6be0e2f
commit
b67fd2367d
@ -5,7 +5,7 @@ const asynk = @import("async");
|
|||||||
const flags = stdx.flags;
|
const flags = stdx.flags;
|
||||||
|
|
||||||
// set log level to debug to print the generated IR
|
// set log level to debug to print the generated IR
|
||||||
pub const std_options = .{
|
pub const std_options: std.Options = .{
|
||||||
.log_level = .warn,
|
.log_level = .warn,
|
||||||
.logFn = asynk.logFn(std.log.defaultLog),
|
.logFn = asynk.logFn(std.log.defaultLog),
|
||||||
};
|
};
|
||||||
|
|||||||
@ -345,11 +345,11 @@ pub const KvCache = struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn keys(self: KvCache) Tensor {
|
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 {
|
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 {
|
pub fn update(self: KvCache, new_k: Tensor, new_v: Tensor, token_index: ?Tensor) KvCache {
|
||||||
|
|||||||
@ -17,7 +17,7 @@ const ShapeOf = zml.ShapeOf;
|
|||||||
|
|
||||||
const log = std.log.scoped(.llama);
|
const log = std.log.scoped(.llama);
|
||||||
|
|
||||||
pub const std_options = .{
|
pub const std_options: std.Options = .{
|
||||||
.log_level = .info,
|
.log_level = .info,
|
||||||
.logFn = asynk.logFn(std.log.defaultLog),
|
.logFn = asynk.logFn(std.log.defaultLog),
|
||||||
};
|
};
|
||||||
|
|||||||
@ -9,7 +9,7 @@ const stdx = @import("stdx");
|
|||||||
const zml = @import("zml");
|
const zml = @import("zml");
|
||||||
const Tensor = zml.Tensor;
|
const Tensor = zml.Tensor;
|
||||||
|
|
||||||
pub const std_options = .{
|
pub const std_options: std.Options = .{
|
||||||
.log_level = .info,
|
.log_level = .info,
|
||||||
.log_scope_levels = &[_]std.log.ScopeLevel{
|
.log_scope_levels = &[_]std.log.ScopeLevel{
|
||||||
.{ .scope = .modernbert, .level = .info },
|
.{ .scope = .modernbert, .level = .info },
|
||||||
|
|||||||
2
examples/third_party/non_module_deps.bzl
vendored
2
examples/third_party/non_module_deps.bzl
vendored
@ -5,7 +5,7 @@ def _non_module_deps_impl(mctx):
|
|||||||
new_git_repository(
|
new_git_repository(
|
||||||
name = "com_github_hejsil_clap",
|
name = "com_github_hejsil_clap",
|
||||||
remote = "https://github.com/Hejsil/zig-clap.git",
|
remote = "https://github.com/Hejsil/zig-clap.git",
|
||||||
commit = "d71cc39a94f3e6ccbad00c25d350c9147de4df9f",
|
commit = "068c38f89814079635692c7d0be9f58508c86173",
|
||||||
build_file = "//:third_party/com_github_hejsil_clap/clap.bazel",
|
build_file = "//:third_party/com_github_hejsil_clap/clap.bazel",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user