Archived
b8bca7885a5a118bfa65a62dde74e0a6e2d4e42e
12
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
946a6f9e2b |
aql: the prefetch stream takes the half-lap system acquire too
The expert-prefetch stream (rad_xp_stream_create, agent_only) downgraded every system-scope acquire to agent scope because it reads no host-written data. Its kernel arguments are host-written into its own ring, though: after a wrap, an agent-scope acquire leaves the slot's old line in the L2 and the launch runs with the previous lap's arguments. Keep the exemption for host writes and epochs; take the system acquire on the ring's half lap (one in 2048 prefetch launches). New device test: launches on a prefetch stream across three ring laps read their own arguments -- 8709 of 12805 stale without the fix, 0 with it. Fixes #491 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
01f08152dc |
aql: no packet-header acquire on chained launches whose kernels acquire for themselves
A chained kernel that has lost its barrier bit is launched ahead of the kernels it depends on and reads nothing until its prologue wait has passed, where it acquires itself (and, since the previous change, empties the scalar cache). The acquire in its packet header runs when the packet processor launches the kernel, before the launches in front have written, so it guards nothing the kernel reads and only holds the packet processor: on an R9700, 2.1 us per launch with the agent-scope acquire against 1.2 us without. rad_kernel_chain may now answer 2 (libr4d's rows do): the chained forms' acquire covers everything they read. The loader records it (KernelRow::chain_fenced); the engine asks rad_dev_chain_infer(2) when chaining pays and every row that can chain, from every loaded library, says 2 (one row answering 1 keeps the acquire on all chained packets). The backend then issues a chained dispatch without its barrier bit with no header acquire, live and in played passes, unless the ring, the host epoch or a copy asks for one; releases, barrier packets, plain kernels and the prefetch stream are untouched, and a card with its arguments in VRAM and no HDP flush register keeps the acquire. RADIANCE_AQL_CHAIN_FENCE=1 puts it back on every chained launch. Qwen3.8-Flash-Next IQR-V4, TP2, MTP chain 3 with coupling, ABBA over 2 pairs: +0.75% tok/s [0.73, 0.78], all 156 texts identical. The three device tests added before now also run with the packets unacquired, and a shipped-plugins test requires libr4d's chained rows to answer 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
8f2e511fcc |
aql: flush the host data path before every doorbell; empty the scalar cache behind a chained wait
Two latent bugs that the packet processor's acquire (about 0.9 us a launch) has been hiding by timing. 1. Kernel arguments and the chain record are written into VRAM through the BAR, and the card's host data path keeps such a write until it is flushed. Nothing ordered that against the doorbell (the sfence only orders the CPU's own buffers). A kernel the card starts a microsecond or two after its doorbell reads the slot as the launch one lap of the ring before left it: old arguments, or no chain record, in which case the launch counts nothing and the chained launch behind it waits for good. The backend now stores to the card's HDP flush register (HSA_AMD_AGENT_INFO_HDP_FLUSH) in front of every doorbell, in publish() and in a played pass's ring(). Without a register (the argument ring in host memory, or a driver that gives none) nothing changes, and a warning says so at startup. 2. rad_chain_wait()/r4d_chain_wait() end in an agent-scope acquire fence, which invalidates the vector caches. A load whose address every lane shares is a scalar load, served from the scalar data cache, and nothing but the packet processor's acquire (which runs when the kernel is launched, before the launch in front has written) empties that. A chained kernel can therefore read a stale scale, count or activation from the arena address an earlier launch read. The waits now issue s_dcache_inv behind the fence (r4d_chain_acquire in libr4d, chain_kernel.h in the core's blit kernels). Evidence on an R9700 with the packet acquire left as it is: a probe of 1024-block readers behind a chained wait saw a stale shared value in 1 launch of 1800 without the s_dcache_inv and in none with it; card-side copies issued one by one with 50 us between them stalled the queue in its first lap, four runs in four, and six runs in nine of 300000 back to back ended with a unit moved by another launch's arguments, when the packets went without their acquire and without the flush, and in none with the flush. New device tests: a chained reader sees a shared value the launch in front wrote, a chained launch reads its own arguments after the ring has lapped, and a copy issued after a pause finds the record written for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
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. |
||
|
|
9ed3ef7a7b |
radiance 1.15.0
New models and formats: - IQR for Qwen3.8-27B: weights on the int8 grid under GPTQ, a trellis down each GPTQ column (IQR-V2), and IQR-V3, a computed trellis code under one scale a row, kept at its codes' width in VRAM and decoded in the GEMM; 15 IQR-V3 recipes from ~2 to ~7 bits a weight (data/recipes/q38-27b-*-v3.recipe, docs/IQR.md) - libhalo: a kernel library for Strix Halo (gfx1151), preferred there over libr3d - Nemotron 3.5 Embed 1B and 8B (nemotron35_embed): text and image embeddings through a Pixtral tower, on the card and on the CPU - Nemotron 3.5 Rerank 8B - /v1/systemone: Cloudflare's clef and clef-flash, Convai Innovations' Laya and Mica beside LiquidAI d1; scored steps read the candidates' logits from the head table with no lm_head pass - LFM2's 8-bit trunk: block-fp8 or int8 linears with the fused producers, and the d1-3B recipe - DeepSeek-V4.1's reply format with DSML tool calls and typed argument tags Weights on the drive: - The file tier reads only the experts the pass routes rows to; the draft head's weights stay in the host pool - A hot VRAM cache for routed experts read off the drive, reads deposited straight into free host pool slots, and copyless evictions; the file tier's counters are now ssd_* - GLM-5 Next shards its routed experts by expert, not by width, so they can live on the drive - The stall watch counts drive reads as progress, and the DMA lane's room check reads the lane's own completion fence Quantisation tooling: - --calib-corpus, --calib-dir and --calib-layers record each linear's input Hessian; beside --kld-record the reference's own run records them - --kld-top N records a sparse KL reference (the N most likely tokens and the tail's mass) - GPTQ in a third of the time with the same codes, trellis GPTQ on the card, vector codebooks with coordinate descent, and rad-convert --reuse repeated, each container supplying what the earlier ones lack Speculation: - Prompt lookup alone (--spec-ngram K, --spec-ngram-min/-max): each sequence keeps an index of its n-grams, and a proposal is verified only when its measured step cost says it pays; --draft-window adaptive follows it Speed: - IQR decode: the narrow tile splits K for four times the int8 tile's waves and folds each 128-K block once; at 8 tokens down and the output projections run in 0.61-0.82x and 0.70-0.92x FP8's time (2-6 bits); IQ6R-S-V3 with its DFlash2 drafter steps in 26.3 ms at TP2, against 29.4 ms before and FP8's 27.3 - Qwen MXFP4 feed-forward: the gated fold up to 16 rows, not 8 - libr4d: the gated prefill fold, the short-prompt split row, and the rows forms of rmsnorm and rope; KLATE again for the head-256 gqa6 paged prefill; gram_accum on the matrix cores Features: - /health, /v1/health and /ping answer 503 with "status": "stuck" once the device has advanced nothing for a minute or a queue has faulted, so a supervisor can restart a wedged server (#356) - --image-gen-max-pixels and --image-gen-max-refs size an image generator's buffers (#344) - The startup report lists only the options not at their default, with a count; -v lists all (#250) - --preempt-wait-ms bounds how long a preempted prefill waits for its whole-recompute room - --placement layer_offload spills dense layers so one --max-model-len sequence fits - Startup refuses amdgpu with CWSR off and says how to fix it; --proceed-with-incompatible-configuration starts anyway under an UNSUPPORTED banner Fixes: - The n-gram read-ahead hands each row to the reader once and reads only as far ahead as the row cache holds, and pauses while decode reads: about one drive read a row instead of two (#355) - A file-tier window reads each of its runs once, not once a run per run - The decode split law's verify floor is bounded by the batch's workgroups: max_seqs 256 no longer declares 64x the scratch (#342) - A prefetch DMA list's mark stays out of the signal pool until the engine has read it, and a prefill stage copies only the blocks its own tables name (#343) - The split-KV row sum is read with fetch-inactive (#328) - LFM2 on the host backend: libref and libavx serve the row-form ops it declares (#348) - The preempted-prefill gate skips a KV group that holds no blocks (#352) - Every request entry point bounded, gated and sanitised (JSON depth, invalid UTF-8, control bytes in the log, the dashboard's CSP, cross-origin browsers on the loopback-only routes); a prompt id outside the vocabulary refused at admission; --api-key "" refused at startup - The telemetry the HTTP thread reads is atomic - An RMS norm row no longer depends on how many rows its launch carries; prefill attention's rescale is decided by live rows only - A --kld-record prefill chunk that finishes no sequence gets its logits on a tied-head model - A kernel's lazily made counter block is zeroed outside the lock other ranks take (a TP2 first-step hang) Changes: Plugin ABI 32. Every plugin exports a layout fingerprint of the ABI structs and the loader refuses a plugin without it or with another (#302), so out-of-tree plugins must be rebuilt. Appended: RadBuildCtx calib_* and gen_max_*, RadArchProbe gen_max_*, RadBatch score_only and plugin_words, RadDeviceProps::unified, RadChatFormat arg_json_value_prefix. |
||
|
|
9eaf10da6e |
radiance 1.11.0
New models: - GLM-5.3-Flash reads pictures: its vision tower and processor (--image-tokens sets the budget), with decode kernels for a few rows and the DSA indexer split over the ranks - Sage-A1.5 (fp8 and MXFP4) with its vision tower and a DFlash2 drafter - Unlimited-OCR (bf16) - Gemma 4 31B with z-lab's DFlash and RedHatAI's DFlash2 drafters; at four cards its all-reduces are fused with the junctions, overlapped with the compute and sent compressed - Ornith-1.5-35B-A3B w4a8 compose files Speed: - Block drafters (DFlash, DFlash2) accept their drafts on the card, and the next step is issued ahead - The four-rank all-reduce is faster for every --tp 4 model - qwen35_w8a8: the norms and SiLU write the int8 linears' operands directly - --attn-prefill-fp8 off|qk|pv|both: fp8 QK and PV legs for the h256 prefill attention (about +20% prefill on a 221K-token prompt for the 27B MXFP4 at TP2); lossy, off by default Features: - Control vectors: --control-vector off|on|disabled (disabled by default), a per-request switch, and the published Qwen3.8-Flash-Next refusal-direction vector (its license is in NOTICE) - Krea 2: the `rebalance` request field, as ComfyUI's ConditioningKrea2Rebalance - Cards with a small PCI BAR run, with kernel arguments kept in host memory - Dashboard: live acceptance figures; statsdump rotates its file at a size cap - KV caches every rank holds whole (GLM-5.3's latent and index caches) take one host-tier slot Fixes: - Long conversations taking turns no longer fall back to an early snapshot: a host-tier restore makes room as memory pressure does and waits a step for the previous turn's release (two conversations of 142K and 147K tokens sent back to back: 31.3 s per turn before, 2.8 s now) - Kernels before Linux 6.16 (amdgpu below 3.64) no longer hang at startup: virtual memory management is turned off there, with a warning - Gemma 4 dense scales its token embeddings as Hugging Face does (bf16), which changes its output - The four-rank all-reduce fences prefill-sized messages, for a rare divergence after a fresh start - GLM-5.3: every refusal names the setting and the reason; its template keeps string content - Several pictures in one request no longer refuse processors that take one image at a time Changes: Plugin ABI 26: out-of-tree plugins must be rebuilt. The environment switches the PRs added are fixed rules or flags now (R4D_ATTN_FP8 is --attn-prefill-fp8). |
||
|
|
1e968f6e1d |
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 |
||
|
|
dc339b4cd2 |
radiance 1.4.0
- Qwen3.8-Flash-Next on one card: the heat engine moves 64 experts a step (was 8), its copies and the prefill's expert staging run on the card's DMA engines instead of as copy kernels, and at decode the next layer's likeliest experts are copied onto the card ahead of its GEMMs. Against 1.3.0 at --tp 1: prefill +17-20% from 8K tokens up, throughput under load +16-20% - deploy/compose/flashnext-tp1.yaml: Qwen3.8-Flash-Next on one card and 64 GB of host RAM (4096-token prefill steps, 4 sequences, a 301K-token cache) - #61: --busy-prefill-chunk (default auto): a long prefill leaves the rest of the step to the requests decoding beside it and to new arrivals, instead of taking all of it (baKon) - LiquidAI's LFM2 and LFM2-VL, and d1's /v1/systemone (after zivius's PR #50) - a startup report: every option with its value and where it came from, the hardware, and what on it costs speed with the fix; /diagnostics serves it (behind the API key; without one, only to the same machine) - #69: a GPU memory fault names the buffer and kernel argument behind it and ends the server at once (exit status 70), instead of hanging or writing a core of tens of gigabytes - #64: a card without Resizable BAR is refused at startup, naming what to turn on, instead of crashing at the first launch - the image is built with ROCm 10.1 (the host's amdgpu driver must support it), with ROCm's libLLVM rebuilt so the same source compiles to the same kernels every time; a source build takes ROCm 10.1 or 7.2 - #71: the image ships curl, jq and a CA bundle, so --model <HF repo id> works in the container, and hfget.sh runs under its busybox (baKon) - --profile-ops shows how long each op's lane sat idle before it; cardclock.py skips an integrated GPU instead of stopping |
||
|
|
7001841e45 |
radiance 1.1.1
- Pinned host memory works again on kernel drivers without the SVM API (e.g. a KVM guest with the cards passed through): the host pool is one allocation there instead of 1 GiB pieces that landed apart on the cards (#28). Regression since 1.0.9. - A host-pool refusal no longer advises shrinking the pool when it fits under the pin cap and the available RAM. |
||
|
|
20d6c2119f |
radiance 1.0.9
- Pinned host memory is locked in pieces of at most 1 GiB (issue 13): an Intel VT-d host in scalable mode that refuses any single pin above about 2.5 GiB now takes the host pool with IOMMU translation, and peer-to-peer access, left on. - Four-rank all-reduce (PR 11 by keptn42): the tiered-int8 wire serves in-place calls, so --tp 4 --tp-wire wht6 runs. At four and eight ranks the exact all-reduce is one-shot up to 524288 elements and two-shot above, chosen by the selector, so the band report names the kernel that runs. The docs and the startup warning describe the four-rank lossy wire; eight ranks have none. - A VRAM allocation the card cannot take is refused, saying what the card has left and which processes hold memory on it. ROCm 7.2's runtime crashes on such an allocation once a queue has been destroyed, which every startup does. - rad-convert --changed FILE: with --reuse, converts only the weights that read a changed checkpoint tensor and copies the rest. |
||
|
|
6df26315b9 |
radiance 1.0.6
- A text prompt to /v1/completions reads the model's control tokens as tokens, as vLLM and llama.cpp do. A client that renders its own chat template can send "<|im_start|>user ..." and the model sees the turn markers; they used to reach it as plain text. /tokenize and /v1/embeddings read a text prompt the same way, and a prompt that already opens with BOS gets no second one. - The VRAM budget counts the engine's own hardware queues, which the driver backs with about 33 MiB of VRAM each, and the KV tiers' copy staging. Both used to come out of --gpu-headroom-mib: Qwen3.8-Flash-Next ran with 9 MiB free under load against the 96 MiB it asked to keep, the room a kernel's first launch allocates from. The startup receipt has a "hardware queues" line. - Running the whole model on the CPU (RADIANCE_HOST_DOMAIN=1 with no GPU visible) no longer repeats words or answers differently at temperature 0. A decode step could read its input token before the copy that delivers it had landed. - The README says to clone the repository before installing. |
||
|
|
ae74a8aebf | radiance 1.0.0 |