Archived
- 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
45 lines
1.8 KiB
C++
45 lines
1.8 KiB
C++
/* derive.h -- per-step metadata the core computes once, by name, into the arena.
|
|
*
|
|
* A plugin that needs linear-state chunk boundaries or conv-state indices declares a
|
|
* RAD_BUF_DERIVED buffer naming the derivation. The core fills it once per step, not per layer,
|
|
* and layers that share a geometry share the buffer. The step batch is the natural owner of
|
|
* "once per step"; vLLM has no such object and keys it off a module-level counter.
|
|
*
|
|
* Adding a derivation is a row in the table in derive.cpp.
|
|
*/
|
|
#pragma once
|
|
#include "batch.h"
|
|
|
|
namespace rad {
|
|
|
|
/* Everything a derivation may read. All host memory, already staged for this step, so no
|
|
* derivation adds a device sync to the step path. */
|
|
struct DeriveInput {
|
|
const StepPlan* plan = nullptr;
|
|
const int32_t* cu_seqlens = nullptr; /* [n_seq+1] */
|
|
const int32_t* positions = nullptr; /* [n_tok] absolute position per token */
|
|
const int32_t* conv_slot = nullptr; /* [n_seq] the conv group's state slot, -1 if none */
|
|
int64_t n_tok = 0;
|
|
int64_t n_seq = 0;
|
|
int64_t state_chunk = 1; /* the resolved linear-state chunk length */
|
|
int32_t conv_window = 1; /* conv_width - 1 + max_spec */
|
|
};
|
|
|
|
/* Writes at most `cap` int32 elements to `out` and reports how many. Returns RAD_OK or negative;
|
|
* negative aborts the step rather than let an op read a half-filled buffer. */
|
|
typedef int (*DeriveFn)(const DeriveInput& in, int32_t* out, int64_t cap, int64_t* n_out);
|
|
|
|
struct DeriveRow {
|
|
const char* name;
|
|
DeriveFn fn;
|
|
const char* doc;
|
|
};
|
|
|
|
/* -1 for an unknown name. Reported at declare with the known list, like a misspelled op
|
|
* (spec §2.3). */
|
|
int derive_index(const char* name);
|
|
const DeriveRow* derive_row(int index);
|
|
int derive_count();
|
|
|
|
} /* namespace rad */
|