radiance 1.3.0

- #47: llama-server's request fields, routes and sampler order, and /props (with baKon's model
  entry: max_model_len, root and capabilities on /v1/models, and /v1/models/:id)
- new APIs: Anthropic's Messages API (/v1/messages), OpenAI's Responses API (/v1/responses),
  llama-server's /completion and /infill, logprobs (OpenAI's logprobs and top_logprobs, up to
  20; llama-server's n_probs), OpenAI's legacy `functions`, and X-Api-Key beside the bearer key
- #4: --model takes a Hugging Face repo id (owner/name), fetched before startup into
  ~/.cache/radiance/hf or --download-dir and checked for changes at every start (redxherring)
- #46: --tp 3 --tp-wire wht6 serves -- a three-rank two-shot all-reduce with uneven shards and
  the tiered-int8 wire over it (baKon); scripts/cardclock.py names what holds each card's clock
  under load (baKon)
- CPU-only serving works again; --kernels names the kernel libraries to load; a model the
  loaded libraries cannot fully serve refuses at startup instead of failing its first request;
  --vram-kv-mib and --vram-weights-mib are gone (the split is automatic)
- --embedding-placement ram is the default, and `auto` is gone
- #40: Swift 1.5 recipes; rad-convert reads which shard holds a tensor from the index
- #53: the pinned host pool gets huge pages where shmem THP is off; #57: a crash on video with
  an odd frame width is fixed
This commit is contained in:
Deadcode committed 2026-10-08 18:22:08 +02:00
1 parent 6a2ee986d6
commit 89cee7ce41
107 files changed
+6849 -1091

No files matched your search

+23 -6
View File
@@ -111,7 +111,7 @@ struct MoveUnit {
/* WHAT THE UNIT ACTUALLY COSTS A POOL, which is its class's slot stride and not `bytes`. The
* planner budgets against this and the mover allocates this, so the two cannot drift -- and
* the direction they would drift in is an overrun of the pool the operator sized. `bytes` is
* the direction they would drift in is an overrun of the weights pool. `bytes` is
* still what the report attributes to the weights, because padding is not a weight. */
int64_t slot_bytes = 0;
@@ -179,7 +179,7 @@ struct SlabClass {
/* SHADOW SLOTS: slab slots that are allocated but hold no unit, so a promotion writes into one
* and only then publishes and never DMAs over a slot a kernel might still be reading (mover.h).
*
* THEY COME OUT OF --vram-weights-mib, like everything else in the slab. Taking them from
* THEY COME OUT OF THE WEIGHTS POOL, like everything else in the slab. Taking them from
* whatever VRAM is left over after the slabs is not an option: spec §6 budgets every pool
* explicitly and --gpu-headroom-mib is memory the engine promises NOT to touch. So dynamic
* placement costs a few resident units, and the plan report prints exactly how many.
@@ -260,7 +260,7 @@ public:
* routed layer starts (place/stager.h, FileStager). `file_layer_max` is the most one layer's
* file-tier units take in a buffer, each at its own size rounded to RAD_ALIGN_UNIT, which is
* how the stager packs them; `file_stage_vram` is the two buffers, taken out of
* --vram-weights-mib before any expert is made resident. Both 0 when nothing routed is on the
* the weights pool before any expert is made resident. Both 0 when nothing routed is on the
* file tier. */
int64_t file_layer_max = 0;
int64_t file_stage_vram = 0;
@@ -310,8 +310,23 @@ struct PlannerInput {
* served directly is neither grouped by movement unit nor aligned for O_DIRECT, so with this
* false no unit is file-direct and both tiers are closed (spec §4.3). */
bool container = true;
/* No card is visible and the device backend is the host's own memory (device_is_host()), so a
* host kernel can read the weights pool as well as the container's mapping. See
* mapped_unit(). */
bool host_backend = false;
};
/* DOES A UNIT STAY IN THE CONTAINER'S MAPPING because only a host kernel can read it? On a card,
* always: a host kernel cannot read VRAM, and the mapping is the one host address its bytes
* already have. On the host backend the weights pool is host memory too, and a unit whose stored
* form is not the container's (a widening or a relayout its host kernel asked for at load, or a
* checkpoint served directly) has no place in the mapping that looks the way its kernel reads it,
* so there it takes a converted copy in the weights pool like any other weight. One rule, for the
* planner and the budget alike. */
inline bool mapped_unit(bool host_only, bool direct, bool host_backend) {
return host_only && (direct || !host_backend);
}
class Planner {
public:
explicit Planner(const PlannerInput& in) : in_(in) {}
@@ -399,10 +414,12 @@ struct WeightFootprint {
};
/* `embedding` is what the token embedding's placement resolved to; only Ram moves it out of the
* statics. `ngram` is the n-gram table's; only Vram puts it among them, and only where a device
* kernel reads it. Stated by every caller, so the budget and the planner cannot count it
* differently. */
* kernel reads it. `host_backend` and `container` are PlannerInput's: whether a host kernel can
* read the weights pool, and whether the weights lie in a container at all (a checkpoint served
* directly has no mapping a unit could stay in). Stated by every caller, so the budget and the
* planner cannot count it differently. */
void weight_footprint(const Program& prog, WeightFootprint* out, TablePlacement embedding,
TablePlacement ngram);
TablePlacement ngram, bool host_backend, bool container);
/* THE PINNED STAGING THE FILE TIER TAKES OUT OF --host-pool-mib before any unit is placed in it:
* RAD_PLACE_FILE_STAGE_SLOTS of the widest per-layer unit, and the read windows when a routed