Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,18 @@ if(OpenMP_CXX_FOUND)
endif()
add_dependencies(onebit onebit_npu_forward_syntax)

# engine#2330: app/forward_serve.cpp lives under `if(ONEBIT_NPU)` (below), and CI configures without it because
# the NPU runtime is private -- so on 2026-11-13 a one-brace error in that file reached main with `build` green,
# and the next lane's container import failed on it. The file is compiled by ITSELF here, outside the guard, with
# ONEBIT_NPU_RUNTIME_OWN and only public headers: the same shape as onebit_npu_forward_syntax above, and it needs
# no private runtime, no device and no workflow change -- `add_dependencies(onebit ...)` puts it in the CI build.
add_library(onebit_serve_syntax OBJECT app/forward_serve.cpp)
target_compile_definitions(onebit_serve_syntax PRIVATE ONEBIT_NPU_RUNTIME_OWN)
target_include_directories(onebit_serve_syntax PRIVATE
app npu npu/forward/include ${CMAKE_BINARY_DIR}/generated)
target_link_libraries(onebit_serve_syntax PRIVATE nlohmann_json::nlohmann_json httplib::httplib)
add_dependencies(onebit onebit_serve_syntax)

# What one MTP head step costs on the HOST (tools/mtp_head_bench.cpp). The draft route's per-iteration cost is two
# base passes plus the drafter's logits calls (both on the array) and the head's own arithmetic (this host), so this
# is the only term measurable without the device -- and the term a maths change has to be stated on. It also prints
Expand Down
18 changes: 12 additions & 6 deletions app/forward_serve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,18 @@ void handle_generate_impl(ForwardEngine& e, const httplib::Request& req, httplib
// than rendered as text and answered. The chain it would call exists; the parse and the join here do not.
if (npu::message_carries_an_image(ordered.at("messages"))) {
res.status = 400;
res.set_content(nlohmann::ordered_json{{"error", nlohmann::ordered_json{{"message",
"this route has no vision wiring yet (engine#2324): the request carries an image part and the "
"NPU route parses no pixels, so answering it would ignore the picture. Text-only requests are "
"unaffected. The vision chain exists (npu/vision_tower.h and friends) and is driven by "
"npu/forward/minicpm_image_probe.cpp; the serve-side parse and the image positions are what is missing."},
{"type", "unsupported_image_part"}, {"code", 400}}}.dump(), "application/json");
// engine#2327 left this one brace short of compiling; written the way the other error bodies in
// this file are, so the next reader does not have to count braces to see what it says.
nlohmann::ordered_json body_out;
body_out["error"] = {
{"message",
"this route has no vision wiring yet (engine#2324): the request carries an image part and the "
"NPU route parses no pixels, so answering it would ignore the picture. Text-only requests are "
"unaffected. The vision chain exists (npu/vision_tower.h and friends) and is driven by "
"npu/forward/minicpm_image_probe.cpp; the serve-side parse and the image positions are what is missing."},
{"type", "unsupported_image_part"},
{"code", 400}};
res.set_content(body_out.dump(), "application/json");
return;
}
// An earlier call's arguments arrive as a JSON string; the template is written against the
Expand Down
Loading