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
@@ -23,6 +23,8 @@
|
||||
#include <vector>
|
||||
|
||||
namespace rad {
|
||||
namespace gen { struct Request; }
|
||||
namespace mm { struct Frame; struct Item; }
|
||||
namespace server {
|
||||
|
||||
/* ordered_json, not json, and the reason is not cosmetic: a tool's parameter schema is rendered
|
||||
@@ -594,5 +596,34 @@ public:
|
||||
};
|
||||
|
||||
|
||||
/* THE IMAGE GENERATOR (core/gen), for a model that makes pictures rather than text: what the
|
||||
* model declared about its prompts and sizes, and the queue a request goes into. The server turns
|
||||
* an OpenAI images request into a gen::Request -- the prompt rendered and tokenised, the reference
|
||||
* pictures resized for both of the model's readers -- and reads the pictures back off its ticket. */
|
||||
struct ImageGenInfo {
|
||||
std::string name, tmpl_text, tmpl_edit, tmpl_image, tmpl_image_sep, drop_prefix,
|
||||
tmpl_transparent;
|
||||
int64_t latent_scale = 16, size_multiple = 32, pixel_channels = 4, max_tokens = 0;
|
||||
int64_t max_refs = 0, ref_area = 0, default_width = 0, default_height = 0;
|
||||
int64_t default_steps = 0, max_lanes = 1, max_cond_tokens = 0;
|
||||
/* The model samples on a schedule of its own and takes no step count (a distilled model). */
|
||||
bool fixed_schedule = false;
|
||||
int64_t fixed_steps = 0;
|
||||
double default_cfg = 1.0;
|
||||
};
|
||||
|
||||
class IImageGen {
|
||||
public:
|
||||
virtual ~IImageGen() = default;
|
||||
virtual const ImageGenInfo& info() const = 0;
|
||||
/* Queue a request; refused at once, with `why`, when it can never run. */
|
||||
virtual int submit(std::unique_ptr<gen::Request> r, std::string* why) = 0;
|
||||
/* A reference picture as the conditioning network's encoder reads it: RGB at the size it was
|
||||
* resized to, which the processor must not change. */
|
||||
virtual int picture(const mm::Frame& f, std::shared_ptr<mm::Item>* out, std::string* why) = 0;
|
||||
virtual int64_t queued() const = 0;
|
||||
virtual int64_t running() const = 0;
|
||||
};
|
||||
|
||||
} /* namespace server */
|
||||
} /* namespace rad */
|
||||
Reference in new issue
Block a user