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
+21
-27
@@ -1,9 +1,5 @@
|
||||
/* r4d_gdn_args.h -- what the gated-delta-net kernels share when they read their arguments.
|
||||
*
|
||||
* The GDN family is seven kernels across six translation units, and they share two things: a
|
||||
* dtype check that has to be by name, and `num_seqs` read off the cu_seqlens tensor. Both belong
|
||||
* to the family rather than to any one kernel, so they live here -- a header beside them, not an
|
||||
* adapter directory between them and the core. See libr4d/r4d_args.h.
|
||||
/* r4d_gdn_args.h -- argument helpers shared by the gated-delta-net kernels (and the DFlash ops):
|
||||
* dtype checks, num_seqs from cu_seqlens, the compiled-geometry check and a row-pitch reader.
|
||||
*/
|
||||
#ifndef R4D_GDN_ARGS_H
|
||||
#define R4D_GDN_ARGS_H
|
||||
@@ -12,29 +8,28 @@
|
||||
#include "r4d_args.h"
|
||||
|
||||
|
||||
/* EVERY POINTER libr4d TAKES AS `const void*` HAS ONE ELEMENT TYPE, AND THE CAST IS INSIDE THE
|
||||
* KERNEL. `r4d_gdn_conv_prep_w4_h128_bf16` casts `wgt` to `const unsigned short*` and `A_log` to
|
||||
* `const float*`; nothing in the signature says so.
|
||||
*
|
||||
* The hazard is concrete, not theoretical. A plugin that declares `ssm_conv1d.weight` f32 or the
|
||||
* `gdn_kkt` buffer f32 hands libr4d planes it reads as bf16: the convolution takes two bf16
|
||||
* elements out of every float, and the chunk scan's inverse is written as bf16 into a plane sized
|
||||
* and read as f32. Neither shows up on the host path, because libref reads every operand through
|
||||
* its OWN dtype and is therefore correct with either -- so the two implementations disagree and
|
||||
* only the device one is wrong.
|
||||
*
|
||||
* A shim exists to reject what the entry point would reject if it could see the argument (spec
|
||||
* §2.1, and the file header above says the same about pitches). A dtype the kernel silently
|
||||
* reinterprets is the strongest case of that there is, so it is checked here, by name. */
|
||||
/* Every `const void*` libr4d takes has one element type, cast inside the kernel (e.g.
|
||||
* r4d_gdn_conv_prep_w4_h128_bf16 reads `wgt` as bf16 and `A_log` as f32); the signature does not
|
||||
* say so. A plugin declaring `ssm_conv1d.weight` or the `gdn_kkt` buffer as f32 would be read as
|
||||
* bf16 on the device, while libref (which honours each operand's dtype) stays correct, so the bug
|
||||
* would show only on the device path. The shim therefore checks dtypes by name (spec §2.1). */
|
||||
static inline int r4d_dt(const RadTensor* t, uint32_t want) {
|
||||
if (!t) return RAD_OK; /* an absent optional operand has no dtype */
|
||||
return t->dtype == want ? RAD_OK : RAD_E_DTYPE;
|
||||
}
|
||||
#define R4D_DT(t, want) do { const int _d = r4d_dt((t), (want)); if (_d != RAD_OK) return _d; } while (0)
|
||||
#define R4D_DT(t, want) \
|
||||
do { const int _d = r4d_dt((t), (want)); if (_d != RAD_OK) return R4D_NO(_d); } while (0)
|
||||
|
||||
/* num_seqs from the cu_seqlens tensor: it is [N+1] and nothing else in the argument list carries
|
||||
* N. Refusing a cu of rank != 1 here is what stops an off-by-one N reaching a kernel that indexes
|
||||
* cu[N] unconditionally. */
|
||||
/* A raw r4d.h entry point's result as a RAD status. Those return 0, a negative code for a
|
||||
* geometry they were not compiled for, or the positive hipError_t of a failed launch. */
|
||||
static inline int r4d_raw_status(int rc, const char* file, int line) {
|
||||
if (rc == 0) return RAD_OK;
|
||||
return r4d_refused(rc < 0 ? RAD_E_SHAPE : RAD_E_DEVICE, file, line);
|
||||
}
|
||||
#define R4D_RAW(rc) r4d_raw_status((rc), __FILE__, __LINE__)
|
||||
|
||||
/* num_seqs from the [N+1] cu_seqlens tensor, the only operand that carries N. Requiring rank 1
|
||||
* keeps an off-by-one N from reaching kernels that index cu[N] unconditionally. */
|
||||
static inline int seqs_of(const RadTensor* cu, int* out) {
|
||||
if (!cu || cu->rank != 1 || cu->shape[0] < 2) return R4D_NO(RAD_E_SHAPE);
|
||||
if (!r4d_contig(cu)) return R4D_NO(RAD_E_STRIDE);
|
||||
@@ -51,9 +46,8 @@ static inline int gdn_dims_ok(void) {
|
||||
}
|
||||
|
||||
|
||||
/* Elements between consecutive `width`-wide rows, for an operand that spells them either way: a
|
||||
* [.., heads, width] tensor steps a row with the stride of the axis above the last, and a flattened
|
||||
* [tokens, heads*width] one steps it with `width`. Negative when neither holds densely. */
|
||||
/* Elements between consecutive `width`-wide rows: the second-to-last stride of a [.., heads, width]
|
||||
* tensor, or `width` for a dense flattened [tokens, heads*width] one. Negative otherwise. */
|
||||
static inline long long gn_row_pitch(const RadTensor* t, long long width) {
|
||||
if (!t || t->rank < 1) return -1;
|
||||
if (t->shape[t->rank - 1] == width) {
|
||||
|
||||
Reference in new issue
Block a user