Archived
merge origin/main: the upstream LoRA-runtime refactor beneath the ref2va port
Merges upstream 1.10.0 (152 commits: the LoRA acquire/runtime refactor, the
form-1 LTX-2 scheduler family, guidance terms + negative prompts, decoder
selection, input_reference, new architectures) into the ref2va port branch.
Resolution rule throughout: keep BOTH feature sets; ABI numbering follows
upstream (RAD_ABI_VERSION 26, RAD_FORMAT_VER 2), with the port's video fields
unioned into RadVideoGenBatch/RadVideoGenDecl and abi_layout_table.h
regenerated from the live table.
Notable reconciliations:
* videos.cpp: the task grammars are disjoint by capability -- keyframe tasks
(i2va/l2va/flash-attn l2va/fl2va) are recognized only when decl.encodes,
so upstream models keep refusing them as unknown tasks; input_reference,
the LoRA tag/field pipeline, and the guidance/negative_prompt rendering
coexist with refs/ref2va; the prompt put() helper hoisted to block scope
for the media branch.
* video_schedule(): upstream's (steps, video_tokens, refine) keeps its
positional slots; the port's shift_video/shift_audio overrides move to the
tail so upstream's schedule tests call unchanged.
* r4d_selftest conv3d cases: the port's sp/st/causal/down/refl geometry and
upstream's tpad/tpre fold into one reference (ft = causal ? 2 : tpad==2 ?
2+tpre : 1); rms_mod rows keep the port's i8/fp8 quant modes alongside
upstream's wadd/norm_once/norm parameters.
* tests/oot_plugins.sh: the per-plugin cmake --install gains a --prefix
staging dir -- plugin .so files still land in the absolute
RAD_PLUGIN_INSTALL_HOME, but libr4d now also installs r4d_selftest to a
relative bin/, which needs no root.
Host ctest: 112/113 (mm_test's webp gap pre-exists this merge); r4d_selftest,
engine_e2e, oot_plugins, abi_layout, all LoRA tests green.
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
commit
a1a75da7e9
415 files changed
+78837
-5310
No files matched your search
@@ -72,7 +72,10 @@ struct SchedMetrics {
|
||||
/* Admissions whose prefix hit was cut to nothing, by reason, and the checkpoint shortfall:
|
||||
* attention-cached prompt tokens computed again (rad::SchedMetrics::hit_cut_tokens). */
|
||||
int64_t hit_cut_no_snapshot = 0, hit_cut_window = 0, hit_cut_adopt = 0;
|
||||
int64_t hit_cut_resumed_below = 0; /* resumed more than an interval below the hit */
|
||||
int64_t hit_cut_tokens = 0;
|
||||
/* Host-tier restores the pool could not hold whole (rad::SchedMetrics::prefix_restore_cuts). */
|
||||
int64_t prefix_restore_cuts = 0;
|
||||
/* Removed by --prefix-cache-ttl, cumulative. Not evictions: nothing wanted the memory. */
|
||||
int64_t prefix_expired = 0, prefix_ckpt_expired = 0;
|
||||
/* Decoupled prefix caching (spec §7.3). `prefix_hit_rate` is the attention hit rate, as in
|
||||
@@ -127,6 +130,9 @@ struct SchedMetrics {
|
||||
* a decode step regardless of load. */
|
||||
int64_t step_ns = 0;
|
||||
int64_t step_ns_decode = 0;
|
||||
/* The single-sequence decode floor and most recent window (rad::SchedMetrics). */
|
||||
int64_t step_ns_decode_best = 0;
|
||||
int64_t step_ns_decode_recent = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -625,7 +631,35 @@ struct ImageGenInfo {
|
||||
/* The model samples on a schedule of its own and takes no step count (a distilled model). */
|
||||
bool fixed_schedule = false;
|
||||
int64_t fixed_steps = 0;
|
||||
/* Guidance in the model card's terms: with `cfg_original` the scale s means cond + s (cond -
|
||||
* uncond), off at 0, and the core runs s + 1; otherwise uncond + s (cond - uncond), off at 1. */
|
||||
double default_cfg = 1.0;
|
||||
bool cfg_original = false;
|
||||
/* The negative prompt a guided request gets when it names none; without one it must. */
|
||||
bool has_default_negative = false;
|
||||
std::string default_negative;
|
||||
/* The pictures are not read by the conditioning network: they go to the generator's own
|
||||
* encoder only (RAD_GEN_LAYOUT_JOINT_STEP). */
|
||||
bool refs_encoder_only = false;
|
||||
/* A reference picture is shrunk to `ref_area` only when larger, then centre-cropped to the
|
||||
* size multiple; otherwise resized to `ref_area` at its aspect. */
|
||||
bool ref_shrink_only = false;
|
||||
/* A prompt of fewer tokens after the drop prefix is padded with `pad_token` up to this many
|
||||
* (RadGeneratorDecl::min_tokens); 0: no minimum. */
|
||||
int64_t min_tokens = 0;
|
||||
int32_t pad_token = 0;
|
||||
/* The prompt is also read through the model's second tokenizer (IImageGen::encode_aux), at
|
||||
* most `aux_max_tokens` ids of it. */
|
||||
bool aux_tokens = false;
|
||||
int64_t aux_max_tokens = 0;
|
||||
/* A discrete-time model (RadGeneratorDecl::train_steps): the samplers it serves (1 << id)
|
||||
* and the sampler and scheduler a request gets when it names none. 0 samplers: flow
|
||||
* matching, which takes neither field. */
|
||||
uint32_t samplers = 0;
|
||||
int32_t default_sampler = 0, default_scheduler = 0;
|
||||
/* The prompt in windows (RadGeneratorDecl::chunk_tokens): tokens a window, its markers and
|
||||
* its padding token; 0 for a prompt read whole. */
|
||||
int32_t chunk_tokens = 0, chunk_bos = 0, chunk_eos = 0, chunk_pad = 0;
|
||||
};
|
||||
|
||||
class IImageGen {
|
||||
@@ -639,6 +673,13 @@ public:
|
||||
virtual int picture(const mm::Frame& f, std::shared_ptr<mm::Item>* out, std::string* why) = 0;
|
||||
virtual int64_t queued() const = 0;
|
||||
virtual int64_t running() const = 0;
|
||||
/* The user's prompt through the model's second tokenizer (ImageGenInfo::aux_tokens), with the
|
||||
* special tokens that tokenizer adds; RAD_E_UNSUPPORTED for a model without one. */
|
||||
virtual int encode_aux(const std::string& text, std::vector<int32_t>* out) const {
|
||||
(void)text;
|
||||
(void)out;
|
||||
return RAD_E_UNSUPPORTED;
|
||||
}
|
||||
};
|
||||
|
||||
/* The audio generator (core/gen/audio_driver.h), for a model that makes music or other audio from
|
||||
@@ -702,6 +743,22 @@ struct VideoGenInfo {
|
||||
* encoders — a text-only or TE-only model leaves them and the server never prepares pixels. */
|
||||
int64_t encodes = 0, max_enc_frames = 0, max_enc_side = 0, max_enc_samples = 0;
|
||||
int64_t enc_ratio = 0;
|
||||
/* `steps` counts model evaluations rather than sigma grid points (RadVideoGenDecl form 1). */
|
||||
bool step_evals = false;
|
||||
/* Guidance (RadVideoGenDecl::guidance): the terms a request may name, their defaults and the
|
||||
* negative prompt a guided request gets when it names none. */
|
||||
bool guidance = false;
|
||||
double guidance_default[8] = {};
|
||||
std::string default_negative;
|
||||
/* Image to video: a first frame is taken, after an H.264 round trip at image_crf when > 0. */
|
||||
bool image_cond = false;
|
||||
int32_t image_crf = 0;
|
||||
/* A length head: a request that names no length gets the one the model predicts. */
|
||||
bool length_head = false;
|
||||
/* The decoders a request may name, the default first, and each one's largest frame in pixels
|
||||
* (RadVideoGenDecl::decoders); empty for a model with one. */
|
||||
std::vector<std::string> decoders;
|
||||
std::vector<int64_t> decoder_max_area;
|
||||
};
|
||||
|
||||
class IVideoGen {
|
||||
|
||||
Reference in new issue
Block a user