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
+47
-4
@@ -1,10 +1,16 @@
|
||||
#ifndef RAD_YARN_H
|
||||
#define RAD_YARN_H
|
||||
|
||||
/* Static YaRN coefficients. The architecture resolves the correction bounds using
|
||||
* the ORIGINAL training length, never the deployment/table length. Kernels share
|
||||
* the resolved coefficients so direct and table-backed RoPE cannot disagree. */
|
||||
/* Static YaRN coefficients. The architecture resolves the correction bounds from the original
|
||||
* training length, never the deployment or table length. Kernels share the resolved coefficients
|
||||
* so direct and table-backed RoPE cannot disagree.
|
||||
*
|
||||
* C++ gets RadYarn with a member frequency() (callable from HIP device code) and default member
|
||||
* values; C gets the same four-float struct and rad_yarn_frequency(). The two definitions must
|
||||
* compute the same frequencies; tests/abi_layout_test.cpp compares them. */
|
||||
#include "rad_plugin.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <cmath>
|
||||
|
||||
#if defined(__HIPCC__)
|
||||
@@ -14,7 +20,7 @@
|
||||
#endif
|
||||
|
||||
struct RadYarn {
|
||||
float factor = 0.0f; /* zero: keep the legacy arithmetic exactly */
|
||||
float factor = 0.0f; /* zero: YaRN off, frequency() returns `inv` unchanged */
|
||||
float low = 0.0f;
|
||||
float high = 0.0f;
|
||||
float magnitude = 1.0f;
|
||||
@@ -46,4 +52,41 @@ inline bool rad_yarn_valid(const RadYarn& y) {
|
||||
}
|
||||
|
||||
#undef RAD_YARN_HD
|
||||
|
||||
#else /* C */
|
||||
#include <math.h>
|
||||
|
||||
typedef struct RadYarn {
|
||||
float factor; /* zero: YaRN off, rad_yarn_frequency() returns `inv` unchanged */
|
||||
float low;
|
||||
float high;
|
||||
float magnitude; /* 1 when off */
|
||||
} RadYarn;
|
||||
|
||||
static inline float rad_yarn_frequency(const RadYarn* y, float inv, int i) {
|
||||
float width, ramp, mask;
|
||||
if (y->factor == 0.0f) return inv;
|
||||
width = y->high == y->low ? 0.001f : y->high - y->low;
|
||||
ramp = fminf(1.0f, fmaxf(0.0f, ((float)i - y->low) / width));
|
||||
mask = 1.0f - ramp;
|
||||
return (inv / y->factor) * (1.0f - mask) + inv * mask;
|
||||
}
|
||||
|
||||
static inline RadYarn rad_yarn_args(const RadArgs* a) {
|
||||
RadYarn y = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||
y.factor = (float)rad_args_getf_or(a, "yarn_factor", 0.0);
|
||||
if (y.factor == 0.0f) return y;
|
||||
y.low = (float)rad_args_getf_or(a, "yarn_low", 0.0);
|
||||
y.high = (float)rad_args_getf_or(a, "yarn_high", 0.0);
|
||||
y.magnitude = (float)rad_args_getf_or(a, "yarn_magnitude", 1.0);
|
||||
return y;
|
||||
}
|
||||
|
||||
static inline int rad_yarn_valid(const RadYarn* y) {
|
||||
return isfinite(y->factor) && (y->factor == 0.0f ||
|
||||
(y->factor >= 1.0f && isfinite(y->low) && isfinite(y->high) && y->high >= y->low &&
|
||||
isfinite(y->magnitude) && y->magnitude > 0.0f));
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user