Skip to content

Add D1-Omni audio decisions and reusable LFM runtimes - #1199

Merged
0xShug0 merged 1 commit into
mainfrom
feature/lfm-d1
Nov 4, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
feature/lfm-d1

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Adds Liquid AI's d1-Omni-2B audio decisions as the lfm_d1_omni family. The cls task accepts audio and named questions, returning calibrated yes/no, single/multiple-choice, score, and numeric-estimate answers. It loads the official main/mmproj GGUF pairs directly, with Q8_0, F16, and BF16 package entries.

Adds reusable LfmDecoderRuntime and Lfm3AudioEncoderRuntime. The decoder shares layer math between full-sequence execution and independent causal decode sessions, with persistent KV/short-convolution state, cached prefill/step graphs, backend-only cache growth, and device outputs. The audio encoder accepts prepared features and returns device embeddings. Checkpoint binding, weight ownership, preprocessing, questions, and calibration remain model-local. D1 uses full-sequence execution with its own visibility masks; existing LFM audio implementations are unchanged.

Includes the model license, usage guide, README entry, and speech-analysis routing entry.

Validation

  • Debug CLI/server builds pass. The renamed family and lfm_d1_omni.attention=auto pass a real CUDA Q8_0 smoke test.
  • Real-package coverage: CUDA F16/Q8_0/BF16; Vulkan and CPU F16/Q8_0; mixed question types, question-set grouping, score readouts, and attention selection. Repeated speech/music/snapping requests reproduce the original speech result when returning to that input.
  • Independent FP64 decoder oracle tests pass on CPU, CUDA, and Vulkan. Coverage includes eager/flash attention, hybrid layers, sparse readout, device inputs/outputs, graph reuse/eviction, reset, scratch release, cache growth, independent decode sessions, and a decode session outliving its factory runtime.

Performance

A warmed 14.1-second speech request with five mixed questions, using the official Q8_0 main/mmproj pair and eight CPU threads. Debug build; RTX 5090 for CUDA/Vulkan and Ryzen 9 7900X for CPU. Session latency includes feature extraction and inference, excluding model loading and file I/O. These are individual warmed requests, not repeated-run averages.

Backend Warm request latency
CUDA 21.1 ms
Vulkan 29.6 ms
CPU 1,068.0 ms

@0xShug0
0xShug0 merged commit d804a11 into main Nov 4, 2026
7 checks passed
@0xShug0
0xShug0 deleted the feature/lfm-d1 branch November 4, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant