Repository navigation
zonos3: ZONOS3 Mini text to speech on CUDA (voices, reference codes, cloning from a clip) - #3720
Conversation
3880184 to
0a116ed
Compare
|
Thank you, @BobClawblaw. The pinned release, separate speech request handling and exact frame/code checks make this much easier to review. Keeping Drama's existing path separate is helpful too. One startup edge needs fixing: The supplied measurements are useful; the corrected combined tree still needs its exact checks, including Drama reply equality. The fixture hash conflict is mechanical and can be handled at integration.
|
|
Thank you, Ash. Fixed in 9adfbab, pushed on the branch rebased onto main
The fixture hash: understood, I'll leave it for integration. |
|
Thanks @BobClawblaw. The load now passes the validated frame plan to the codec, and the regression covers 12, 16, 31 and 32 plus the refused neighbor. The new short-budget, default-reply and Drama equality results answer the latest requests. The remaining qualification is the integrated family on the other CUDA device class and the stated exact/performance checks. We will handle the registry union and final source pin. The clip encoder's admission is additional to the base load.
|
1 similar comment
|
Thanks @BobClawblaw. The load now passes the validated frame plan to the codec, and the regression covers 12, 16, 31 and 32 plus the refused neighbor. The new short-budget, default-reply and Drama equality results answer the latest requests. The remaining qualification is the integrated family on the other CUDA device class and the stated exact/performance checks. We will handle the registry union and final source pin. The clip encoder's admission is additional to the base load.
|
…'s dumps fp32 rows over the published bf16 weights (model.pth read without Python), one row-kernel path for prompt and decode rows. zonos3-generate --check compares every sublayer with tools/dump_golden.py lm captures of Zyphra/ZONOS3-Mini.
…at it gave) and the reference-dump tool
…nd: codes equal to the reference's fp32 run
… to the reference's fp32 run at one and four lanes
…he engine on first use A clip is read by core's WAV reader and resampler. The speech request gains reference_audio.
… codes for other models
The frame sampler keeps the release's masks and repetition penalty and hands each codebook's unmasked logits to core/lanes/sampling.zig at position frame * 10 + codebook, in place of the family's own seeded generator. Greedy frames are unchanged: 78 of 78 and 80 of 80 identical to the reference at prompt chunks of 7 and 256 rows.
…ms and linears Gate 5: each launch's registers and shared memory on sm_80 to sm_121, measured with nvcc 13.0, and a 13.2 set for the seven launches later releases compile differently. Gates 1 to 4: z3_rmsnorm, zc_layernorm, z3_linear and zc_linear through the row and dense input families.
The host counts a load's device bytes before allocating (the release's weights, then the backbone's and decoder's own count of their state) and asks the CUDA families' pool; a load or a clip that does not fit is refused, and a refused clip leaves the engine serving.
…, with exact gates
… for all 40 zc_spec and ze_nearest now keep a NaN: the spectrum's clamp is a comparison, and a NaN dot is never the nearest code.
…g re-pinned for the four images
… figures on the rebased branch
…and from the branch on Metal
…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.
… longer than the budget --max-frames below 32 gave the codec its usual 32-frame pass, longer than the budget, and the codec refused the load; budgets above the codec's 8192 frames were admitted too. The load's plan now sizes the codec's pass to the budget and refuses what the codec would; a host test opens the plan at 12, 16, 31 and 32 frames.
|
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. |
ZONOS3 Mini (
Zyphra/ZONOS3-Mini) text to speech as a native CUDA family, for #3615.docs/recipes/zonos3-mini.mdin this branch is the full account: sources and pinned revisions, file hashes, the reference environment, every check with how it was run and what it gave, memory, and what is not supported. This text is the summary.Rebased onto main
834237bca(rebase, no merge), which holds #4609: the voices holder (speech_voices.zig) andparseFrom, with Drama 3 as their only user, as asked on #3615. This branch now builds on them instead of carrying its own copies:speech_voices.startalso loads a ZONOS3 release's voices,speech_voices.listinglists them, and the speech route callsparseFromwith the family's defaults and its top-k ceiling. The request and plan fields and the family entry come here, as asked. Main's newer speech changes apply to ZONOS3 too: its reply formats (24-bit and float WAV, FLAC),sample_rateand stereo work for ZONOS3 replies, and the family opens through main'scuda_open.zig. The features the page used to list as not supported come as a stack of draft pull requests on top of this one, one feature each (list below); they follow behind this one in order.What it serves
POST /v1/audio/speechon one RTX 5090: the release's default voices, a request's own voice as reference codes (speaker_reference_codes), and voice cloning from an uploaded clip (ref_audio), encoded by the engine. Whole and streamed replies; sampled replies use the lane core's keyed sampler and repeat for a seed.--parallel 1); a second concurrent request gets 503. Memory admission covers the load and the clip encoder.--max-framesfrom 12 up (below--context): the codec's pass is never longer than the budget. Checked on the 5090: the previous head refused--max-frames 16(BadPassFrames); this head loads and speaks at 12, 16, 31 and 32 frames, its streamed PCM equal to the whole reply at each, and the default budget's replies are unchanged.test-zonos-hostcovers 12, 16, 31 and 32 through the load's own plan.Figures (one RTX 5090, driver 615.71, nvcc 13.3)
6d0a128b0and not repeated: 9,471,917,216 bytes with the clip encoder loaded; the first request with a clip takes 9.0 s (it loads the encoder), later ones 0.92 s and 1.31 to 1.32 s. Whisper transcribes the reply and both cloned voices with WER 0. No quality suite was run.afbc4e142(this head's parent; the fix since touches only the server's load plan) and all pass, every figure as published: the backbone at cosine 1.0000000 (worst relative difference 3.3e-6 and 3.7e-6), greedy frames 78 of 78 and 80 of 80 identical at 1, 7, 64 and 256 rows a pass, the codec at 115.9 dB and chunked equal to whole, text to audio at 111.7 and 117.5 dB, the teacher's features, the encoder and the SSL teacher (worst row 0.9999252), and clip codes 1,450 of 1,450 and 7,100 of 7,100.Kernel contract
All 40 kernels are registered (41 registrations:
zc_add_scaledwith and without its layer scale), each with gates 1 to 4 and a planted control, and gate 5 launch records.tf-cuda-test kernel-contract zonos3on the 5090, onafbc4e142(no kernel changed since):The family's launch records are current (0 limit problems above). Gate 1 found two kernels that dropped a NaN (
zc_spec,ze_nearest); both are fixed and no finite result changed.Shared code this touches, and the A/B
server/speech_voices.zig(from speech: Drama 3's voices through speech_voices.zig, and sampling defaults through parseFrom #4609):startalso loads a ZONOS3 release's voices into the server'szonos(one new field inserver.zig) and refuses Drama 3's catalog flags with one;listinglists a release's voices.server/speech.zig:ref_audioandspeaker_reference_codesare accepted only when the server holds a ZONOS3 release; any other model refuses both as before (tested). The field check takes its options as one struct, main's inline-voice switch beside the ZONOS3 one. With a release, sampling goes throughparseFrom(ZONOS3's defaults, 4096); Drama's call is unchanged.core/speech_api.zig: two new plan fields.native/cuda_open.zig,cuda_families.zig,cuda_refusal.zig,server/main.zig,server/hf_text.zig: one more family entry, and detection of a release folder, which has noconfig.json, with its tokenizer path.core/contract/registry_joins.zig: the family's launch records join the registry's test.core/root.zig's note ontorch_pthnames ZONOS3's checkpoints, andzig/tests/fixtures/gradient-serving.tsvre-pinszig/src/cuda/kernels.zigfor the four new images on top of main's pin, as earlier registrations did.Drama 3 is the only other family on that route. Drama 3 A/B on the M5 Ultra (Metal), main
834237bcaagainst this head (9adfbab43):GET /v1/voicesand twelve/v1/audio/speechrequests, each sent twice, from two server starts a build: seeded whole WAV, seeded streamed PCM, a plain one, sampled,top_k64, a 24 kHz stereo FLAC and a 24-bit WAV reply, and the refusals oftop_k0 and 65, aref_audio, reference codes and an unknown voice. Every reply is byte-identical between the builds and between starts (13 of 13 sha256s, 8 copies each, the voice list 4), with no leak or panic line. Speeds were not measured in this run. Drama on CUDA was not run: its load peaks at 48 GB and does not fit the 5090.ZONOS3 A/B on the 5090, this branch before the rebase (
0a116ed62, on mainab2c3b27a) against202ec84db, both served side by side: twelve requests (the default voice, a named one, greedy reference codes, sampled, a cloned 48 kHz stereo clip, whole and streamed PCM, and four refusals) give the same bytes, status and headers, and both give the same 503s to two requests that arrive while one speaks. This head, served alone after the rebase onto834237bca, gives the same status, length and sha256 as202ec84dbfor all twelve requests and the same 503s. On this head, 24-bit, float and FLAC replies decode to the 16-bit reply's samples within one 16-bit step, stereo carries the same samples in both channels, 24 and 48 kHz replies have the resampled length, and a stream at 24 kHz is refused.Checks on this head (
9adfbab43, on main834237bca)Main gained 307 commits after
03816aaa4. Two conflicts: thekernels.zigline ingradient-serving.tsv, where main's pin now also covers #2302's images, re-pinned here to the file's new hash; and the test imports inregistry_joins.zig, where ZONOS3's records sit after main's new inkling2 ones. The other commits' patches are unchanged but for context lines. On this head:zig fmt --check, the lean check (165 problems on main and on this head, 0 new), nogetenvadded;cuda_common_check.py,cuda_fragment_check.pyand their tests,test_pdl_early_loads.py,host_tests_test.py,build_options_test.py,flashnext_batch_serve_test.py.zig build test,test-host-a,test-host-b,test-kernel-contract,test-golden,test-gradient-serving test-qwen-serving-host test-glm-pdl-scan,test-server-security test-pull-security,fuzz-cortheonandcheck-release-paths; withtest-zonos-host,test-cuda-hostandzig build native -Dsm=120.afbc4e142.zig build nativefor both trees). Not rerun:zig build teston macOS.cuda_open.zig), the tokenizer loader, the speech reply's formats, rate and channels, and the contract registries sinceab2c3b27a. The conflicts were fitted to main's versions: ZONOS3 joinscuda_open.zig, its tokenizer path goes through main'sopenTokenizer, its plan carries main'srateandchannels(checked after its own voice checks, so Drama's refusal order is unchanged), and its contract sets sit beside main's new ones.The stack on this pull request
Each is a draft with one feature, its own receipt and its own checks; each is stacked on the one above it, and each will be rebased onto this one once it lands.
#3877 (the decoder through cuBLAS) is closed, as asked on #3615; the stack above it was rebuilt on the kernel decoder.
Not supported
Said in the page: Metal and a bf16 path. On this pull request alone, also more than one request at a time, the
full_mrdecoder and condition values other than the "unknown" bucket; the stack adds those.atc overlap --jsonon202ec84dbcame back incomplete (its PR, file and time limits). Of what it checked: textual conflicts with #728 (2 files), #2302 (1) and #2523 (2); clean with #1411, #1835, #1951, #2415, #2762, #2763 and #2919; 31 more share files with merges not determined.