Archived
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.
This commit is contained in:
1 parent
b4c04b6042
commit
ddcb9c69bb
696 files changed
+120770
-56596
No files matched your search
@@ -29,6 +29,7 @@
|
||||
// on `hist < kPcBT`, asserted below.
|
||||
#include "r4d.h"
|
||||
#include "r4d_args.h"
|
||||
#include "r4d_chain.h"
|
||||
#include "r4d_common.h"
|
||||
|
||||
#include <cstdint>
|
||||
@@ -54,16 +55,16 @@ __device__ __forceinline__ float pc_silu(float z) { return z / (1.0f + expf(-z))
|
||||
|
||||
/* SILU is ple_conv's activation; causal_conv1d (LFM2's short convolution) is the same window with
|
||||
* no activation, no residual and dilation one. */
|
||||
#define PLE_CONV_PARAMS \
|
||||
const uint16_t* __restrict__ x, const uint16_t* __restrict__ w, \
|
||||
uint16_t* __restrict__ cs, const int32_t* __restrict__ cu, \
|
||||
const uint16_t* __restrict__ resid, const int32_t* __restrict__ sidx, \
|
||||
const int32_t* __restrict__ hini, const int32_t* __restrict__ nacc, \
|
||||
uint16_t* __restrict__ y, const uint16_t* __restrict__ bias, uint32_t n, uint32_t wid, \
|
||||
uint32_t dil, uint32_t hist, uint32_t xld, uint32_t rld, uint32_t yld, uint32_t wld, \
|
||||
long long cs_slot, long long cs_ch, long long cs_tok, long long state_len
|
||||
template <bool SILU>
|
||||
__global__ __launch_bounds__(kPcThreads) void ple_conv_kernel(
|
||||
const uint16_t* __restrict__ x, const uint16_t* __restrict__ w,
|
||||
uint16_t* __restrict__ cs, const int32_t* __restrict__ cu,
|
||||
const uint16_t* __restrict__ resid, const int32_t* __restrict__ sidx,
|
||||
const int32_t* __restrict__ hini, const int32_t* __restrict__ nacc,
|
||||
uint16_t* __restrict__ y, const uint16_t* __restrict__ bias,
|
||||
uint32_t n, uint32_t wid, uint32_t dil, uint32_t hist,
|
||||
uint32_t xld, uint32_t rld, uint32_t yld, uint32_t wld,
|
||||
long long cs_slot, long long cs_ch, long long cs_tok, long long state_len) {
|
||||
__device__ __forceinline__ void ple_conv_body(PLE_CONV_PARAMS) {
|
||||
|
||||
const uint32_t c = blockIdx.x * kPcThreads + threadIdx.x;
|
||||
if (c >= n) return;
|
||||
@@ -151,6 +152,18 @@ __global__ __launch_bounds__(kPcThreads) void ple_conv_kernel(
|
||||
if (i < hist) dst[(size_t)i * cs_tok] = keep[i];
|
||||
}
|
||||
|
||||
/* The kernel around the body, whose blocks return where their work ends: CH `r4dchain` is the
|
||||
* chained form (r4d_chain.h), taken at decode heights. */
|
||||
template <bool SILU, class CH>
|
||||
__global__ __launch_bounds__(kPcThreads)
|
||||
void ple_conv_kernel(PLE_CONV_PARAMS) {
|
||||
if (CH::on) r4d_chain_wait();
|
||||
ple_conv_body<SILU>(x, w, cs, cu, resid, sidx, hini, nacc, y, bias, n, wid, dil, hist, xld, rld,
|
||||
yld, wld, cs_slot, cs_ch, cs_tok, state_len);
|
||||
if (CH::on) r4d_chain_done();
|
||||
}
|
||||
#undef PLE_CONV_PARAMS
|
||||
|
||||
enum { PC_X = 0, PC_W, PC_CS, PC_CU, PC_RESID, PC_CIDX, PC_HINIT, PC_NACC, PC_Y };
|
||||
/* ple_conv_bias: ple_conv's operands with `b`, the per-channel bias inside the silu (Mamba-2's
|
||||
* conv1d), before `y`. */
|
||||
@@ -216,19 +229,24 @@ int conv_launch(const RadArgs* a, RadStream s, bool silu, const RadTensor* x, co
|
||||
|
||||
const uint32_t cb = (uint32_t)((n + kPcThreads - 1) / kPcThreads);
|
||||
const uint32_t tb = (uint32_t)((T + kPcBT - 1) / kPcBT);
|
||||
const auto kernel = silu ? ple_conv_kernel<true> : ple_conv_kernel<false>;
|
||||
hipLaunchKernelGGL(kernel, dim3(cb, tb, (uint32_t)N), dim3(kPcThreads), 0, (hipStream_t)s,
|
||||
(const uint16_t*)r4d_addr(x), (const uint16_t*)r4d_addr(w),
|
||||
have_cs ? (uint16_t*)r4d_addr(cs) : nullptr,
|
||||
(const int32_t*)r4d_addr(cu),
|
||||
resid ? (const uint16_t*)r4d_addr(resid) : nullptr,
|
||||
cidx ? (const int32_t*)r4d_addr(cidx) : nullptr,
|
||||
hini ? (const int32_t*)r4d_addr(hini) : nullptr,
|
||||
nacc ? (const int32_t*)r4d_addr(nacc) : nullptr,
|
||||
(uint16_t*)r4d_addr(y), b ? (const uint16_t*)r4d_addr(b) : nullptr,
|
||||
(uint32_t)n, (uint32_t)wid, (uint32_t)dil,
|
||||
(uint32_t)hist, (uint32_t)xld, (uint32_t)rld, (uint32_t)yld, (uint32_t)wld,
|
||||
cs_slot, cs_ch, cs_tok, state_len);
|
||||
const bool chain = r4d_geti_or(a, "chain", 0) != 0 && T <= 64;
|
||||
#define R4D_PC(S_, CH_) \
|
||||
hipLaunchKernelGGL((ple_conv_kernel<S_, CH_>), dim3(cb, tb, (uint32_t)N), \
|
||||
dim3(kPcThreads), 0, (hipStream_t)s, \
|
||||
(const uint16_t*)r4d_addr(x), (const uint16_t*)r4d_addr(w), \
|
||||
have_cs ? (uint16_t*)r4d_addr(cs) : nullptr, \
|
||||
(const int32_t*)r4d_addr(cu), \
|
||||
resid ? (const uint16_t*)r4d_addr(resid) : nullptr, \
|
||||
cidx ? (const int32_t*)r4d_addr(cidx) : nullptr, \
|
||||
hini ? (const int32_t*)r4d_addr(hini) : nullptr, \
|
||||
nacc ? (const int32_t*)r4d_addr(nacc) : nullptr, \
|
||||
(uint16_t*)r4d_addr(y), b ? (const uint16_t*)r4d_addr(b) : nullptr, \
|
||||
(uint32_t)n, (uint32_t)wid, (uint32_t)dil, \
|
||||
(uint32_t)hist, (uint32_t)xld, (uint32_t)rld, (uint32_t)yld, (uint32_t)wld, \
|
||||
cs_slot, cs_ch, cs_tok, state_len)
|
||||
if (silu) { if (chain) R4D_PC(true, r4dchain); else R4D_PC(true, R4dUnchained); }
|
||||
else { if (chain) R4D_PC(false, r4dchain); else R4D_PC(false, R4dUnchained); }
|
||||
#undef R4D_PC
|
||||
return hipGetLastError() == hipSuccess ? RAD_OK : R4D_NO(RAD_E_DEVICE);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user