Repository navigation
Conversation
|
None touches the same code. Each resolves by keeping both entries, whichever lands first. The rest report |
|
Thanks @drowzeys. This is a clean family: it's isolated, all 45 pipelines are under the contract with 69 controls red, and the contract caught a real NaN bug in Before we review it as ready, a few items from the gate we agreed on #1627: 1. Please rebase onto main. On the log-mel front end: #1632 isn't on main yet, so keep your |
|
Hi @drowzeys, just checking in on LFM3-Omni. The family looks good, and that first audio frame time is still a great |
|
Hi @drowzeys, checking in once more on LFM3-Omni. It still looks good to us, and the list from our 1 Nov note is what's left, starting with the rebase. Our offer stands: if you'd like us to rebase it (the conflicts are only the shared record lists) and push it to your branch, say so here. And if your time's short, tell us which parts you'd like us to pick up. |
…kHz speech out A standalone family in Drama 3's shape: the four Liquid stacks of the bf16 release (speech encoder and projector, LFM3 backbone, depth decoder, Liquid codec decoder) over one metallib, the log-mel front end on the device, each codebook's pick on the GPU, and the codec streamed between backbone rows. `zig build lfm3-omni-generate` makes one turn from a WAV, writes and scores stage dumps against a reference's, and serves POST /v1/audio/chat (server-sent text deltas and 16-bit 24 kHz audio) and GET /health, one request at a time. Products of many rows take the tensor unit through the prefill GEMM's blocks; other chips a simdgroup-matrix product. Host tests cover the mel front end, the prompt, the streamed overlap-add, the synthesis basis and the Metal argument layouts.
…ts bf16 points, a control each Registers all 45 pipelines of lfm3_omni.metallib (69 registrations over the stacks' variants) in tf-kernel-contract: gates 1-4 against a float64 replay of each kernel's rounding points with the spread its fp32 steps allow, stated rules for the picks and the word moves, and a planted source change per registration. Gate 5 records the launches with their M1/M2 limits from --offline.
… weights' licence tools/lfm3_omni holds the development clients behind the receipt: the 16 synthetic spoken turns, the reference's stage dumps and spoken replies (transformers with the checkpoint's own code, on CUDA, MPS or the CPU), the stage comparison and its table, a streaming client for /v1/audio/chat, and the UTMOS and speech-vs-text scoring.
The codec took the few-row product for a one-frame chunk and the tiled product for longer ones, and the tiled attention summed a row's keys from its tile's first window, so a streamed reply and a whole decode differed in rounding. The codec's launches are now row-exact: the tiled product for every row count, and attention one row a launch, so a row's sums depend on its position alone. The backbone, the encoder and the depth decoder launch as before.
u was (float(h >> 40) + 0.5) / 2^24, and the fp32 sum rounds the largest draw up to 2^24, so u = 1 and the Gumbel noise +Inf: that code was picked whatever its logit. u is now float(h >> 40) / 2^24, exact in fp32 and below 1; a zero draw gives -Inf noise and is never drawn. Sampled replies change; greedy output does not. The contract's replay follows, and a third registration runs a seed whose draws reach both ends of the 24-bit range, the largest on a codebook's smallest logit; its control restores the old line and goes red.
The planted change dropped bf16(x + r), but the kernel reads x back rounded, so only the sum of squares moved and the control went red at about half of the seeds. It now drops bf16(r rsqrt), the control om_rmsnorm's residual registration uses.
…he two tokens A teacher-forced run printed only its totals. It now also prints a line for each text slot it picked differently: the slot, the reference's token, its own pick and its logits of both, so a receipt can state every miss's margin.
UTMOS22 median within 0.1 of the reference's and speech-vs-text WER within 1 point, with the gate's two precision bounds: every stage no further from an fp32 reference run than the reference's own bf16 run, and every teacher-forced text miss within 2 bf16 ulps.
…text misses with their margins reference_forced.py feeds the reference a dump's reply and scores its own picks, a frame at a time as the engine's --force does; reference_codec.py runs the bundled codec in fp32; reference_depth.py rounds the states it hands out to bf16 and scores two reference runs against each other; precision_table.py prints every stage for the engine against the bf16 and the fp32 reference and for the two references against each other; text_misses.py lists each teacher-forced text miss with both sides' logits.
…io margins, chunked decodes, a text model's tokens docs/receipts/lfm3-omni-metal holds the runs behind the recipe: the stage table with an fp32 column and the reference's own bf16-against-fp32 column, the four teacher-forced text misses with their margins, UTMOS22 and WER against the stated margins, the codec's chunkings byte for byte, and Qwen3.8-27B's tokens on main and on this branch. The recipe's tables follow it.
02fa671 to
8d01405
Compare
|
Thanks for your patience on this one. Rebased onto main (
Also:
Not run: the full-suite |
|
Thanks @drowzeys for the rebase and for working through all six items. The streamed-equals-whole fix in the codec and the stronger On your question: please close the six rows that miss the fp32 bar, rather than us accepting them as bf16 noise. The bar was set before the runs, and the project doesn't loosen a bar after seeing results. A lead that may help: the engine's log-mel differs from the reference's by up to 3.1e-4. That difference reaches every later stage. If you feed each stage the reference's own inputs, you can see which stages really depart and which only inherit the mel difference. Two smaller asks:
Once those rows pass, it can come out of draft.
|
What this changes
Adds
families/lfm3_omni, LiquidAI's LFM3-Omni-2B (speech in, streamed text and 24 kHz speech out) as a standalone family in Drama 3's shape, with its Metal backend, host tests, kernel-contract registrations, recipe and the checks' clients undertools/lfm3_omni/. Part of #1627 (the Metal half; the CUDA backend is a separate branch stacked on this one). It stays a draft until the fp32 rows of the stage table are settled (see the 16 Nov comment). Receipts are indocs/receipts/lfm3-omni-metal/.zig build lfm3-omni-generate(macOS): one turn from a WAV, stage dumps (--dump,--force,--depth-check) against a reference's, and--serve HOST:PORTwithPOST /v1/audio/chat(SSE text deltas and 16-bit 24 kHz PCM, or one JSON) andGET /health, one request at a time.main: the core, Drama 3's WAV module, and the prefill GEMM's tensor-unit blocks. It does not depend on the LFM3 text series (lfm3: serve LFM3-1.7B on CUDA: NVFP4 and FP8 weight-only, MLX 4-bit (stacked on #1513, #1492 and #1503) #1508, lfm3: admit official MLX text and VL checkpoints #1513, lfm3: serve the MLX text decoder on Metal #1514).5797d07c125503bd4f4c0e7f915ae2d3d703e8de, LFM Open License v1.0 (commercial use only under US$10M annual revenue; the recipe says so).Receipt
8d0140505on mainb4f1bf263; M5 Ultra (256 GB), macOS 27.0.1, Xcode 27.2 with the Metal compiler 32023.921, Zig 0.17.0; referencetransformers5.21.0 with the checkpoint's own code, PyTorch 2.14.1, MPS bf16, same Mac. The 16 synthetic turns oftools/lfm3_omni/utterances.txt(macOS voices), a voice-assistant system text.tools/lfm3_omni/parity.sh;precision.json). The third column is the reference's own bf16 against its fp32:text-misses.json). The eight against fp32 have margins of 0.19 to 8.82 ulps; the reference's own bf16 misses one of them too (text-misses-fp32.json).tools/lfm3_omni/speech_chat_client.py(temperature 0.4, penalty 1.2, seeds 1000 + i); the reference throughtools/lfm3_omni/reference_speech.py(first audio = first sampled frame plus that frame's codec decode). Two rounds, alternated; other services were resident on the Mac but idle (latency.json):quality.json). The margins, written into the recipe before the runs: UTMOS22 median within 0.1 of the reference's, WER within 1 point. TensorFold 4.427 median (4.352 min), WER 1.47%; reference 4.438 (4.149), WER 1.20%. Both met.LFM3_OMNI_NAX=0(chunking.txt). The codec takes the tiled product at every row count and attention one row a launch.text-family-tokens.json).Kernel contract (Metal, M5 Ultra)
All 45 pipelines of
lfm3_omni.metallibare registered (70 registrations over the stacks' variants): gates 1-4 against a float64 replay of each kernel's bf16 rounding points, stated rules for the picks and word moves, a planted source change per registration, and gate-5 launch records with M1/M2 limits from--offline.The full suite (every family) passed on the first head (378 kernels, 414 controls red) and has not been rerun on this one: see "Not run".
The contract found one real bug, fixed here before the receipt:
om_attention_tilesmultiplied masked keys' zero weights into the value sum, so a non-finite value row a query cannot see turned its output into NaN. The value loop now covers only the row's visible keys. Finite outputs are unchanged, byte for byte. The full suite ran throughtf-kernel-contract --rotary-accuracywith atf-rotary-sweepreceipt, becausezig build kernel-contractstops first at Flash Next'sUnrecordedRotaryCompilerprecondition, which this change doesn't touch.om_depth_picknow draws u = float(h >> 40) / 2^24, in [0, 1); a third registration runs a seed whose draws reach both ends of the 24 bits, and its control restores the old line and goes red.om_rmsnorm_1k's residual control dropped bf16(x + r) and went red at only about half of the seeds, because the kernel reads x back rounded; it now drops bf16(r rsqrt) and is red at every seed tried. One finding that no gate fails, noted for review:om_logmelreturns the floor for a NaN log (registered as its stated rule).Lean checker and tests
lean_new.py): 337 problems on the base, 337 here, 0 new.zig fmt --check build.zig zig: clean.tools/pr_check.py: 0 errors.zig build test test-golden -Dcpu=apple_m1: 880/880 steps, 13834 passed, 0 failed, 116 skipped (exit 0).zig build test-kernel-contract: 210/210 passed.zig build dev-tools -Dcpu=apple_m1: 268/268 steps (exit 0).zig build lfm3-omni-generate -Doptimize=ReleaseFast -Dcpu=apple_m1: builds.Not run, and why
--offlinecompiles only. On chips without tensor units, products of many rows take the simdgroup-matrix kernels, which are registered and pass on the M5 but are untested on those chips and slow on long prompts.tensorfold-native serve.zig build kernel-contracton this head: it needs about an hour of GPU on an isolated machine, and this Mac's GPU is serving models.From elsewhere
om_common.h'serf(for the exact GELU) uses the Chebysheverfcccoefficients published in Numerical Recipes. Say if you'd rather have a different erf.tools/lfm3_omni/score_replies.pyloads UTMOS22 strong fromtarepan/SpeechMOSv1.2.0 throughtorch.hub(a development tool, not engine code).Checklist
SUMMARYlines are above.