Repository navigation
core: Drama 3's torch.save reader and WAV code move to core (torch_pth, torch_zip, wav) - #3719
Conversation
|
Thanks @BobClawblaw. The extraction and Drama import wiring look sound. Before landing, please add host regressions for openNested and readRaw: nested names and metadata, flat-mode refusal, offset slices, and malformed/CRC cases. The retained tests all use the old flat/readF32 paths, so they do not cover those new APIs.
|
e753138 to
5a8524d
Compare
|
Thanks. Added in
Each check fails with its guard taken out of the reader: I removed 14 guards one at a time, and each removal fails at least one test. The branch is also rebased onto main |
5a8524d to
7c32072
Compare
|
Thank you @BobClawblaw. The regressions you added cover all four groups we asked for: nested names and metadata, flat-mode refusal, offset slices, and the malformed and CRC cases. They run through
|
7c32072 to
5460e3b
Compare
|
Thanks @BobClawblaw. As we said on 19 November, the regressions you added cover all four groups we asked for and nothing further is needed from you. The head applies cleanly to today's main and the byte-identical Drama 3 receipts stand.
|
…h, torch_zip, wav) The reader also takes nested state dicts, named by their keys, and its zip container is its own file. Drama 3 reads its codec through core.torch_pth as before.
The retained tests cover the flat readF32 path only. torch_pth_test.zig builds torch.save archives in the test (stored zip members, a protocol-2 pickle written opcode by opcode) and checks: - openNested: tensors named by their keys joined with '/', through state dicts that carry a _metadata BUILD; plain values (ints, strings, floats, lists) and the metadata are not tensors. - readRaw: offset views of one shared storage at fp32 and bf16 widths, and the refusals of a view past its storage, a strided view, a storage member of the wrong size, a missing storage and the wrong dtype. - Flat-mode refusal of a nested root; a name reached twice and a root nested past eight levels are refused. - Damage: a storage byte changed after its CRC, a pickle with a bad CRC, a missing end record, a file too short, no or two data.pkl, a big-endian byteorder, a pickle without STOP, a member whose header lies past the end. Each check fails when its guard is removed from the reader.
5460e3b to
28ea3e9
Compare
|
Thank you @BobClawblaw. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
…eply options, reruns, the Drama 3 A/B, the shared code left Main's reply options (24-bit and float WAV, FLAC, sample_rate, stereo) apply to ZONOS3's whole replies. The port-side checks, the repo checks and the Drama 3 A/B were run again on main 281d81b; the reader and WAV moves left the shared-code list with ashhart#3719, and the voices holder and parseFrom with ashhart#4609.
…eply options, reruns, the Drama 3 A/B, the shared code left Main's reply options (24-bit and float WAV, FLAC, sample_rate, stereo) apply to ZONOS3's whole replies. The port-side checks, the repo checks and the Drama 3 A/B were run again on main 281d81b; the reader and WAV moves left the shared-code list with ashhart#3719, and the voices holder and parseFrom with ashhart#4609.
…eply options, reruns, the Drama 3 A/B, the shared code left Main's reply options (24-bit and float WAV, FLAC, sample_rate, stereo) apply to ZONOS3's whole replies. The port-side checks, the repo checks and the Drama 3 A/B were run again on main 281d81b; the reader and WAV moves left the shared-code list with ashhart#3719, and the voices holder and parseFrom with ashhart#4609.
…eply options, reruns, the Drama 3 A/B, the shared code left Main's reply options (24-bit and float WAV, FLAC, sample_rate, stereo) apply to ZONOS3's whole replies. The port-side checks, the repo checks and the Drama 3 A/B were run again on main 281d81b; the reader and WAV moves left the shared-code list with ashhart#3719, and the voices holder and parseFrom with ashhart#4609.
…tions, reruns, the Drama 3 A/B, the shared code left Main's reply options (24-bit and float WAV, FLAC, sample_rate, stereo) apply to ZONOS3's whole replies. The port-side checks, the repo checks and the Drama 3 A/B were run again on main 281d81b; the reader and WAV moves left the shared-code list with #3719, and the voices holder and parseFrom with #4609.
The reader extraction asked for on #3615, as its own change. Two commits on main
0900b484e: the move, and host regressions for the reader's new paths (asked for in review).What it does
torch.savereader moves fromfamilies/drama3/codec_pth.zigtocore/torch_pth.zig, and its WAV code fromfamilies/drama3/wav.zigtocore/wav.zig(a pure move). Drama reads its codec throughcore.torch_pthas before.core/torch_zip.zig, and the reader also takes nested state dicts, named by their keys (openNested,readRaw). ZONOS3's checkpoints need both; Drama uses neither.core/torch_pth_test.zig(new): host regressions foropenNestedandreadRawon archives built in the test: nested names and metadata, flat-mode refusal, offset slices, and malformed and CRC cases. Each check fails with its guard taken out of the reader.coreis a generated shim over the engine facade, sozig/src/tensorfold.zigexposes the two files and the three shims (drama3_metal.zig,residency_host.zig,slide_host.zig) pass them through. Without that the Metal native server does not compile; Linux CI does not see it.Drama 3 before and after, on real hardware
fishaudio/drama-3on an M5 Ultra (Metal), main6d0a128b0against the move, same arguments, builds alternating:drama3-generate: greedy; seeded;--encodeof a reference clip; a cloned voice from that clip; the same streamed with--pcm-out; frames with--out/v1/audio/speechfromtensorfold-native serve: seeded whole WAV; seeded streamed PCM; a default request; one with temperature, top_p and top_kSpeeds agree. Frames a second over the three rounds, main then this commit: greedy 72.1 to 72.3 and 71.9 to 72.2; seeded 74.0 to 74.4 and 74.0 to 74.2; cloned 73.21 to 73.55 and 73.34 to 73.45; streamed 76.2 and 76.0 to 76.3; frames only 86.0 to 86.1 and 85.9 to 86.1. The served whole reply took 4.66 to 4.68 s on main and 4.66 to 4.69 s here. The reference clip was the model's own greedy output.
After the rebase onto
0900b484e, with the tests added, the same runs on the M5 Ultra: main0900b484eand this head (5a8524d30) give the same sha256 for everydrama3-generateoutput (seven files, three rounds each) and every served reply (four requests, two from each of two server starts, all 200). Cloned run 72.35 to 73.30 frames a second on main and 72.58 to 73.37 here; served whole reply 4.68 to 4.71 s on main and 4.67 to 4.71 s here.The reader alone, on the host:
codec.pth(sha25674fc41c5…bb2fas on the hub, revision78e5ab79) read by main's reader and by this one gives 541 tensors with identical names, dtypes and shapes, and the 535 fp32 tensors byte-identical (1,565,722,120 bytes).Not run: Drama on CUDA. Its load peaks at 48 GB on the device and I have no free CUDA machine that holds it; the CUDA side of this change is the same import rename, compiled by
check-drama-cuda-hostandtest-cuda-host.Checks (on this head,
5a8524d30, main0900b484e)-Dfixed-cpu, its timeouts):test-host-a,test-host-b,test-kernel-contract,test-golden,test-gradient-serving test-qwen-serving-host,test-server-security test-pull-security,fuzz-cortheon,test,check-release-paths,test-drama-host test-cuda-host: all pass.zig fmt --check build.zig zig; the lean check against the base: 221 problems on both, 0 new; the CUDA common and fragment checks.zig build,zig build nativeandzig build testpass on this head.atc overlap --json: came back incomplete (its PR, file and time limits). Of what it checked: textual conflicts with #1850 (2 files) and #2522 (1 file); clean with #1434 and #1766; #1767, #2826 and #2648 share a file, merge not determined.For #3615.