Skip to content

Commit 3b40f3d

Browse files
committed
zonos3 docs: the page after the rebase onto main with ashhart#4609: reply 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.
1 parent 071cf51 commit 3b40f3d

1 file changed

Lines changed: 35 additions & 29 deletions

File tree

‎docs/recipes/zonos3-mini.md‎

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
publisher released, and serves it on `POST /v1/audio/speech`. This page records what is ported, where every source
55
came from, and how each part was checked, so the checks can be rerun.
66

7-
Status: one branch, proposed in #3615 and open as draft pull request #3720. All 40 kernels have their limits
7+
Status: one branch, proposed in #3615 and open as pull request #3720. All 40 kernels have their limits
88
records, numeric contract tests and a planted control each; the quality suite has not been run on this build.
99

1010
## Sources
@@ -56,7 +56,9 @@ members, a pickle VM limited to the tensor allow-list, nested state dicts named
5656
runs in the publisher's lanes: 20 s each, a later lane carrying 10 s of what came before.
5757
- **Served route** (`native/zonos_host.zig`, `server/zonos_speech.zig`): one request at a time; the release's 27
5858
default voices by their reference codes; a caller's own voice as `ref_audio` (a WAV file in base64, encoded by the
59-
engine) or as `speaker_reference_codes`; WAV or PCM, whole or streamed in chunks of 1, 2, 4, 8 and then 15 frames.
59+
engine) or as `speaker_reference_codes`; WAV or PCM, whole or streamed in chunks of 1, 2, 4, 8 and then 15 frames,
60+
and the server's other reply options as for any speech model (24-bit and float WAV, FLAC, another `sample_rate`,
61+
stereo), whole replies only.
6062
The clip encoder's weights load on the first request that brings a clip.
6163

6264
Refused or absent: clips in formats other than WAV, text normalization (text is spoken as typed), speaker and control
@@ -90,8 +92,8 @@ the difference. The port has no bf16 path and none is planned as an option.
9092
## How it was checked
9193

9294
All figures below were measured on one RTX 5090 (driver 615.71, nvcc 13.3, Zig 0.17.0, `-Dsm=120`). The table of
93-
port-side checks was last run in full on the branch rebased onto main `6d0a128b0`, with the contract tests and the
94-
two kernel changes they brought in; the reference dumps are one set, regenerated before the first full run.
95+
port-side checks was run in full again on the branch rebased onto main `281d81b8b`, and every figure in it came out
96+
as before; the reference dumps are one set, regenerated before the first full run.
9597

9698
### The reference side
9799

@@ -191,6 +193,14 @@ The standalone tool measured the parts: the decoder alone turns 11.4 s of codes
191193
encodes in 0.75 s and a 47.3 s clip in 5.1 s (the acoustic branch 0.48 s and the teacher 0.26 s a lane). There are
192194
no CUDA graphs and the sampler runs on the host; none of this is tuned.
193195

196+
The table above was measured on main `6d0a128b0`. After the rebase onto main `281d81b8b`, the branch before and after
197+
it were served side by side on the 5090 and gave the same bytes, status and headers for twelve requests (a default
198+
voice, a named one, greedy reference codes, sampled, a cloned 48 kHz stereo clip, whole and streamed PCM, and four
199+
refusals) and the same 503s to requests that arrived while one spoke; the rebased build admitted the same
200+
3,828,406,528 bytes at load and spoke a 17.1 s reply in 0.59 s whole (first streamed byte at 0.04 s). Its 24-bit,
201+
float and FLAC replies decode to the 16-bit reply's samples within one 16-bit step, its stereo replies carry the same
202+
samples in both channels, its 24 and 48 kHz replies have the resampled length, and a stream at 24 kHz is refused.
203+
194204
### A test page
195205

196206
`tools/zig/zonos3_test_page.py` serves a small browser page (`zonos3_test_page.html`) and passes its three routes
@@ -211,32 +221,30 @@ browser by an automated test.
211221

212222
### Repo checks
213223

214-
On the branch rebased onto main `6d0a128b0`, the no-GPU workflow's steps were run on one Linux machine as the
224+
On the branch rebased onto main `281d81b8b`, the no-GPU workflow's steps were run on one Linux machine as the
215225
workflow runs them (`-Dfixed-cpu`, its test timeouts) and passed:
216226

