Repository navigation
feat(engine): image input in the ATOMesh standalone service - #3413
junyyang-amd wants to merge 8 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
valar-cop
left a comment
There was a problem hiding this comment.
some changes needed..
any real-processor run for kimi-k3.1 / minimax-m3.1 image chat through the standalone service?
ci green.
| placeholders, so its prompt arrives as token ids. Blocking. | ||
| """ | ||
| messages = self._get_chat_messages(request_data) | ||
| if has_multimodal_content(messages): |
There was a problem hiding this comment.
gate runs before check_chat_images, so a file image part falls to the text path and gets dropped. run check_chat_images first and gate on the checked messages, like api_server does.
Addresses the review of #3417: - Each decision names the PR of the stack that implements it (#3410, #3407, #3411-#3413, #3408, #3409, #3414-#3416); the Acceptance table names the PR that adds each check. - No reference outside ROCm/ATOM remains: the requirement, the measurements and the rules decisions rest on are stated in place. - D4/D5 follow #3410: decode clears `is_multimodal` when P kept the media; only the non-streaming single branch returns `cache_seed`. - D6 names the scheduler's actual refusal of a media-less local prefill. - D3 and A3 describe the route-log `match_ratio` check. - D11 says why matched rails do not apply; D12 states E's word handling as implemented, the 503 on a full pool, and the open gap: P's TP ranks do not agree on a read of E's embeddings. D13 notes `image_grid_thw` is dropped with the pixels once leased. - Harness facts follow #3416's defaults (g07, g08, g24 and HCA maps). - The CLAUDE.md row marks the guide as the design of its PR stack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| placeholders, so its prompt arrives as token ids. Blocking. | ||
| """ | ||
| messages = self._get_chat_messages(request_data) | ||
| if has_multimodal_content(messages): |
There was a problem hiding this comment.
still open: gate runs before check_chat_images, so a file part image is silently dropped. run check_chat_images first and gate on the checked messages, like api_server does.
There was a problem hiding this comment.
Fixed in 2a97bfb: check_chat_images runs first and the gate reads the checked messages. test_an_image_reaches_the_engine_with_its_placeholders[file] fails without it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `file` image part is an image only once check_chat_images has put it in its `image_url` form; gated first, it fell to the text path and was dropped. Check first and gate on the checked messages, as the OpenAI server does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Round 2 pushed 2a97bfb: the inline fix. The stack above is restacked on it. Real-processor runs, standalone service on MI355X, red and blue images, blocking and streaming:
EvidencePrompt "What color is this image? Answer with one word.", temperature 0, a 448x448 solid PNG as a base64 data URL.
The 400 body:
|
|
No blocking issues. Closed as superseded by #3698, which replaced the Python standalone service this PR extends. Its Rust frontend refuses an image request with a 400 ( Image chat through ATOMesh goes through ATOM's OpenAI server, as #3410, #3407, #3408 and #3409 serve it. Stack #3730 continues without this PR. |
Ready for review. PR 5 of 9 in stack #3730: #3410 → #3407 → #3411 → #3412 → this PR → #3408 → #3409 → #3415 → #3417. Stacked on #3412; this PR's diff is its own change only.
Why
ATOMesh is gaining image chat for MiniMax-M3.1 and Kimi-K3.1 as a single instance, 1P1D and E/P/D; this series replaces #3371, and #3417 is its design. Before this PR, the ATOMesh standalone service rendered only a message's text parts. A red photo sent with "What color is this?" reached the model as the question alone, and the model answered without seeing it.
What changed
flowchart LR A[chat request] --> B{image parts?} B -- no --> C[chat template, text prompt] B -- yes --> D["check_chat_images, then the native server's preparation (new)"] D -- malformed --> X[ValueError, a 400 at the router] D --> E["token ids plus multimodal_data (new)"] C --> F[engine, blocking or streaming] E --> Fmultimodal_data(_chat_engine_input).load_multimodal_processorandprepare_chat_multimodal_inputs, which both servers call.ValueErrorbefore anything reaches the engine.Review focus
kv_transfer_params, as for text, so image chat here serves a single instance.Testing
An
image_urlorfileimage reaches the engine with placeholders expanded and pixels intact. The processor loads once. Each malformed part is aValueErrorwith nothing sent to the engine; text-only chat renders as text.Kimi-K3.1 and MiniMax-M3.1 name red and blue images.
CPU unit suite green except
test_mxfp4_apply_hands_the_shared_output_to_fused_experts, which fails the same way onmain(from #2713).Follow-ups
filepart is a 400:openai-protocol1.0.0 lacks it.Evidence
In
tests/entrypoints/test_atom_standalone_service_images.py, blocking and streaming each:test_an_image_reaches_the_engine_with_its_placeholders[image_url|file]: prompt[9] + [42] * 4 + [8], spans((1, 4),), first pixel[255, 0, 0], usage equal to the prompt length.test_the_processor_is_loaded_once.test_a_malformed_image_part_is_the_clients_error[server-path|file-url|bad-base64|not-an-image|assistant|video].test_a_text_only_request_is_rendered_as_text.Real processor, standalone service (
USE_ATOMESH_ENTRYPOINTS=1), "What color is this image? Answer with one word.", temperature 0:🤖 Generated with Claude Code