Archived
New models. Recursive Flint (39.8B, about 2.5B active) by everplays (#422): `arch/flint`, as an IQ8R container with rotated int8 experts or a four-bit one, with a sink-aware WMMA prefill attention and the fused attention prologue at `rotary_dim` 0. Meta Muse Glimmer 30B by launch80_assets (#423): bf16, an int4 trunk or IQ8R, its windowed vision tower, its DFlash drafter, the ATEM tool dialect and context extension. Ling-3.0-tiny by RikshaDriver (#441): served from its GGUF releases or as IQ8R on `bailing_hybrid`, with six more libr3d kernels. Block FP8, MXFP4 and NVFP4 conversions of the three are not served. IQ8R containers of all three (round to nearest, no calibration) are on Hugging Face under StillDeadcode: flint-iq8r, muse-glimmer-30b-iq8r-dflash and ling-3.0-tiny-iq8r. They were checked for sane answers on two R9700; nothing was benchmarked, and Muse Glimmer's pictures, video and tool calls were not tried. Speech. Breeze-TTS-2 clones a voice from a reference recording and its transcript, with an optional delivery direction, by farcryjohn (#436). The published Breeze container needs converting again with the updated recipe before it can. Tools. A model entry with `diagnose: DIR` runs a fixed workload on the engine instead of serving and writes a report: step times, tokens a step, draft acceptance, TTFT and prefill rates by category, concurrency and prompt length, and with `diagnose-baseline` a token-for-token comparison against an earlier report (docs/DIAGNOSE.md), by Code000 (#418). Scheduler. `mixed-step-target-ms` holds a mixed prefill and decode step to a service time, off by default, by tnhnyzc (#413). `scheduler.stuck-exit` (60s by default, 0 never) ends the process when the device has advanced nothing for that long, so a restart policy brings a hung server back (#409, #415, #428). Fixed. Draft trees with the int8 KV cache, which stopped Gemma 4 31B with DFlash2 on its first request (#454, diagnosed by aelfwyne). The expert loan held at zero by a few leftover cache blocks after long sessions (#455, diagnosed by thekk1). The mapped tier's pages kept in the page cache across a load and a restore, by C_Tamas (#421). Replayed tool calls with blank arguments, and arguments that are not JSON refused naming the call, by dschmitz (#444). The dashboard's card temperature reads the junction sensor, by dschmitz (#453). The VRAM shortfall report says what the KL mode needs, by baKon (#448). The out-of-tree plugin test builds its plugins in parallel and takes its toolchain from the tree. Plugin ABI 40: out-of-tree plugins need to be rebuilt. Thanks to @everplays, @launch80_assets, @RikshaDriver, @farcryjohn, @Code000, @tnhnyzc, @C_Tamas, @dschmitz, @baKon, @aelfwyne and @thekk1.
85 lines
3.2 KiB
C++
85 lines
3.2 KiB
C++
/* audio.h -- audio generation: the request and the channel its audio comes back on.
|
|
*
|
|
* An audio generator (abi/rad_builder.h, rad_declare_audio_generator) makes a piece in two stages,
|
|
* a language model writing it frame by frame and a denoiser turning runs of frames (windows) into
|
|
* audio, which a vocoder plays. core/gen/audio_driver.h turns a request into those passes; this is
|
|
* what a caller hands it and what it hands back: a window's samples as each is vocoded, then the
|
|
* end.
|
|
*/
|
|
#pragma once
|
|
#include "rad_core.h"
|
|
|
|
#include <atomic>
|
|
#include <condition_variable>
|
|
#include <deque>
|
|
#include <memory>
|
|
#include <mutex>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace rad {
|
|
namespace gen {
|
|
|
|
/* One window's playable samples, interleaved, in [-1, 1]. */
|
|
struct AudioChunk {
|
|
int32_t window = 0;
|
|
std::vector<float> samples;
|
|
};
|
|
|
|
/* As Ticket (gen.h) is for an image: the driver thread writes, the caller reads. */
|
|
class AudioTicket {
|
|
public:
|
|
/* driver side */
|
|
void push(AudioChunk&& c);
|
|
void finish(int status, const std::string& why = std::string());
|
|
|
|
/* caller side: the next chunk, or false once the request has ended and every chunk was
|
|
* taken. Waits at most `ms` milliseconds; `*timed_out` marks a false that was a timeout. */
|
|
bool next(AudioChunk* out, int ms, bool* timed_out);
|
|
bool finished() const;
|
|
int status() const;
|
|
std::string why() const;
|
|
|
|
std::atomic<bool> cancel{false};
|
|
|
|
/* Usage for the response, written by the driver before finish(): prompt tokens, frames made,
|
|
* windows played and per-phase times. */
|
|
int64_t in_tokens = 0, frames = 0, windows = 0;
|
|
int64_t t_submit_ns = 0, t_prompt_ns = 0, t_frames_ns = 0, t_first_audio_ns = 0,
|
|
t_done_ns = 0;
|
|
/* Why the piece ended: the model ended it, or it reached the request's length. */
|
|
bool model_ended = false;
|
|
|
|
private:
|
|
mutable std::mutex mu_;
|
|
std::condition_variable cv_;
|
|
std::deque<AudioChunk> q_;
|
|
bool done_ = false;
|
|
int status_ = RAD_OK;
|
|
std::string why_;
|
|
};
|
|
|
|
struct AudioRequest {
|
|
/* The conditional prompt, and the unconditional one when the declaration renders it from a
|
|
* template of its own (RadAudioGenDecl::neg_tmpl); otherwise it is derived from the
|
|
* conditional prompt as the declaration says (neg_token), and `neg_tokens` is empty. */
|
|
std::vector<int32_t> tokens;
|
|
std::vector<int32_t> neg_tokens;
|
|
/* References (RadAudioGenDecl::tmpl_ref): the clips' samples end to end, each padded to whole
|
|
* frames; their bounds in samples, [clips + 1]; and for each row of `tokens` the frame of the
|
|
* clips it is, -1 for a token. All empty without references. */
|
|
std::vector<float> ref_audio;
|
|
std::vector<int32_t> ref_cu;
|
|
std::vector<int32_t> ref_frame;
|
|
/* Reference-direction guidance: the negative prompt's own map into the same clips. */
|
|
std::vector<int32_t> neg_ref_frame;
|
|
int64_t max_frames = 0; /* the most frames to make, >= 1 */
|
|
int32_t steps = 0; /* 0: the model's default */
|
|
float cfg = 0.0f; /* 0: the model's default */
|
|
uint64_t seed = 0;
|
|
std::shared_ptr<AudioTicket> ticket;
|
|
};
|
|
|
|
} /* namespace gen */
|
|
} /* namespace rad */
|