Archived
radiance 1.6.0
- Qwen-Image 2.1 and 2.1 Turbo: text to image and image edits over OpenAI's images API, /v1/images/generations and /v1/images/edits. An edit takes up to ten pictures and an optional mask, outside which the picture comes back exactly as it was; `background: transparent`, png, jpeg and webp output, `n` pictures from one prompt, streamed previews (`partial_images`), and vLLM-Omni's seed, negative_prompt with true_cfg_scale, num_inference_steps, width and height. arch/qwenimage21 serves the diffusers pipeline directory, converted with data/recipes/qwen-image-2.1-fp8.recipe (block fp8) or qwen-image-2.1-bf16.recipe. deploy/compose/qwen-image-2.1.yaml and qwen-image-2.1-turbo.yaml serve the fp8 containers on two cards. Two R9700s make a 2048x2048 picture in 61 s at the base model's 40 steps and in 13 s with Turbo (56 and 12 s with --tp-wire wht6), a 1024x1024 one in 6.0 and 2.6 s. The models are under Qwen's research license, which is non-commercial - an image generator is a program kind of its own (core/gen): an architecture declares its conditioning, denoising and decoding passes, and the driver runs the schedule, the pictures of a batch and the conditioning cache. An image model's /v1/models entry is its generator's name (qwen-image-2.1, qwen-image-2.1-turbo), and its capabilities and startup banner list only the images endpoints - the tiled prefill GEMMs run their tiles in groups of activation bands, 16 for fp8 and 8 for bf16, so an operand larger than the 64 MB cache is read once a group instead of once a band. A bf16 GEMM with more than 64 MB of weight runs up to twice as fast - fixed: a second lane opened in the middle of a step started beside work lane 0 had not finished. Gemma 4 26B-A4B opens its lane that way, so its first step after startup could read rows not yet written - startup no longer warns about --checkpoint-slots when it was not passed, nor about an expert floor on a model with no experts - the image's FFmpeg writes png, jpeg and webp (libwebp) - for out-of-tree plugins: RAD_ABI_VERSION is 16. The op vocabulary gains the image generator's ops (conv2d_nhwc, ln_mod, ln_mod_quant_fp8, flow_euler, attn_prefix_self and others; docs/OPS.md, "Image generation"), and all_reduce takes an optional `overlap`. Plugins built against 1.5.0 must be rebuilt
This commit is contained in:
1 parent
b93b531f63
commit
b068190326
66 files changed
+9035
-87
No files matched your search
+48
-1
@@ -8,6 +8,7 @@
|
||||
* path and shares nothing with this but the Engine's fields. See engine_priv.h.
|
||||
*/
|
||||
#include "engine_priv.h"
|
||||
#include "gen/driver.h"
|
||||
|
||||
#include "build/startup.h"
|
||||
#include "build/rad_build.h"
|
||||
@@ -979,6 +980,40 @@ int Engine::declare() {
|
||||
"the KL mode: a prefix hit would start a document past positions the reference holds";
|
||||
decide("--no-prefix-cache", "prefix caching off", prefix_off_why_);
|
||||
}
|
||||
/* AN IMAGE GENERATOR SIZES THE STEP ITSELF (RadArchProbe::gen_rows): a denoise pass carries an
|
||||
* image's every latent row at once -- twice with guidance -- and a conditioning pass encodes
|
||||
* every reference picture a request may carry. What the operator named is kept; what they did
|
||||
* not is the generator's. A generator samples no tokens, so it drafts none, and a conditioning
|
||||
* is read only by its own request's images, so there is no prefix to cache. */
|
||||
{
|
||||
RadArchProbe pb{};
|
||||
(void)rad_tools_probe(plugins_, meta_, &pb);
|
||||
if (pb.gen_rows > 0) {
|
||||
if (!cfg_.given.count("--max-num-batched-tokens")) {
|
||||
cfg_.max_tok = pb.gen_rows;
|
||||
decide("--max-num-batched-tokens", std::to_string(cfg_.max_tok),
|
||||
"an image generator: a denoise pass carries the largest image's latent "
|
||||
"rows twice (with guidance)");
|
||||
}
|
||||
if (!cfg_.given.count("--max-num-seqs")) {
|
||||
cfg_.max_seqs = 16;
|
||||
decide("--max-num-seqs", "16", "an image generator: images in one pass");
|
||||
}
|
||||
if (!cfg_.given.count("--max-model-len") && cfg_.max_ctx == 0) {
|
||||
cfg_.max_ctx = pb.gen_rows;
|
||||
decide("--max-model-len", std::to_string(cfg_.max_ctx),
|
||||
"an image generator: the longest conditioning, a prompt and its pictures, "
|
||||
"as the generator's rows");
|
||||
}
|
||||
if (cfg_.mm_max_patches < 0 && pb.gen_patches > 0) {
|
||||
cfg_.mm_max_patches = pb.gen_patches;
|
||||
decide("--mm-max-patches", std::to_string(cfg_.mm_max_patches),
|
||||
"an image generator: every reference picture of a request at once");
|
||||
}
|
||||
if (cfg_.n_spec < 0) cfg_.n_spec = 0;
|
||||
cfg_.prefix_cache = false;
|
||||
}
|
||||
}
|
||||
if (cfg_.n_spec < 0) {
|
||||
RadArchProbe pb{};
|
||||
(void)rad_tools_probe(plugins_, meta_, &pb);
|
||||
@@ -1381,7 +1416,8 @@ int Engine::plan() {
|
||||
const int64_t w = probe.state_index_width((int32_t)i);
|
||||
if (w > 0) kg.g[i].sidx_width = w;
|
||||
}
|
||||
f.staging = BatchBuilder::device_bytes(r->program, cfg_, kg);
|
||||
f.staging = r->program.is_generator() ? gen::Driver::device_bytes(r->program, cfg_)
|
||||
: BatchBuilder::device_bytes(r->program, cfg_, kg);
|
||||
if (f.staging < 0) return RAD_E_INVAL;
|
||||
late_step_bytes_ = std::max(late_step_bytes_, f.staging);
|
||||
int64_t lazy = r->program.scratch_regions > 1 ? f.queue_bytes : 0;
|
||||
@@ -3167,6 +3203,17 @@ int Engine::configure_kv() {
|
||||
* in vram_budget.cpp says it.) What is never acceptable is a pool that cannot
|
||||
* hold ONE max-length sequence:
|
||||
* that request is accepted by the API and can never complete, whatever the load. */
|
||||
/* An image generator's sequence is a conditioning, and its driver refuses one the
|
||||
* cache can never hold by name at admission; the limit is the operator's to know,
|
||||
* in its own terms, with nothing about experts the model does not have. */
|
||||
if (ranks_[0]->program.is_generator()) {
|
||||
RAD_WARN("kv group '%s' holds %lld rows: a conditioning longer than that -- a "
|
||||
"prompt with its pictures, up to %lld rows -- is refused. A picture "
|
||||
"costs a latent row per 16x16 pixels of the reference area; more ranks "
|
||||
"give the cache more room.",
|
||||
p->name.c_str(), (long long)cap, (long long)want);
|
||||
continue;
|
||||
}
|
||||
RAD_WARN("kv group '%s' holds %lld tokens but the context limit is %lld: ONE request "
|
||||
"longer than %lld tokens is accepted by the API and then refused as too "
|
||||
"large to ever fit -- this is a hard limit, not a backing ratio. Give the "
|
||||
|
||||
Reference in new issue
Block a user