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/engine_hostmem.h
T
Deadcode ddcb9c69bb 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.
2026-11-14 22:32:28 +01:00

41 lines
2.3 KiB
C++

/* engine_hostmem.h -- the memory cgroup limits bring-up checks before it locks a table into host
* memory (engine_bringup.cpp, lockable_room). */
#pragma once
#include <cstdint>
#include <functional>
#include <string>
namespace rad {
/* A cgroup's limit less the usage reclaim cannot give back: memory.current less file pages (v2)
* or usage_in_bytes less cache (v1), since page cache yields to a locked allocation and anonymous
* memory does not. "max" and v1's near-INT64_MAX sentinel mean no limit. True, with `room` set,
* when `dir` has a limit. */
bool cgroup_room(const std::string& dir, bool v2, int64_t* room);
/* Every level of the memory cgroup at `path` (as /proc/self/cgroup names it), from that level up
* to the hierarchy's root mounted at `root`, leaf first: `visit(dir, room)` for each level with a
* limit, until it returns false. Each level is a limit of its own. */
void cgroup_levels(const std::string& root, std::string path, bool v2,
const std::function<bool(const std::string& dir, int64_t room)>& visit);
/* Every level of every memory cgroup the process is in, leaf first: `visit(dir, room)` until it
* returns false (cgroup_levels). /proc/self/cgroup reads "0::/path" on v2 and "N:memory:/path"
* (or a comma list naming memory) on v1; each level up to the visible root is a limit of its
* own. */
void memory_cgroups(const std::function<bool(const std::string& dir, int64_t room)>& visit);
/* The least room any of those levels leaves (cgroup_room), or INT64_MAX when none sets a limit:
* a container's --memory, which the OOM killer enforces whatever MemAvailable says. */
int64_t cgroup_least_room();
/* Whether `need` more bytes fit in host memory after `still` more this process will allocate
* first and `margin` (--host-headroom-mib) stays free, or why not. Checks MemAvailable; every
* memory cgroup from the process's own up to the visible root (Docker's --memory, enforced by the
* OOM killer); and, for an mlock()ed copy (`mlocks`), RLIMIT_MEMLOCK unless the process has
* CAP_IPC_LOCK. Pinned memory a card reads is a driver userptr mapping, which RLIMIT_MEMLOCK does
* not count. An unreadable limit is ignored, never guessed. */
bool lockable_room(int64_t need, int64_t still, int64_t margin, bool mlocks, std::string* why);
} /* namespace rad */