Archived
radiance 1.7.0
- every model serves without a GPU: libavx covers every op, so `--kernels libavx` alone serves every shipped container - Qwen3-ASR (zivius): speech to text on /v1/audio/transcriptions and live over /v1/realtime - /v1/messages works with Claude Code as it ships (gearwave00001) - a long agent conversation keeps its cached history when the client rewrites its last turn (manueloverride) - a stream's first event goes out with the first token, so llama-benchy measures prefill right - opt-in --prefill-interleave (Smellyyyy, baKon) and --prefill-span (keptn42) - four-rank TP releases the link early; four-rank selftests and docs/TP4.md (goodman-b) - NVFP4 and FP8 compressed-tensors imports (devmilan); tools/rad-export for finetunes and LoRA adapters (baKon) - many fixes, among them lost tokens on stop strings under concurrency, keep-alive, MiniCPM5 tool arguments and the CPU's vision and audio encoders - plugin ABI 17 and changed op schemas: out-of-tree plugins must be rebuilt
This commit is contained in:
1 parent
b068190326
commit
1e968f6e1d
739 files changed
+128447
-84632
No files matched your search
+34
-42
@@ -1,19 +1,16 @@
|
||||
/* tunecache.h -- the ONE tuning cache. rad-tune writes it, the selector reads it at declare.
|
||||
/* tunecache.h -- the single tuning cache: rad-tune writes it, the selector reads it at declare.
|
||||
*
|
||||
* Constraint matching finds a kernel that is CORRECT for a geometry. Within one kernel there are
|
||||
* usually many tile configurations and the right one is a property of the shape and the machine
|
||||
* (spec §15). This file is the whole of the mechanism, and it is deliberately one file and one
|
||||
* format: the alternative is every plugin inventing its own tuning tool and its own file, and the
|
||||
* engine being unable to say why a shape is slow.
|
||||
* Constraint matching finds a kernel that is correct for a geometry; within a kernel the best tile
|
||||
* configuration depends on the shape and the machine (spec §15). One cache and one format for all
|
||||
* plugins, so the engine can always say how a shape was tuned.
|
||||
*
|
||||
* ================================================================= THE FORMAT
|
||||
* ================================================================= the format
|
||||
*
|
||||
* $RADIANCE_HOME/tune/<machine>.tune
|
||||
*
|
||||
* One file per machine, because "which machine" is the coarsest key and a cache measured on
|
||||
* another card is not a slower answer, it is a wrong one. UTF-8 text, LF-terminated, because a
|
||||
* human has to be able to read it, diff it, delete one line of it, and check it into a repo
|
||||
* beside a deployment. It is small: one row per (kernel, shape) the declared graph asks for.
|
||||
* One file per machine (a cache from another card is wrong, not just slow). UTF-8 text,
|
||||
* LF-terminated, so it can be read, diffed, edited and versioned. One row per (kernel, shape) the
|
||||
* declared graph asks for.
|
||||
*
|
||||
* line 1 `radtune 2` magic and format version
|
||||
* line 2 `machine <machine-key>` must equal the reader's own key
|
||||
@@ -22,27 +19,23 @@
|
||||
*
|
||||
* kernel RadKernelInfo.name, the entry point. No spaces.
|
||||
* plugin RadPluginInfo.name that supplied it. No spaces.
|
||||
* choice the TUNED AXES that won, `key=value` comma separated and sorted by key -- for
|
||||
* example `mb=3,npw=4,sk=8`. `-` for a kernel with nothing to tune. It is a point
|
||||
* in the space RadTunable declares, not a name out of a list: a name would tie the
|
||||
* cache to a spelling the library happens to use this release, and a library is
|
||||
* free to add an axis or widen one between builds. An axis the reader no longer
|
||||
* declares is ignored on lookup; one it declares and the row omits falls back to
|
||||
* that axis`s default, so a cache written before an axis existed still helps.
|
||||
* choice the winning tuned axes, `key=value` comma separated, sorted by key (e.g.
|
||||
* `mb=3,npw=4,sk=8`); `-` for a kernel with nothing to tune. A point in the
|
||||
* RadTunable space, not a variant name, so libraries may add or widen axes. An axis
|
||||
* no longer declared is ignored on lookup; a declared axis the row omits takes its
|
||||
* default.
|
||||
* us median microseconds per launch, `%.6f`.
|
||||
* measured ISO-8601 UTC, e.g. `2026-09-04T09:11:02Z`. --debug-graph prints it, because the
|
||||
* age of a measurement -- taken before a driver or library changed underneath it --
|
||||
* answers a large share of the questions a slow shape produces.
|
||||
* geometry the resolved parameters, `key=value` sorted by key, space separated. Ranges are
|
||||
* ALREADY COLLAPSED to the band's upper bound -- a bucket table row is what was
|
||||
* measured, so a bucket table row is what is keyed.
|
||||
* measured ISO-8601 UTC, e.g. `2026-09-04T09:11:02Z`; --debug-graph prints it, since a
|
||||
* measurement may predate a driver or library change.
|
||||
* geometry the resolved parameters, `key=value` sorted by key, space separated, with ranges
|
||||
* collapsed to the band's upper bound (a bucket table row is what was measured).
|
||||
*
|
||||
* The lookup key is (kernel, plugin, geometry). Not the op: two kernels can serve one op and they
|
||||
* tune independently. A row whose kernel no longer exists is kept on rewrite and
|
||||
* ignored on lookup, so downgrading a plugin does not throw away the measurements.
|
||||
* The lookup key is (kernel, plugin, geometry), not the op: kernels serving one op tune
|
||||
* independently. Rows for missing kernels are kept on rewrite and ignored on lookup, so a plugin
|
||||
* downgrade keeps the measurements.
|
||||
*
|
||||
* A missing file is not an error. Every RadTunable carries its own `deflt`, so an untuned install
|
||||
* is fast rather than broken (spec §15), and this cache only ever moves a shape off those defaults.
|
||||
* A missing file is not an error: every RadTunable has its own `deflt` (spec §15), and the cache
|
||||
* only moves shapes off those defaults.
|
||||
*/
|
||||
#pragma once
|
||||
#include "../rad_internal.h"
|
||||
@@ -62,8 +55,8 @@ struct TuneRow {
|
||||
|
||||
class TuneCache {
|
||||
public:
|
||||
/* Missing file -> RAD_OK with an empty cache. Malformed line -> skipped with a Warn naming
|
||||
* the line number; a cache is an optimisation and a typo in it must not stop a server. */
|
||||
/* Missing file: RAD_OK, empty. Malformed line: skipped with a warning naming it; a bad cache
|
||||
* must not stop a server. */
|
||||
int load(const std::string& radiance_home, const std::string& machine);
|
||||
int save(const std::string& radiance_home) const;
|
||||
|
||||
@@ -77,17 +70,15 @@ public:
|
||||
const std::vector<TuneRow>& rows() const { return rows_; }
|
||||
bool empty() const { return rows_.empty(); }
|
||||
|
||||
/* `key=value` sorted by key, space separated. The canonical spelling of a shape; every
|
||||
* component that keys on one must go through here or two of them will disagree. */
|
||||
/* `key=value` sorted by key, space separated: the canonical spelling of a shape. Every
|
||||
* component keying on shapes must use it. */
|
||||
static std::string canon_geometry(const Geometry& g);
|
||||
|
||||
/* THE `choice` COLUMN, both directions. One spelling, in one place, because the tuner writes
|
||||
* it and the selector reads it and a disagreement between them is a cache that silently never
|
||||
* hits. `key=value` comma separated, sorted by key. */
|
||||
/* The `choice` column in both directions (`key=value` comma separated, sorted by key), shared
|
||||
* by tuner and selector so the cache always hits. */
|
||||
static std::string canon_choice(const std::vector<std::pair<std::string, int64_t>>& c);
|
||||
/* Unparseable pairs are DROPPED, not an error: an axis this reader does not understand is the
|
||||
* forward-compatibility case tunecache.h's header promises, and the caller filters by the keys
|
||||
* its kernel actually declares anyway. */
|
||||
/* Unparseable pairs are dropped, not an error (forward compatibility); the caller filters by
|
||||
* its kernel's declared keys anyway. */
|
||||
static std::vector<std::pair<std::string, int64_t>> parse_choice(std::string_view s);
|
||||
|
||||
static std::string path_for(const std::string& radiance_home, const std::string& machine);
|
||||
@@ -104,9 +95,10 @@ private:
|
||||
std::unordered_map<std::string, size_t> index_;
|
||||
};
|
||||
|
||||
/* The machine half of the key. Derived from the device layer, so it changes when the card does.
|
||||
* Lives beside the cache and not inside it, because the cache is pure file I/O and testable
|
||||
* without a device. */
|
||||
/* The machine half of the key, from the device layer (machine_key.cpp), kept apart so the cache
|
||||
* stays pure file I/O. */
|
||||
std::string rad_machine_key();
|
||||
/* The key for `n` devices, the first described by `dev` (null when there is none to describe). */
|
||||
std::string rad_machine_key_of(int n, const RadDeviceProps* dev);
|
||||
|
||||
} /* namespace rad */
|
||||
Reference in new issue
Block a user