This repository has been archived on 2026-11-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
radiance-sycl/core/fleet/config.h
T
Deadcode 2a2b756371 radiance 2.1.0
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.
2026-11-15 16:00:05 +01:00

145 lines
6.3 KiB
C++

/* fleet/config.h -- the YAML file that configures a radiance process (docs/MULTIMODEL.md §4).
*
* One file names every model the process serves and the settings they share. Each former command
* line flag is a key with the same name and no leading dashes, at the level it belongs to:
*
* server: the listener, authentication, logging and plugin search path (§4.3)
* cards: the cards models may use
* memory: per-card VRAM headroom and the host budgets
* scheduler: load and drain timeouts, the keepalive interval
* defaults: per-model keys merged under every model
* models: one entry per model, keyed by its id
* groups: together / exclusive co-residency rules
*
* Top-level keys that start with `x-` are ignored, so a file can keep anchors there and merge them
* into models with `<<: *name`.
*
* A model's keys are turned back into the flag list config_parse reads, so a key and its flag are
* validated by the same code and cannot drift. The loader adds only what the flag table cannot
* express: levels, the defaults merge, the fleet's own keys, and provenance (which YAML path set
* each option, for the startup report).
*/
#pragma once
#include "rad_core.h"
#include <cstdint>
#include <cstdio>
#include <string>
#include <vector>
namespace rad::fleet {
/* A model's share of the card's flex pool above its fixed part (§6.3). -1 is "not set": the
* floor defaults to one sequence at the model's context bound and the ceiling to everything the
* card can lend. */
struct FlexSpec {
int64_t kv_min_tokens = -1;
int64_t kv_max_tokens = -1;
double kv_weight = 1.0;
int64_t experts_min_mib = -1;
int64_t experts_max_mib = -1;
bool operator==(const FlexSpec&) const = default;
};
/* What a parked model keeps (§7.2). */
struct ParkSpec {
enum class Vram { None, Statics, Mib };
enum class Ram { Required, Allowed, Never };
/* How it comes back from host memory: every byte onto the card before it serves, or serving
* at once with the rest read in place over the link while it moves (dev_page_in_live). Live
* suits a model whose steps read a small part of what is parked (a tiered MoE's experts) or
* that computes long per byte read; a dense model decoding reads all of it every step, so its
* reads share the link with the move and both run slower (docs/MULTIMODEL.md §7.4). Auto is
* Full, except that a one-step model (an embedding program) whose cards lack the room for all
* of it serves at once with its weights read in place until free memory takes them (§7.5). */
enum class Restore { Auto, Full, Live };
Vram vram = Vram::None;
int64_t vram_mib = 0; /* with Vram::Mib: the head of the first-use order kept */
Ram ram = Ram::Allowed;
Restore restore = Restore::Auto;
bool operator==(const ParkSpec&) const = default;
};
struct ModelEntry {
std::string name; /* the model id requests name; never contains ':' */
std::vector<std::string> aliases;
int priority = 0;
bool pin = false;
int64_t ttl_ms = 0; /* idle time before parking; 0 = never */
FlexSpec flex;
ParkSpec park;
/* The flag list `cfg` was parsed from, without the program name, in a fixed order: server
* keys, then the model's own and inherited keys sorted by name. Two entries with equal args
* configure identical engines, which is what hot reload compares (§10). */
std::vector<std::string> args;
Config cfg;
};
struct Group {
enum class Kind { Together, Exclusive };
std::string name;
Kind kind = Kind::Together;
std::vector<std::string> members;
};
struct FleetConfig {
std::string path; /* the file read, for messages */
/* server.log: Info, Debug or Trace. Unset (`log_set` false), the level RADIANCE_LOG chose
* stands. */
Log log = Log::Info;
bool log_set = false;
/* cards: empty means every card. */
std::vector<int> cards;
/* memory: the per-card keys travel inside every model's flag list; these are the fleet's own. */
int64_t host_mib = 0; /* 0 = not set */
std::string disk_tier;
/* scheduler: */
int64_t load_timeout_ms = 120000;
int64_t drain_timeout_ms = 30000;
int64_t keepalive_ms = 10000;
/* A device that has advanced nothing for this long ends the process, so a restart policy can
* bring the server back (dev_stuck_exit_ms); 0 never. */
int64_t stuck_exit_ms = 60000;
/* Once the listener is open and nothing waits, unpinned models load one at a time into free
* VRAM and park to host memory and the disk tier as later ones displace them, so a first
* request finds its model parked rather than cold (docs/MULTIMODEL.md §8.6). */
bool warm_up = true;
std::vector<ModelEntry> models;
std::vector<Group> groups;
/* The model a name or alias resolves to, or null. */
const ModelEntry* find(const std::string& name_or_alias) const;
};
/* Read and validate `path`. RAD_OK, or RAD_E_INVAL after RAD_ERR lines that name the file, the
* line and the key. Nothing is half-applied: on failure *out is left as it was. */
int load(const std::string& path, FleetConfig* out);
/* The same from text already in memory; `origin` names it in messages. */
int parse(const std::string& text, const std::string& origin, FleetConfig* out);
/* The YAML equivalent of a command line, for the message that refuses the removed flags: the
* flags as one model named after the container, server and memory keys at their levels. A word
* that is not an option is kept as a model key, so loading the result refuses it by name. */
std::string yaml_from_args(int argc, char** argv);
/* The option keys a level holds ("server" or "memory"), without the fleet's own keys. */
std::vector<std::string> level_keys(const std::string& level);
/* The key reference `radiance --help` prints: the levels, then every key with its argument and
* help, grouped by level. */
void print_reference(FILE* to);
/* Durations: "250ms", "30s", "30m", "2h"; a bare number is seconds. False on anything else. */
bool parse_duration_ms(const std::string& s, int64_t* out_ms);
} // namespace rad::fleet