Repository navigation
Conversation
…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.
Contributor
Author
|
None touches the same code. Each resolves by keeping both entries, whichever lands first. The rest report |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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's a draft because the gate in #1627 isn't agreed yet.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
transformers5.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):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, this branch, the pre-split build and the reference alternated; other services were resident on the Mac but idle:Kernel contract (Metal, M5 Ultra)
All 45 pipelines of
lfm3_omni.metallibare registered (69 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 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.Two findings that no gate fails, noted for review: in sampled mode
om_depth_pickmapsh >> 40 == 2^24 - 1to u = 1 (about 2^-24 per candidate), andom_logmelreturns the floor for a NaN log (registered as its stated rule).Lean checker and tests
python3 tools/zig/lean_check.py: main4571 files, 425 problems; this branch4600 files, 425 problems. Zero added; the 425 are inherited.zig build test test-golden -Dcpu=apple_m1: 585/585 steps, 8484 passed, 0 failed, 52 skipped (exit 0).zig build test-kernel-contract: 139/139 passed.zig build dev-tools -Dcpu=apple_m1: 215/215 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.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.