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
+32
-1
@@ -137,6 +137,8 @@ void Server::register_routes() {
|
||||
router_.post("/v1/chat/completions", [this](const HttpRequest& q) { return handle_chat(q); });
|
||||
router_.post("/v1/completions", [this](const HttpRequest& q) { return handle_completion(q); });
|
||||
router_.post("/v1/embeddings", [this](const HttpRequest& q) { return handle_embeddings(q); });
|
||||
router_.post("/v1/images/generations", [this](const HttpRequest& q) { return handle_images(q, false); });
|
||||
router_.post("/v1/images/edits", [this](const HttpRequest& q) { return handle_images(q, true); });
|
||||
router_.post("/v1/systemone", [this](const HttpRequest& q) { return handle_systemone(q); });
|
||||
router_.get ("/v1/models", [this](const HttpRequest& q) { return handle_models(q); });
|
||||
router_.get ("/v1/models/:id", [this](const HttpRequest& q) { return handle_models(q); });
|
||||
@@ -149,6 +151,8 @@ void Server::register_routes() {
|
||||
router_.post("/completions", [this](const HttpRequest& q) { return handle_native_completion(q); });
|
||||
router_.post("/infill", [this](const HttpRequest& q) { return handle_infill(q); });
|
||||
router_.post("/embeddings", [this](const HttpRequest& q) { return handle_embeddings(q); });
|
||||
router_.post("/images/generations", [this](const HttpRequest& q) { return handle_images(q, false); });
|
||||
router_.post("/images/edits", [this](const HttpRequest& q) { return handle_images(q, true); });
|
||||
router_.get ("/models", [this](const HttpRequest& q) { return handle_models(q); });
|
||||
/* llama-server's: the prompt a chat request renders to, and how many tokens it is. */
|
||||
router_.post("/apply-template", [this](const HttpRequest& q) { return handle_apply_template(q); });
|
||||
@@ -1268,6 +1272,11 @@ HttpResponse Server::handle_chat(const HttpRequest& req) {
|
||||
return error_response(err_not_implemented("this is an embedding model: it serves "
|
||||
"/v1/embeddings and generates no text"),
|
||||
req.peer);
|
||||
if (opt_.image_model)
|
||||
return error_response(err_not_implemented("this is an image model: it serves "
|
||||
"/v1/images/generations and /v1/images/edits "
|
||||
"and generates no text"),
|
||||
req.peer);
|
||||
|
||||
OaiRequest r;
|
||||
ApiError err;
|
||||
@@ -1329,6 +1338,11 @@ HttpResponse Server::handle_messages(const HttpRequest& req) {
|
||||
return error_response(err_not_implemented("this is an embedding model: it serves "
|
||||
"/v1/embeddings and generates no text"),
|
||||
req.peer, ApiShape::Anthropic);
|
||||
if (opt_.image_model)
|
||||
return error_response(err_not_implemented("this is an image model: it serves "
|
||||
"/v1/images/generations and /v1/images/edits "
|
||||
"and generates no text"),
|
||||
req.peer, ApiShape::Anthropic);
|
||||
std::string chat, label;
|
||||
ApiError err;
|
||||
OaiRequest r;
|
||||
@@ -1363,6 +1377,11 @@ HttpResponse Server::handle_native_completion(const HttpRequest& req) {
|
||||
return error_response(err_not_implemented("this is an embedding model: it serves "
|
||||
"/v1/embeddings and generates no text"),
|
||||
req.peer);
|
||||
if (opt_.image_model)
|
||||
return error_response(err_not_implemented("this is an image model: it serves "
|
||||
"/v1/images/generations and /v1/images/edits "
|
||||
"and generates no text"),
|
||||
req.peer);
|
||||
OaiRequest r;
|
||||
ApiError err;
|
||||
if (parse_completion_request(req.body, odeps_, lim_, &r, &err, /*native=*/true) < 0)
|
||||
@@ -1525,6 +1544,11 @@ HttpResponse Server::handle_responses(const HttpRequest& req) {
|
||||
return error_response(err_not_implemented("this is an embedding model: it serves "
|
||||
"/v1/embeddings and generates no text"),
|
||||
req.peer);
|
||||
if (opt_.image_model)
|
||||
return error_response(err_not_implemented("this is an image model: it serves "
|
||||
"/v1/images/generations and /v1/images/edits "
|
||||
"and generates no text"),
|
||||
req.peer);
|
||||
std::string chat, echo;
|
||||
ApiError err;
|
||||
OaiRequest r;
|
||||
@@ -1578,6 +1602,11 @@ HttpResponse Server::handle_completion(const HttpRequest& req) {
|
||||
return error_response(err_not_implemented("this is an embedding model: it serves "
|
||||
"/v1/embeddings and generates no text"),
|
||||
req.peer);
|
||||
if (opt_.image_model)
|
||||
return error_response(err_not_implemented("this is an image model: it serves "
|
||||
"/v1/images/generations and /v1/images/edits "
|
||||
"and generates no text"),
|
||||
req.peer);
|
||||
|
||||
OaiRequest r;
|
||||
ApiError err;
|
||||
@@ -1602,7 +1631,9 @@ HttpResponse Server::handle_embeddings(const HttpRequest& req) {
|
||||
req.peer);
|
||||
if (!deps_.embed)
|
||||
return error_response(err_not_implemented(
|
||||
"/v1/embeddings requires an embedding model; this one generates text"), req.peer);
|
||||
opt_.image_model ? "/v1/embeddings requires an embedding model; this one makes images"
|
||||
: "/v1/embeddings requires an embedding model; this one generates "
|
||||
"text"), req.peer);
|
||||
|
||||
OaiRequest r;
|
||||
ApiError err;
|
||||
|
||||
Reference in new issue
Block a user