Archived
radiance 1.5.0
- Gemma 4 31B (PRs #74, #75, #81, #86; sfjes, keptn42): sliding and global attention with their own kernels, the assistant head as a drafter that reads the trunk's cache, the vision tower, a fused w4a8 decode step, bf16 and compressed-tensors int4 checkpoints, and window snapshots so a prefix hit on a sliding-window model resumes instead of prefilling again. deploy/compose/gemma4-31b-w4a8.yaml serves keptn42's container on two cards - ParoQuant (PRs #65, #66, #67; malic): Qwen3.8-27B checkpoints with learned Givens rotations, as int4, int5 and MXFP4, imported without re-quantising, the prefill's rotations on the matrix cores. deploy/compose/qwen3.8-27b-paro.yaml serves them on one card. A ParoQuant container made with the PR builds is refused: convert it again with --reuse <old container> - Gemma 4 26B-A4B with z-lab's DFlash drafter (PR #88; Perire): arch/gemma4 serves Google's bf16 checkpoint with the routed experts in block fp8 or bf16 (data/recipes/gemma4-26b-a4b-df*.recipe), and libr4d gains its windowed paged attention, the fused sandwich-norm joins, expert_scale and the sharded draft head's pair_argmax. A prefill chunk runs as two slices with its all-reduces beside the compute, bit-exact with the whole step. The 31B's global layers take the windowed attention too: an 11.5K-token prefill on two R9700s in 3.1 s instead of 4.9 - a startup that logs nothing for two minutes says where it waits (#89): the system call (a KFD request by name), the library that made it, and its stack, which addr2line resolves against the binary - the prefix cache is kept in VRAM and host memory only (#70): the disk tier wrote every block and snapshot a prompt produced, and its copies never outlived the process. --prefix-cache-host-mib is renamed --prefix-cache-mib; --prefix-cache-dir and --prefix-cache-disk-mib are removed, and startup refuses all three with what replaced them. The compose files no longer mount /data, and .env no longer needs RADIANCE_STATE - --prefix-cache-ttl S (default 3600, 0 never): a conversation no request has used for that long leaves the cache, whichever tier holds it; radiance:prefix_cache_expired_total counts them. A full host tier now drops its least recently used conversations - --vision-tower-placement vram|ram (#84): ram keeps an encoder tower in pinned host memory and gives its VRAM to the KV cache, read over the link once an image - timings carry ttft_ms and total_ms (#85): the server's own time from the request body's arrival to the first and the last token, queueing and tokenisation included - a KV-cache recall that found a moved expert with nowhere to go stopped halfway and leaked the slots it had already freed: after it every recall failed, the cache stayed short until a restart, and requests failed with HTTP 500. A recall now waits for the slots it is owed and always finishes - a tool result or tool-call arguments that are not JSON are no longer refused as nesting past 1024 levels for their unmatched brackets (#90): only text that parses as JSON is held to the bound, since nothing else is parsed into a tree - the host-pool refusal names the limit that applies to pinned memory (RAM less 1/64 and 1.5 GiB), not ttm.pages_limit - --embedding-placement auto, removed in 1.3.0, is refused with what replaced it - for out-of-tree kernel libraries: gemm_nt_q gains two operands (pb1, pb2, the part bounds), and the loader requires identical op schemas, so a library built against 1.4.0 must be rebuilt. For architecture plugins, rad_op_declared(b, op) asks whether an op is in the loaded vocabulary without declaring it
This commit is contained in:
commit
b93b531f63
127 files changed
+9609
-4796
No files matched your search
+94
-1
@@ -1,4 +1,5 @@
|
||||
/* util_test.cpp -- core/util/rad_util.cpp: the bedrock every other translation unit links against.
|
||||
/* util_test.cpp -- core/util/rad_util.cpp, the bedrock every other translation unit links against, and
|
||||
* core/util/stallwatch.cpp, which reports where a phase that has gone quiet waits.
|
||||
*
|
||||
* WHY THIS FILE EXISTS. Nothing here is interesting on its own, and every one of these is small
|
||||
* enough to read and believe -- which is what leaves such code untested. The two that are not
|
||||
@@ -13,8 +14,15 @@
|
||||
#include "rad_test.h"
|
||||
|
||||
#include "rad_internal.h"
|
||||
#include "util/stallwatch.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <condition_variable>
|
||||
#include <dlfcn.h>
|
||||
#include <fcntl.h>
|
||||
#include <mutex>
|
||||
#include <unistd.h>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
@@ -437,4 +445,89 @@ TEST(constraint_why_names_the_key_the_bound_and_what_was_there) {
|
||||
CHECK(miss.find("<absent>") != std::string::npos);
|
||||
}
|
||||
|
||||
/* ================================================================== StallWatch */
|
||||
|
||||
namespace {
|
||||
/* Everything written to stderr while `f` runs. */
|
||||
template <class F> std::string capture_stderr(F f) {
|
||||
std::fflush(stderr);
|
||||
char path[] = "/tmp/rad_util_test_XXXXXX";
|
||||
const int fd = mkstemp(path);
|
||||
const int saved = dup(2);
|
||||
dup2(fd, 2);
|
||||
f();
|
||||
std::fflush(stderr);
|
||||
dup2(saved, 2);
|
||||
close(saved);
|
||||
std::string out;
|
||||
if (FILE* r = std::fopen(path, "r")) {
|
||||
char buf[4096];
|
||||
size_t n;
|
||||
while ((n = std::fread(buf, 1, sizeof buf, r)) > 0) out.append(buf, n);
|
||||
std::fclose(r);
|
||||
}
|
||||
close(fd);
|
||||
unlink(path);
|
||||
return out;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
TEST(a_syscall_line_names_the_call_and_a_kfd_ioctl_by_its_name) {
|
||||
CHECK_EQ(stall_decode_syscall("running"), std::string("running"));
|
||||
CHECK_EQ(stall_decode_syscall("-1 0x7ffd1000 0x7f0012345678"), std::string("not in a system call"));
|
||||
CHECK(stall_decode_syscall("202 0x1 0x80 0x0 0x0 0x0 0x0 0x7ffd1000 0x0").rfind("futex", 0) == 0);
|
||||
/* A file that will not open -- a FIFO with no writer, a hung network mount -- is named too. */
|
||||
CHECK(stall_decode_syscall("257 0xffffff9c 0x5600 0x0 0x0 0x0 0x0 0x7ffd1000 0x0").rfind("openat", 0) == 0);
|
||||
/* An ioctl names the file its descriptor is open on and, for the KFD, the request by name:
|
||||
* _IOWR('K', 0x16, 40 bytes) is ALLOC_MEMORY_OF_GPU. */
|
||||
const int fd = open("/dev/null", O_RDONLY);
|
||||
CHECK(fd >= 0);
|
||||
const unsigned long req = (3ul << 30) | (40ul << 16) | ((unsigned long)'K' << 8) | 0x16;
|
||||
const std::string k = stall_decode_syscall(fmt("16 0x%x 0x%lx 0x0 0x0 0x0 0x0 0x0 0x0", fd, req));
|
||||
CHECK(k.find("ioctl(/dev/null, AMDKFD_IOC_ALLOC_MEMORY_OF_GPU)") != std::string::npos);
|
||||
/* Another driver's request is spelt out rather than guessed at. */
|
||||
const unsigned long drm = (3ul << 30) | (32ul << 16) | ((unsigned long)'d' << 8) | 0x40;
|
||||
const std::string d = stall_decode_syscall(fmt("16 0x%x 0x%lx 0x0 0x0 0x0 0x0 0x0 0x0", fd, drm));
|
||||
CHECK(d.find("type 'd' number 0x40") != std::string::npos);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
/* Relative to the module's load base, the number addr2line takes, which is not the file offset
|
||||
* where the linker placed a segment elsewhere than its file position. */
|
||||
TEST(an_address_is_named_by_its_module_and_its_offset_from_the_load_base) {
|
||||
const uintptr_t a = (uintptr_t)&capture_stderr<void (*)()>;
|
||||
Dl_info di{};
|
||||
CHECK(dladdr((void*)a, &di) != 0);
|
||||
CHECK_EQ(stall_module_offset(a), fmt("util_test+0x%lx", (unsigned long)(a - (uintptr_t)di.dli_fbase)));
|
||||
}
|
||||
|
||||
/* A thread that waits on a lock with nothing logged is reported once the quiet has passed: what
|
||||
* it is in, and its stack through this binary's frames. */
|
||||
TEST(a_quiet_phase_names_the_wait_and_the_stack_of_the_thread_in_it) {
|
||||
const std::string out = capture_stderr([] {
|
||||
std::mutex mu;
|
||||
std::condition_variable cv;
|
||||
std::unique_lock<std::mutex> lk(mu);
|
||||
StallWatch w("probe", 300);
|
||||
cv.wait_for(lk, std::chrono::milliseconds(1600));
|
||||
});
|
||||
CHECK(out.find("probe: nothing has been logged for") != std::string::npos);
|
||||
CHECK(out.find("futex") != std::string::npos);
|
||||
CHECK(out.find("stack: ") != std::string::npos);
|
||||
CHECK(out.find("util_test+0x") != std::string::npos);
|
||||
}
|
||||
|
||||
/* A phase that keeps logging is not quiet, however long it runs. */
|
||||
TEST(a_phase_that_logs_is_never_reported) {
|
||||
const std::string out = capture_stderr([] {
|
||||
StallWatch w("probe", 400);
|
||||
for (int i = 0; i < 12; ++i) {
|
||||
RAD_INFO("probe: step %d", i);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(150));
|
||||
}
|
||||
});
|
||||
CHECK(out.find("nothing has been logged") == std::string::npos);
|
||||
CHECK(out.find("probe: step 11") != std::string::npos);
|
||||
}
|
||||
|
||||
RAD_TEST_MAIN()
|
||||
Reference in new issue
Block a user