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
+17
-20
@@ -1,11 +1,9 @@
|
||||
/* engine_gen.cpp -- the image generator's loop: the driver's passes (core/gen/driver.h) run on the
|
||||
* ranks the way the step loop runs token steps, one at a time and each drained before the next.
|
||||
/* engine_gen.cpp -- the image generator's loop: the driver's passes (core/gen/driver.h) run on
|
||||
* the ranks like token steps, one at a time, each drained before the next.
|
||||
*
|
||||
* WHY EACH PASS IS DRAINED. A generator pass is tens to thousands of milliseconds of device work,
|
||||
* and what decides the next one -- which image finished, which preview a step marked -- is the
|
||||
* driver's bookkeeping of the pass just run, not anything the card computes. Waiting for the card
|
||||
* between passes costs the few microseconds the host takes to build the next one; issuing ahead
|
||||
* would need a second staging region and a commit protocol, for nothing a client could measure.
|
||||
* Draining is cheap: a pass is tens to thousands of milliseconds of device work, and the next
|
||||
* pass depends only on the driver's host bookkeeping, so the wait costs the microseconds of
|
||||
* building it. Issuing ahead would need a second staging region and a commit protocol.
|
||||
*/
|
||||
#include "engine_priv.h"
|
||||
#include "gen/driver.h"
|
||||
@@ -20,6 +18,11 @@ int Engine::gen_loop() {
|
||||
RAD_ERR("image generator loop: could not bind rank 0's device");
|
||||
int step = 0, idle = 0;
|
||||
const rad_buf img = ranks_[0]->program.generator.image_out;
|
||||
/* An error ends the driver's requests, then the loop. */
|
||||
auto stop = [&](int st) {
|
||||
gen_->shutdown("the engine stopped on an error and is not serving", st);
|
||||
return fail_loop(st);
|
||||
};
|
||||
while (!stopping_.load(std::memory_order_acquire)) {
|
||||
const RadBatch* b = gen_->next(step);
|
||||
if (!b) {
|
||||
@@ -29,10 +32,7 @@ int Engine::gen_loop() {
|
||||
continue;
|
||||
}
|
||||
idle = 0;
|
||||
if (const int ps = prepare_release(b); ps < 0) {
|
||||
gen_->shutdown("the engine stopped on an error and is not serving", ps);
|
||||
return fail_loop(ps);
|
||||
}
|
||||
if (const int ps = prepare_release(b); ps < 0) return stop(ps);
|
||||
issue_what_.store(kIssueModel, std::memory_order_release);
|
||||
step_batch_.store(b, std::memory_order_release);
|
||||
barrier_->arrive_and_wait(); /* release the ranks */
|
||||
@@ -41,16 +41,15 @@ int Engine::gen_loop() {
|
||||
if (st < 0) {
|
||||
RAD_ERR("generator pass %d failed: %s -- the engine cannot continue", step,
|
||||
rad_strerror(st));
|
||||
gen_->shutdown("the engine stopped on an error and is not serving", st);
|
||||
return fail_loop(st);
|
||||
return stop(st);
|
||||
}
|
||||
/* A DECODE PASS'S IMAGE, behind it on rank 0's stream: every rank decodes the same pixels. */
|
||||
/* A decode pass's image, copied behind it on rank 0's stream; every rank holds the same
|
||||
* pixels. */
|
||||
if (const int64_t n = gen_->decode_bytes(); n > 0) {
|
||||
const void* src = ranks_[0]->ctx.buf_ptr(img);
|
||||
if (!src) {
|
||||
RAD_ERR("the generator's image buffer was declared but never planned");
|
||||
gen_->shutdown("the engine stopped on an error and is not serving", RAD_E_STATE);
|
||||
return fail_loop(RAD_E_STATE);
|
||||
return stop(RAD_E_STATE);
|
||||
}
|
||||
st = rad_memcpy_async(gen_->host_image(), src, n, ranks_[0]->ctx.stream());
|
||||
}
|
||||
@@ -58,11 +57,9 @@ int Engine::gen_loop() {
|
||||
if (st >= 0) st = rad_stream_sync(rk->ctx.stream());
|
||||
if (st < 0) {
|
||||
RAD_ERR("generator pass %d: the device failed: %s", step, rad_strerror(st));
|
||||
gen_->shutdown("the engine stopped on an error and is not serving", st);
|
||||
return fail_loop(st);
|
||||
return stop(st);
|
||||
}
|
||||
if ((int)log_level() >= (int)Log::Trace)
|
||||
dump_buffers(ranks_[0]->ctx, step, std::getenv("RADIANCE_DUMP_BUF"));
|
||||
dump_buffers(ranks_[0]->ctx, step);
|
||||
gen_->done();
|
||||
++step;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user