This repository has been archived on 2026-11-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
radiance-sycl/libr4d/isa/launchreg_lib.hip
T
Deadcode 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
2026-10-16 18:25:18 +02:00

57 lines
1.9 KiB
Plaintext

// Library half of the registered-kernel test, built at -DNK=2 and -DNK=512 and dlopen'd, which
// matches libr4d's shape: one shared object holding every kernel instantiation, entered through a
// function pointer. Both builds launch the same kernel k<0> with the same arguments; only the
// number of other instantiations in the module differs.
#include <hip/hip_runtime.h>
template <int I>
__global__ void k(float* p) { if (threadIdx.x == 0) p[blockIdx.x] = (float)I; }
/* Keeps the instantiations alive; without a use the compiler drops every unlaunched k<I>. */
static const void* g_tab[NK];
template <int I>
struct Reg {
static void go() { g_tab[I] = (const void*)k<I>; Reg<I - 1>::go(); }
};
template <>
struct Reg<0> {
static void go() { g_tab[0] = (const void*)k<0>; }
};
/* One thunk per instantiation. A decode step issues ~45 different kernels, each with its
* own shim, argument buffer and host stub, so code, stub and args are cold on each launch; a
* loop over one kernel keeps them in L1. lr_launch_distinct measures that difference. */
typedef void (*Thunk)(float*, hipStream_t);
template <int I>
static void thunk(float* p, hipStream_t st) {
hipLaunchKernelGGL(k<I>, dim3(1), dim3(64), 0, st, p);
}
static Thunk g_thunk[NK];
template <int I>
struct RegT {
static void go() { g_thunk[I] = &thunk<I>; RegT<I - 1>::go(); }
};
template <>
struct RegT<0> {
static void go() { g_thunk[0] = &thunk<0>; }
};
extern "C" int lr_launch_distinct(void* p, void* stream, int n) {
for (int i = 0; i < n; ++i) g_thunk[i % NK]((float*)p, (hipStream_t)stream);
return 0;
}
extern "C" int lr_registered(void) {
Reg<NK - 1>::go();
RegT<NK - 1>::go();
int live = 0;
for (int i = 0; i < NK; ++i) live += g_tab[i] != 0;
return live;
}
extern "C" int lr_launch(void* p, void* stream) {
hipLaunchKernelGGL(k<0>, dim3(1), dim3(64), 0, (hipStream_t)stream, (float*)p);
return 0;
}