Archived
radiance 2.0.0
Radiance becomes a multi-model engine: one process serves several models behind one port, loads each when a request names it, parks it in host memory or restores it from its container, and shares the cards between them (docs/MULTIMODEL.md). The configuration is one YAML file; the command line flags are gone (`radiance --config FILE`, hot reload on SIGHUP). Formats. IQ8R (rotated int8) and IQR-V4 replace FP8 and MXFP4 as whole-model formats, with an int8 KV cache (`kv-cache-dtype: i8`) in place of the fp8 one. Containers whose weights are block FP8, MXFP4, M2XFP4, NVFP4 or ParoQuant are refused at startup by the name of the first such weight. Not served until they have int8 containers: GLM-5.3-Flash, Ornith-1.5, Sage-A1.5, Nemotron-3.5-Bolt-74B, Ling-3.0-flash, drama-3 and Anima's FP8 container; Nemotron-3.5-Bolt-E4B, the Gemma 4 31B DFlash containers and MiniCPM5-2B bf16 serve without their drafter. 1.17.0 serves all of them. Speed. Chained launches for Qwen3.8-27B, Gemma 4, Gemma 3 and the small bf16 models, a new Qwen3.8-Flash-Next container (IQR-V4 experts, int8 trunk) with its decode step and prefill reworked, and a reworked adaptive draft window. Deployment. deploy/compose has two fleet files, tp1.yaml and tp2.yaml, each with its configuration beside it, in place of the per-model files. `host-pool-mib` is a model's host pool in all, split among its ranks. The dashboard is rebuilt: an hour of history kept by the server, each accelerator's memory by model, model states over time. Merged since 1.17.0: Nemotron-3.5-Bolt-74B-A9B by keptn42 (#339); GLM-5.3-Flash on four cards by AnimusNull (#397); chained launches for Flash-Next's decode step (#396) and preempted requests keeping their prefix and place (#405) by mici81; --prefill-interleave auto by Code000 (#410); eight more libr3d kernels and the w4a4 reference by RikshaDriver (#403, #407, #408); libr3d large-BAR and E4M3 decode fixes by neuromanMD (#438, #439); int4/int5 decode tiles by Kezi (#426); attention for Nanbeige 4.3 33B by everplays (#417); expert_stats_report.py by baKon (#431). Fixed: #398, #402, #419, #437 (dschmitz's patch); added the metrics of #392, and multi-model serving as asked for in #367 and #109. Plugin ABI 39: out-of-tree plugins need to be rebuilt. Thanks to @keptn42, @AnimusNull, @mici81, @Code000, @RikshaDriver, @neuromanMD, @Kezi, @everplays, @baKon and @dschmitz.
This commit is contained in:
1 parent
b4c04b6042
commit
ddcb9c69bb
696 files changed
+120770
-56596
No files matched your search
Vendored
+65
-9
@@ -3,7 +3,7 @@
|
||||
#include "value.h"
|
||||
|
||||
// for converting from JSON to jinja values
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "util/json.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
@@ -299,6 +299,58 @@ static value minmax_fn(const func_args & args) {
|
||||
return best;
|
||||
}
|
||||
|
||||
/* jinja2's unique() over a sequence: the first occurrence of each item, in order, compared by
|
||||
* `attribute` where one is given. Strings compare lowercased unless `case_sensitive` is true
|
||||
* (jinja2's default is false). A tuple stays a tuple. */
|
||||
static value unique_fn(const func_args & args) {
|
||||
args.ensure_count(1, 3);
|
||||
if (!is_val<value_array>(args.get_pos(0))) {
|
||||
throw raised_exception("unique: first argument must be an array");
|
||||
}
|
||||
value val = args.get_pos(0);
|
||||
value cs = args.get_kwarg_or_pos("case_sensitive", 1);
|
||||
value attribute = args.get_kwarg_or_pos("attribute", 2);
|
||||
const bool case_sensitive = !cs->is_undefined() && cs->as_bool();
|
||||
const bool attr_is_int = is_val<value_int>(attribute);
|
||||
const int64_t attr_int = attr_is_int ? attribute->as_int() : 0;
|
||||
const std::vector<value> & arr = val->as_array();
|
||||
auto key = [&](const value & v) -> value {
|
||||
value k = v;
|
||||
if (!attribute->is_undefined()) {
|
||||
if (attr_is_int && is_val<value_array>(v)) {
|
||||
k = v->at(attr_int);
|
||||
} else if (!attr_is_int && is_val<value_object>(v)) {
|
||||
k = v->at(attribute);
|
||||
} else {
|
||||
throw raised_exception("unique: unsupported object attribute comparison on " + v->type());
|
||||
}
|
||||
}
|
||||
if (!case_sensitive && is_val<value_string>(k)) {
|
||||
jinja::string low = k->as_string().lowercase();
|
||||
return mk_val<value_string>(low);
|
||||
}
|
||||
return k;
|
||||
};
|
||||
std::vector<value> keys, out;
|
||||
for (const auto & item : arr) {
|
||||
value k = key(item);
|
||||
bool seen = false;
|
||||
for (const auto & have : keys) {
|
||||
/* value_compare reads a number against a string as text; jinja2 keeps 1 and "1" apart */
|
||||
if (is_val<value_string>(k) == is_val<value_string>(have) &&
|
||||
value_compare(k, have, value_compare_op::eq)) {
|
||||
seen = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!seen) {
|
||||
keys.push_back(std::move(k));
|
||||
out.push_back(item);
|
||||
}
|
||||
}
|
||||
return is_val<value_tuple>(val) ? mk_val<value_tuple>(std::move(out)) : mk_val<value_array>(std::move(out));
|
||||
}
|
||||
|
||||
template<bool is_reject>
|
||||
static value selectattr(const func_args & args) {
|
||||
args.ensure_count(2, 4);
|
||||
@@ -924,10 +976,6 @@ const func_builtins & value_bool_t::get_builtins() const {
|
||||
return builtins;
|
||||
}
|
||||
|
||||
[[noreturn]] static value array_unique_not_implemented(const func_args &) {
|
||||
throw not_implemented_exception("Array unique builtin not implemented");
|
||||
}
|
||||
|
||||
const func_builtins & value_array_t::get_builtins() const {
|
||||
static const func_builtins builtins = {
|
||||
{"default", default_value},
|
||||
@@ -1133,7 +1181,10 @@ const func_builtins & value_array_t::get_builtins() const {
|
||||
std::reverse(arr.begin(), arr.end());
|
||||
return is_val<value_tuple>(val) ? mk_val<value_tuple>(std::move(arr)) : mk_val<value_array>(std::move(arr));
|
||||
}},
|
||||
{"unique", array_unique_not_implemented},
|
||||
/* RADIANCE: upstream leaves `unique` a stub that throws, with the same result as a
|
||||
* missing min or max above: GLM-5.3-Flash's template checks its tool-call ids with it,
|
||||
* and the model was reported as having no tool support. */
|
||||
{"unique", unique_fn},
|
||||
};
|
||||
return builtins;
|
||||
}
|
||||
@@ -1297,7 +1348,7 @@ const func_builtins & value_undefined_t::get_builtins() const {
|
||||
//////////////////////////////////
|
||||
|
||||
|
||||
static value from_json(const nlohmann::ordered_json & j, bool mark_input) {
|
||||
static value from_json(const rad::Json & j, bool mark_input) {
|
||||
if (j.is_null()) {
|
||||
return mk_val<value_none>();
|
||||
} else if (j.is_boolean()) {
|
||||
@@ -1307,7 +1358,7 @@ static value from_json(const nlohmann::ordered_json & j, bool mark_input) {
|
||||
} else if (j.is_number_float()) {
|
||||
return mk_val<value_float>(j.get<double>());
|
||||
} else if (j.is_string()) {
|
||||
auto str = mk_val<value_string>(j.get<std::string>());
|
||||
auto str = mk_val<value_string>(j.get_ref<const std::string &>());
|
||||
if (mark_input) {
|
||||
str->mark_input();
|
||||
}
|
||||
@@ -1394,7 +1445,7 @@ bool value_compare(const value & a, const value & b, value_compare_op op) {
|
||||
}
|
||||
|
||||
template<>
|
||||
void global_from_json(context & ctx, const nlohmann::ordered_json & json_obj, bool mark_input) {
|
||||
void global_from_json(context & ctx, const rad::Json & json_obj, bool mark_input) {
|
||||
// printf("global_from_json: %s\n" , json_obj.dump(2).c_str());
|
||||
if (json_obj.is_null() || !json_obj.is_object()) {
|
||||
throw std::runtime_error("global_from_json: input JSON value must be an object");
|
||||
@@ -1405,6 +1456,11 @@ void global_from_json(context & ctx, const nlohmann::ordered_json & json_obj, bo
|
||||
}
|
||||
}
|
||||
|
||||
void global_set_from_json(context & ctx, const std::string & key,
|
||||
const rad::Json & j, bool mark_input) {
|
||||
ctx.set_val(key, from_json(j, mark_input));
|
||||
}
|
||||
|
||||
// recursively convert value to JSON string
|
||||
// TODO: avoid circular references
|
||||
static void value_to_json_internal(std::ostringstream & oss, const value & val, int curr_lvl, int indent, const std::string_view item_sep, const std::string_view key_sep) {
|
||||
|
||||
Reference in new issue
Block a user