217-
- `zig fmt --check build.zig zig`; `tools/zig/lean_check.py` against the base with `lean_new.py` (221 problems on
227+
- `zig fmt --check build.zig zig`; `tools/zig/lean_check.py` against the base with `lean_new.py` (165 problems on
218228
both, 0 new); `tools/zig/cuda_common_check.py` (0 violations), `cuda_fragment_check.py` (0 misses) and their unit
219-
tests; `host_tests_test.py`.
229+
tests; `test_pdl_early_loads.py`, `host_tests_test.py`, `build_options_test.py` and `flashnext_batch_serve_test.py`.
220230
- `zig build test-host-a`, `test-host-b`, `test-kernel-contract`, `test-golden`,
221-
`test-gradient-serving test-qwen-serving-host`, `test-server-security test-pull-security`, `fuzz-cortheon`, `test`
222-
and `check-release-paths`.
223-
- The family's host tests alone (`zig build test-zonos-host`), with Drama's and the CUDA host suite
224-
(`test-drama-host test-cuda-host`).
231+
`test-gradient-serving test-qwen-serving-host test-glm-pdl-scan`, `test-server-security test-pull-security`,
232+
`fuzz-cortheon`, `test` and `check-release-paths`.
233+
- The family's host tests alone (`zig build test-zonos-host`) and the CUDA host suite (`test-cuda-host`).
225234

226235
They ran under umask 022: with 0002 one unrelated test (`serve --config`, which refuses a group-writable file)
227-
fails. In the first run of `test-host-a` one real-clock test of the rank bring-up (`two ranks settle on the real
228-
clock and agree on one plan and view`) failed while other jobs shared the CPU; the step passed when run again alone.
236+
fails.
229237

230-
On macOS (an M5 Ultra) the default build, `zig build native` and `zig build test` pass. The family has no Metal
231-
path; the Metal contract jobs were not run, and neither was any quality suite.
238+
On macOS (an M5 Ultra) `zig build native` builds the rebased branch (for the Drama 3 run below); `zig build test`
239+
there was last run before the rebase onto `281d81b8b`. The family has no Metal path; the Metal contract jobs were
240+
not run, and neither was any quality suite.
232241

233-
The branch changes the speech route Drama 3 is served through and moves Drama's `torch.save` reader and WAV code to
234-
core, so Drama 3 (`fishaudio/drama-3`) was run on that M5 Ultra from main `6d0a128b0` and from the branch: six
235-
`drama3-generate` runs (greedy, seeded, a reference clip encoded, a cloned voice, streamed PCM, frames) three times
236-
each, and four `/v1/audio/speech` requests (seeded whole, seeded streamed PCM, default, sampled) twice from each of
237-
two server starts. Every output is byte-identical between the two, and the speeds agree (the cloned run 73.21 to 73.55
238-
frames a second on main, 73.31 to 73.49 on the branch). Drama on CUDA was not run: the checkpoint does not fit the
239-
5090.
242+
The branch changes the speech route Drama 3 is served through, so Drama 3 (`fishaudio/drama-3`) was served on that
243+
M5 Ultra from main `281d81b8b` and from the rebased branch, two server starts each: `GET /v1/voices` and twelve
244+
`/v1/audio/speech` requests, each sent twice (seeded whole WAV, seeded streamed PCM, a plain one, sampled, `top_k` 64,
245+
a 24 kHz stereo FLAC and a 24-bit WAV reply, and the refusals of `top_k` 0 and 65, a `ref_audio`, reference codes and
246+
an unknown voice). Every reply is byte-identical between the two builds and between starts, with no leak or panic
247+
line. Speeds were not measured in this run. Drama on CUDA was not run: the checkpoint does not fit the 5090.
240248

241249
The family registers four kernel images, so `zig/tests/fixtures/gradient-serving.tsv` re-pins
242250
`zig/src/cuda/kernels.zig`, as earlier image registrations did.
@@ -350,11 +358,9 @@ bf16-encoded references, clones as well from fp32 codes.
350358

351359
## Shared code this touches
352360

353-
- `drama3/codec_pth.zig` moved to `core/torch_pth.zig` (its zip half to `core/torch_zip.zig`) and gained nested
354-
checkpoints and a raw reader; Drama 3's codec loads through the same code and its host tests pass.
355-
- `drama3/wav.zig` moved to `core/wav.zig`: both families read WAV files and resample with it.
356361
- `core/speech_api.zig`: `SpeechRequest.speaker`, an optional speaker vector, and `reference_audio`, an optional clip.
357-
- `server/`: voices load through `speech_voices.zig`; the speech route, the sampling parser, the voices listing,
358-
model detection and the tokenizer loader each gained a branch for a release folder, which has no `config.json`
359-
and is recognised by `lm/zonos3_mini/params.json`.
360-
- `native/`: `zonos3` in the CUDA open dispatch, the capabilities list and the rank refusals.
362+
- `server/`: `speech_voices.zig` (Drama 3's voices holder, #4609) also starts and lists a release's voices; the speech
363+
route takes `ref_audio` and `speaker_reference_codes` only with a release and calls `parseFrom` with the family's
364+
defaults and its top-k ceiling of 4,096; model detection and the tokenizer loader each gained a branch for a
365+
release folder, which has no `config.json` and is recognised by `lm/zonos3_mini/params.json`.
366+
- `native/`: `zonos3` in the CUDA open dispatch (`cuda_open.zig`), the capabilities list and the rank refusals.

0 commit comments

Comments
 (0)