Archived
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:
1 parent
6a2ee986d6
commit
89cee7ce41
107 files changed
+6849
-1091
No files matched your search
@@ -1907,6 +1907,19 @@ static const RadOperandSpec oArgmax[] = {
|
||||
{ "params", RAD_OPD_IN, 0 },
|
||||
{ "token", RAD_OPD_OUT, 0 },
|
||||
};
|
||||
/* `stats` is [M, 2 + 2k] f32: max, sum of exp(l - max), then k (id, logit) pairs. `k` is the
|
||||
* deployment's width, `vocab_off` sample_topk's. */
|
||||
static const RadParamSpec pLogprobs[] = {
|
||||
{ "M", RAD_P_INT, RAD_REQUIRED },
|
||||
{ "n_vocab", RAD_P_INT, RAD_REQUIRED },
|
||||
{ "k", RAD_P_INT, RAD_REQUIRED },
|
||||
{ "vocab_off", RAD_P_INT, RAD_OPTIONAL },
|
||||
};
|
||||
static const RadOperandSpec oLogprobs[] = {
|
||||
{ "logits", RAD_OPD_IN, 0 },
|
||||
{ "params", RAD_OPD_IN, 0 },
|
||||
{ "stats", RAD_OPD_OUT, 0 },
|
||||
};
|
||||
static const RadOperandSpec oNarrow[] = {
|
||||
{ "cand_idx", RAD_OPD_INOUT, 0 },
|
||||
{ "cand_val", RAD_OPD_INOUT, 0 },
|
||||
@@ -2068,6 +2081,9 @@ static const RadOpSchema kSchemas[] = {
|
||||
"the exact top-k candidate set, descending, ties to the lower token id. The width is "
|
||||
"the buffer's; a row's own top_k may be narrower and leaves holes."),
|
||||
SCHEMA("sample_argmax", pMVocab, oArgmax, "greedy, ties to the lower token id."),
|
||||
SCHEMA("sample_logprobs", pLogprobs, oLogprobs,
|
||||
"for a row with RAD_SP_LOGPROBS: the raw logits' max, sum of exp(l - max) and k largest "
|
||||
"(id, logit) pairs, descending, ties to the lower id. Other rows are not written."),
|
||||
SCHEMA("sample_topp", pMCand, oNarrow,
|
||||
"nucleus: keep the shortest prefix whose cumulative probability reaches top_p, always "
|
||||
"at least one. The candidates are assumed descending, as sample_topk leaves them."),
|
||||
@@ -2434,6 +2450,25 @@ static const RadConstraint cAttnDecodeH256G8Bf16[] = {
|
||||
C_EQ("window", 0), C_EQ("head_dim", 256), C_EQ("gqa", 8), C_EQ("block_size", 16),
|
||||
C_GE("causal", 0), C_LE("q_len", 8), C_IN("q_dtype", "bf16"), C_IN("kv_dtype", "bf16"),
|
||||
};
|
||||
/* FOUR QUERIES PER KV HEAD, head_dim 256 (r4d_attn_paged_h256_gqa4.hip) -- Qwen3.5-0.8B, 8 query
|
||||
* heads over 2. `q_len <= 16` is the same `q_len * gqa <= 64` bound, so every legal speculation
|
||||
* depth is a decode launch at this ratio. */
|
||||
static const RadConstraint cAttnPrefillH256G4Fp8[] = {
|
||||
C_EQ("window", 0), C_EQ("head_dim", 256), C_EQ("gqa", 4), C_EQ("block_size", 16),
|
||||
C_EQ("causal", 1), C_IN("q_dtype", "bf16"), C_IN("kv_dtype", "fp8_e4m3"),
|
||||
};
|
||||
static const RadConstraint cAttnPrefillH256G4Bf16[] = {
|
||||
C_EQ("window", 0), C_EQ("head_dim", 256), C_EQ("gqa", 4), C_EQ("block_size", 16),
|
||||
C_EQ("causal", 1), C_IN("q_dtype", "bf16"), C_IN("kv_dtype", "bf16"),
|
||||
};
|
||||
static const RadConstraint cAttnDecodeH256G4Fp8[] = {
|
||||
C_EQ("window", 0), C_EQ("head_dim", 256), C_EQ("gqa", 4), C_EQ("block_size", 16),
|
||||
C_GE("causal", 0), C_LE("q_len", 16), C_IN("q_dtype", "bf16"), C_IN("kv_dtype", "fp8_e4m3"),
|
||||
};
|
||||
static const RadConstraint cAttnDecodeH256G4Bf16[] = {
|
||||
C_EQ("window", 0), C_EQ("head_dim", 256), C_EQ("gqa", 4), C_EQ("block_size", 16),
|
||||
C_GE("causal", 0), C_LE("q_len", 16), C_IN("q_dtype", "bf16"), C_IN("kv_dtype", "bf16"),
|
||||
};
|
||||
/* TWELVE QUERIES PER KV HEAD, head_dim 256 (r4d_attn_paged_h256_gqa12.hip) -- Qwen3.8-Flash-Next's
|
||||
* QSA layers, 24 query heads over 2. `q_len <= 5` is the same `q_len * gqa <= 64` bound the two
|
||||
* ratios above state, and it is TIGHTER than the legal speculation depths: a verify of depth 7 is
|
||||
@@ -3378,6 +3413,7 @@ static const RadConstraint cGridEmbed[] = { C_GE("n", 1), C_GE("side", 1), C_IN(
|
||||
static const RadConstraint cGemmBias[] = { C_GE("M", 1), C_DIV("K", 8), C_IN("dtype", "bf16") };
|
||||
static const RadConstraint cSampleVoc[] = { C_GE("n_vocab", 1) };
|
||||
static const RadConstraint cSampleCand[] = { C_GE("n_cand", 1), C_LE("n_cand", 4096) };
|
||||
static const RadConstraint cSampleLogprobs[] = { C_GE("n_vocab", 1), C_GE("k", 1), C_LE("k", 64) };
|
||||
/* The activation width the column loop vectorises over; M is unbounded -- the kernel chunks rows. */
|
||||
static const RadConstraint cLogitsGemm[] = { C_DIV("n_embd", 8), C_IN("dtype", "bf16") };
|
||||
/* The fp8 head. n_embd on the 128 block the scales are taken over, and NO CAP ON M -- the row
|
||||
@@ -3849,6 +3885,17 @@ static const RadKernelInfo kKernels[] = {
|
||||
nullptr, nullptr, r4d_rad_sample_argmax, nullptr, nullptr, nullptr,
|
||||
r4d_shape_sample_argmax },
|
||||
|
||||
{ "sample_logprobs_f32", "sample_logprobs", "sample",
|
||||
"the raw distribution's summary for a logprobs row: max, sum of exp(l - max), the k largest",
|
||||
"any vocabulary; k <= 64, the LDS the sort runs in. sample_topk's radix select at the op's k, so "
|
||||
"the set and its tie rule are the top-k's; the maximum is its first entry and the sum one more "
|
||||
"pass. A row without RAD_SP_LOGPROBS leaves before reading anything",
|
||||
"f32 logits, f32 stats [M, 2 + 2k] with the ids as floats",
|
||||
RAD_DOMAIN_DEVICE, R4D_PRIO_ONLY,
|
||||
ROW(cSampleLogprobs), NOTUNE,
|
||||
nullptr, nullptr, r4d_rad_sample_logprobs, nullptr, nullptr, nullptr,
|
||||
r4d_shape_sample_logprobs },
|
||||
|
||||
{ "sample_topp_f32", "sample_topp", "sample",
|
||||
"nucleus narrowing in place",
|
||||
"n_cand <= 4096; the prefix sum is SEQUENTIAL in f32 in candidate order, because a parallel "
|
||||
@@ -4012,6 +4059,44 @@ static const RadKernelInfo kKernels[] = {
|
||||
nullptr, nullptr,
|
||||
r4d_shape_attn_paged },
|
||||
|
||||
{ "attn_prefill_h256_gqa4_fp8kv", "attn_paged", "attn",
|
||||
"paged causal attention, query-tiled (prefill / chunked prefill)",
|
||||
"head_dim 256, 4 queries per kv head, paged block 16, varlen",
|
||||
"bf16 query, fp8-e4m3 kv cache with per-(seq,head) descales, bf16 out",
|
||||
RAD_DOMAIN_DEVICE, R4D_PRIO_ATTN_PREFILL,
|
||||
ROW(cAttnPrefillH256G4Fp8), NOTUNE,
|
||||
nullptr, nullptr, r4d_rad_attn_prefill_h256_gqa4_fp8, nullptr, nullptr, nullptr,
|
||||
r4d_shape_attn_paged },
|
||||
|
||||
{ "attn_prefill_h256_gqa4_bf16kv", "attn_paged", "attn",
|
||||
"paged causal attention, query-tiled (prefill / chunked prefill)",
|
||||
"head_dim 256, 4 queries per kv head, paged block 16, varlen",
|
||||
"bf16 query, bf16 kv cache, bf16 out",
|
||||
RAD_DOMAIN_DEVICE, R4D_PRIO_ATTN_PREFILL,
|
||||
ROW(cAttnPrefillH256G4Bf16), NOTUNE,
|
||||
nullptr, nullptr, r4d_rad_attn_prefill_h256_gqa4_bf16, nullptr, nullptr, nullptr,
|
||||
r4d_shape_attn_paged },
|
||||
|
||||
{ "attn_decode_h256_gqa4_fp8kv", "attn_paged", "attn",
|
||||
"paged attention, causal or not, split-KV (decode / speculative verify / draft block)",
|
||||
"head_dim 256, 4 queries per kv head, paged block 16, q_len*gqa <= 64, no window",
|
||||
"bf16 query, fp8-e4m3 kv cache with per-(seq,head) descales, bf16 out, f16 partials",
|
||||
RAD_DOMAIN_DEVICE, R4D_PRIO_ATTN_DECODE,
|
||||
ROW(cAttnDecodeH256G4Fp8), ROW(tAttnSplit), nullptr,
|
||||
nullptr, nullptr, r4d_rad_attn_decode_h256_gqa4_fp8, r4d_rad_attn_decode_h256_gqa4_scratch,
|
||||
nullptr, nullptr,
|
||||
r4d_shape_attn_paged },
|
||||
|
||||
{ "attn_decode_h256_gqa4_bf16kv", "attn_paged", "attn",
|
||||
"paged attention, causal or not, split-KV (decode / speculative verify / draft block)",
|
||||
"head_dim 256, 4 queries per kv head, paged block 16, q_len*gqa <= 64, no window",
|
||||
"bf16 query, bf16 kv cache, bf16 out, f16 partials",
|
||||
RAD_DOMAIN_DEVICE, R4D_PRIO_ATTN_DECODE,
|
||||
ROW(cAttnDecodeH256G4Bf16), ROW(tAttnSplit), nullptr,
|
||||
nullptr, nullptr, r4d_rad_attn_decode_h256_gqa4_bf16, r4d_rad_attn_decode_h256_gqa4_scratch,
|
||||
nullptr, nullptr,
|
||||
r4d_shape_attn_paged },
|
||||
|
||||
{ "attn_prefill_h256_gqa12_fp8kv", "attn_paged", "attn",
|
||||
"paged causal attention, query-tiled (prefill / chunked prefill)",
|
||||
"head_dim 256, 12 queries per kv head, paged block 4, varlen",
|
||||
|
||||
Reference in new issue
Block a user