radiance 1.2.2

- Static YaRN for the Qwen rotary paths (#37): a container whose config names YaRN gets it in
  attention, the QSA index keys and a DFlash2 drafter; one reader for every rotary type, and a
  LLaMA container whose type is not served (llama3, longrope, dynamic) is refused by name.
- --rope-scaling yarn:FACTOR[:ORIG] (#38) writes YaRN over a container's own rotary keys at load,
  no reconvert; the persisted prefix cache's fingerprint carries the resolved rotary.
- An uneven world's cheaper rank (#36) pages the common token count and gives the rest of its
  VRAM to its experts; a plan and pool that disagree refuse to start.
- MoE prefill (#35): wide gather, parallel scan and run-map prefix, 256-column down tile, early
  weight loads -- by rule, bit-identical.
- MoE decode (#34): the sorted operand's own down kernel, its column tiles by routed rows.
- --draft-window fixed|adaptive (#24): a per-sequence draft window priced by measured step time,
  one head depth per step over the batch; fixed stays the default. New metric
  radiance:draft_position_accepted_total and Grafana panels.
- Out-of-tree plugin builds compile to the tree's device code from any build directory.
This commit is contained in:
Deadcode committed 2026-10-07 12:37:53 +02:00
1 parent 6fa7707dff
commit ac79f4dc8a
63 files changed
+2744 -8759

No files matched your search

+42
View File
@@ -25,6 +25,8 @@
#include "rad_test.h"
#include "device/directio.h"
#include "mem/pools.h"
#include "mem/vram_budget.h"
#include "place/heat.h"
#include "place/mover.h"
#include "place/stager.h"
@@ -410,6 +412,46 @@ TEST(planner_spills_experts_before_dense_weights) {
CHECK_EQ(zero_copy, 6);
}
/* A RE-SPLIT RANK'S CONFIG REACHES BOTH READERS OF THE POOL SIZES. Engine::plan hands a rank whose
* cache costs less per token its own Config (vram_budget_rank_split): Pools::configure allocates
* the weights pool from it and the planner budgets the slab from it (Budgets::from), and the two
* have to read the same copy -- a grown pool the planner never reads is an empty pool, and a plan
* against a pool the rank does not have overruns it. plan_check_weights_pool is the startup check
* that they did. */
TEST(a_resplit_ranks_config_reaches_the_pools_and_the_planner) {
Fixture f;
build_moe(f, 8, 1 * MiB, nullptr);
Config common = base_config();
common.placement = "expert_tiered";
common.vram_weights_mib = 5; /* 1 MiB embedding and room for three experts and a shadow */
common.vram_kv_mib = 8;
common.host_pool_mib = 64;
const RankSplit rs = vram_budget_rank_split(common.vram_weights_mib, common.vram_kv_mib, 2,
64 * MiB);
CHECK(rs.resplit);
Config rc = common;
rc.vram_weights_mib = rs.weights_mib;
rc.vram_kv_mib = rs.kv_mib;
Pools pools;
CHECK_OK(pools.configure(rc, 0, &rad_malloc_allocator(), &rad_malloc_allocator()));
CHECK_EQ(pools.weights().bytes(), rs.weights_mib * MiB);
CHECK_EQ(pools.kv().bytes(), rs.kv_mib * MiB);
CHECK_EQ(Budgets::from(rc).vram_weights, pools.weights().bytes());
Plan grown, flat;
{ PlannerInput in{&f.prog, &rc, 0, 1, nullptr, 0}; CHECK_OK(Planner(in).plan(&grown)); }
{ PlannerInput in{&f.prog, &common, 0, 1, nullptr, 0}; CHECK_OK(Planner(in).plan(&flat)); }
CHECK_EQ(grown.vram_budget, pools.weights().bytes());
CHECK_EQ(plan_check_weights_pool(grown, pools.weights().bytes()), RAD_OK);
/* The grown pool is planned into: more of the experts are on the card. */
CHECK(grown.totals.bytes[(int)Tier::VRAM] > flat.totals.bytes[(int)Tier::VRAM]);
CHECK(grown.totals.bytes[(int)Tier::VRAM] + grown.slab_overhead <= pools.weights().bytes());
/* A planner handed the common split beside the rank's grown pool is refused by name. */
CHECK_EQ(plan_check_weights_pool(flat, pools.weights().bytes()), RAD_E_STATE);
}
/* THE BUDGET'S EXPERT FLOOR PLACES EVERY EXPERT. A lending cache leaves the expert slab exactly
* expert_vram_floor, so a floor short of what the planner spends -- the residents, the slab's
* spare slots beside them, and the slack each first-fit pass can strand -- is experts with no