radiance 1.4.0

- Qwen3.8-Flash-Next on one card: the heat engine moves 64 experts a step (was 8), its copies and
  the prefill's expert staging run on the card's DMA engines instead of as copy kernels, and at
  decode the next layer's likeliest experts are copied onto the card ahead of its GEMMs. Against
  1.3.0 at --tp 1: prefill +17-20% from 8K tokens up, throughput under load +16-20%
- deploy/compose/flashnext-tp1.yaml: Qwen3.8-Flash-Next on one card and 64 GB of host RAM
  (4096-token prefill steps, 4 sequences, a 301K-token cache)
- #61: --busy-prefill-chunk (default auto): a long prefill leaves the rest of the step to the
  requests decoding beside it and to new arrivals, instead of taking all of it (baKon)
- LiquidAI's LFM2 and LFM2-VL, and d1's /v1/systemone (after zivius's PR #50)
- a startup report: every option with its value and where it came from, the hardware, and what
  on it costs speed with the fix; /diagnostics serves it (behind the API key; without one, only
  to the same machine)
- #69: a GPU memory fault names the buffer and kernel argument behind it and ends the server at
  once (exit status 70), instead of hanging or writing a core of tens of gigabytes
- #64: a card without Resizable BAR is refused at startup, naming what to turn on, instead of
  crashing at the first launch
- the image is built with ROCm 10.1 (the host's amdgpu driver must support it), with ROCm's
  libLLVM rebuilt so the same source compiles to the same kernels every time; a source build
  takes ROCm 10.1 or 7.2
- #71: the image ships curl, jq and a CA bundle, so --model <HF repo id> works in the container,
  and hfget.sh runs under its busybox (baKon)
- --profile-ops shows how long each op's lane sat idle before it; cardclock.py skips an
  integrated GPU instead of stopping
This commit is contained in:
Deadcode committed 2026-10-12 11:46:14 +02:00
1 parent d5b65cddc6
commit dc339b4cd2
153 files changed
+12956 -1067

No files matched your search

+24 -2
View File
@@ -5,6 +5,9 @@
* translation unit so that nothing above the transport seam pays for it. */
#include "cpp-httplib/httplib.h"
#include <arpa/inet.h>
#include <netinet/in.h>
#include <algorithm>
#include <atomic>
#include <cctype>
@@ -37,6 +40,26 @@ std::string HttpRequest::param(const std::string& k, const std::string& def) con
return q == query.end() ? def : q->second;
}
bool HttpRequest::peer_is_loopback() const {
if (peer.empty()) return true;
/* "addr:port", where an IPv6 address carries colons of its own: the port is after the last. */
const size_t colon = peer.rfind(':');
std::string addr = colon == std::string::npos ? peer : peer.substr(0, colon);
if (addr.size() >= 2 && addr.front() == '[' && addr.back() == ']')
addr = addr.substr(1, addr.size() - 2);
in_addr v4{};
if (inet_pton(AF_INET, addr.c_str(), &v4) == 1) return (ntohl(v4.s_addr) >> 24) == 127;
in6_addr v6{};
if (inet_pton(AF_INET6, addr.c_str(), &v6) != 1) return false;
if (IN6_IS_ADDR_LOOPBACK(&v6)) return true;
return IN6_IS_ADDR_V4MAPPED(&v6) && v6.s6_addr[12] == 127;
}
int idle_workers(int n_threads) {
const int n = n_threads > 0 ? n_threads : (int)std::thread::hardware_concurrency();
return std::max(n, 4);
}
HttpResponse HttpResponse::json_body(int status, std::string body) {
HttpResponse r;
r.status = status;
@@ -326,8 +349,7 @@ int HttpTransport::serve(const Router& router, const TransportOptions& o) {
svr.set_keep_alive_timeout(o.keep_alive_timeout_s);
svr.set_payload_max_length(o.max_body_bytes);
int nt = o.n_threads > 0 ? o.n_threads : (int)std::thread::hardware_concurrency();
if (nt < 4) nt = 4;
const int nt = idle_workers(o.n_threads);
const size_t most = (size_t)std::max<int64_t>(o.max_threads, nt);
const size_t queued = (size_t)std::max<int64_t>(o.max_queued, 0);
svr.new_task_queue = [nt, most, queued] { return new ConnectionPool((size_t)nt, most, queued); };