Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Each release's page on GitHub has its notes and measurements. See [the 1.0.0 rel

## Unreleased

- Core: Drama 3's `torch.save` reader moves to `core/torch_pth.zig` (its zip container to `core/torch_zip.zig`) and its WAV code to `core/wav.zig`; the reader also opens a root of nested state dicts, naming tensors by their keys joined with `/` (`openNested`), and returns a tensor's stored bytes at a given dtype and shape (`readRaw`), with host tests; Drama 3's generated and served audio stays byte-identical on Metal (#3719, for #3615). Thanks to @BobClawblaw.

- Desktop: a new conversation on the built-in engine asks for its title after the first run settles, not beside it, so the title no longer competes with that run; cancelling or renaming during the run skips it (#4072, refs #3606). Thanks to @AIFlowML.

- Desktop: a Room agent can release its own idle ticket claim, returning the ticket to Ready for another seat with its evidence, reviews and worker history kept (#4081, fixes #3452). Thanks to @AIFlowML.
Expand Down
4 changes: 2 additions & 2 deletions zig/build/drama3_metal.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ const std = @import("std");
const dir = "zig/kernels/metal/drama3";
const sources = [_][]const u8{ "dense.metal", "gdn.metal", "attn.metal", "moe.metal", "nvfp4.metal", "guidance.metal", "sample.metal", "codec.metal" };

/// Drama in the Metal engines: its `core` is the engine's safetensors, the server's tokenizer and frame_rounds.
/// Drama in the Metal engines: its `core` is the engine's safetensors, torch_pth and wav, the tokenizer, frame_rounds.
pub fn addNative(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, metal: *std.Build.Module, native: *std.Build.Module, metal_std: []const u8) void {
const tokenizer = native.import_table.get("tokenizer") orelse tok: {
const t = b.createModule(.{ .root_source_file = b.path("zig/src/core/tokenizer/tokenizer.zig"), .target = target, .optimize = .ReleaseSafe, .link_libc = true });
native.addImport("tokenizer", t);
break :tok t;
};
const rounds = b.createModule(.{ .root_source_file = b.path("zig/src/core/frame_rounds.zig"), .target = target, .optimize = optimize });
const shim = b.addWriteFiles().add("drama3_core.zig", "pub const safetensors = @import(\"tensorfold\").safetensors;\npub const tokenizer = @import(\"tokenizer\");\npub const frame_rounds = @import(\"frame_rounds\");\n");
const shim = b.addWriteFiles().add("drama3_core.zig", "pub const safetensors = @import(\"tensorfold\").safetensors;\npub const tokenizer = @import(\"tokenizer\");\npub const frame_rounds = @import(\"frame_rounds\");\npub const torch_pth = @import(\"tensorfold\").torch_pth;\npub const wav = @import(\"tensorfold\").wav;\n");
const core = b.createModule(.{ .root_source_file = shim, .target = target, .optimize = optimize, .imports = &.{
.{ .name = "tensorfold", .module = native.import_table.get("tensorfold").? },
.{ .name = "tokenizer", .module = tokenizer },
Expand Down
2 changes: 1 addition & 1 deletion zig/build/residency_host.zig
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn compileHost(b: *std.Build, metal: *std.Build.Module, engine: *std.Build.M
const bytes = b.createModule(.{ .root_source_file = b.addWriteFiles().add("residency-drama-empty.zig", "pub const bytes: []const u8 = &.{};\n") });
const tokenizer = b.createModule(.{ .root_source_file = b.path("zig/src/core/tokenizer/tokenizer.zig"), .target = b.graph.host, .link_libc = true });
const rounds = b.createModule(.{ .root_source_file = b.path("zig/src/core/frame_rounds.zig"), .target = b.graph.host });
const shim = b.addWriteFiles().add("residency-drama-core.zig", "pub const safetensors = @import(\"tensorfold\").safetensors;\npub const tokenizer = @import(\"tokenizer\");\npub const frame_rounds = @import(\"frame_rounds\");\n");
const shim = b.addWriteFiles().add("residency-drama-core.zig", "pub const safetensors = @import(\"tensorfold\").safetensors;\npub const tokenizer = @import(\"tokenizer\");\npub const frame_rounds = @import(\"frame_rounds\");\npub const torch_pth = @import(\"tensorfold\").torch_pth;\npub const wav = @import(\"tensorfold\").wav;\n");
const core = b.createModule(.{ .root_source_file = shim, .target = b.graph.host, .imports = &.{ .{ .name = "tensorfold", .module = engine }, .{ .name = "tokenizer", .module = tokenizer }, .{ .name = "frame_rounds", .module = rounds } } });
const drama = b.createModule(.{ .root_source_file = b.path("zig/src/families/drama3/drama3_metal.zig"), .target = b.graph.host, .link_libc = true, .imports = &.{ .{ .name = "metal", .module = metal }, .{ .name = "core", .module = core }, .{ .name = "drama3_metallib", .module = bytes } } });
host.addImport("core", core);
Expand Down
2 changes: 1 addition & 1 deletion zig/build/slide_host.zig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub fn metal(b: *std.Build, m: anytype) void {
const tokenizer = b.createModule(.{ .root_source_file = b.path("zig/src/core/tokenizer/tokenizer.zig"), .target = target, .link_libc = true });
const rounds = b.createModule(.{ .root_source_file = b.path("zig/src/core/frame_rounds.zig"), .target = target });
const files = b.addWriteFiles();
const core = b.createModule(.{ .root_source_file = files.add("slide-drama-core.zig", "pub const safetensors = @import(\"tensorfold\").safetensors;\npub const tokenizer = @import(\"tokenizer\");\npub const frame_rounds = @import(\"frame_rounds\");\n"), .target = target, .imports = &.{ .{ .name = "tensorfold", .module = m.engine }, .{ .name = "tokenizer", .module = tokenizer }, .{ .name = "frame_rounds", .module = rounds } } });
const core = b.createModule(.{ .root_source_file = files.add("slide-drama-core.zig", "pub const safetensors = @import(\"tensorfold\").safetensors;\npub const tokenizer = @import(\"tokenizer\");\npub const frame_rounds = @import(\"frame_rounds\");\npub const torch_pth = @import(\"tensorfold\").torch_pth;\npub const wav = @import(\"tensorfold\").wav;\n"), .target = target, .imports = &.{ .{ .name = "tensorfold", .module = m.engine }, .{ .name = "tokenizer", .module = tokenizer }, .{ .name = "frame_rounds", .module = rounds } } });
const bytes = b.createModule(.{ .root_source_file = files.add("slide-inert-metallib.zig", "pub const bytes: []const u8 = &.{};\n") });
native.addImport("kimi_k3", @import("metal_targets.zig").kimiModule(b, target, .Debug, m.metal, m.engine, m.lanes));
native.addImport("kimi_metallib", bytes);
Expand Down
4 changes: 4 additions & 0 deletions zig/src/core/root.zig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pub const CopyIndex = @import("copy_index.zig").CopyIndex;
pub const recurrent_workspace = @import("recurrent_workspace.zig");
pub const tokenizer = @import("tokenizer"); // a module of its own, so the native server shares it
pub const proposal_rows = @import("proposal_rows.zig");
pub const torch_pth = @import("torch_pth.zig"); // torch.save archives read without Python: Drama 3's codec
pub const wav = @import("wav.zig"); // reference clips in, speech out
pub const proposal_vocab = @import("proposal_vocab.zig");
pub const ids_json = @import("ids_json.zig");
pub const affine4_host = @import("affine4_host.zig");
Expand Down Expand Up @@ -73,6 +75,8 @@ pub const kv_prompts = @import("kv_prompts.zig");
pub const state_walk = @import("state_walk.zig");

test {
_ = torch_pth;
_ = wav;
_ = startup_receipt;
_ = benchmark_group;
_ = dspine;
Expand Down
Loading
Loading