Skip to content

[Frontend][EPD] Use JSON arrays for multimodal metadata - #56090

Merged
Isotr0py merged 2 commits into
vllm-project:mainfrom
gty111:epd-python-json-metadata
Sep 10, 2026
Merged

Isotr0py merged 2 commits into
vllm-project:mainfrom
gty111:epd-python-json-metadata

Conversation

@gty111

@gty111 gty111 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Send EPD placeholder metadata as numeric JSON arrays instead of torch/base64 tensors. Accept arrays only for model-declared metadata fields, preserving legacy base64 embedding inputs and the proxy's raw-media path.

Python-only prerequisite extracted from #55842, which now contains only Rust frontend changes. No scheduler, model runner, or EC transport changes. Duplicate checks found no other PR implementing this Python contract. Related to #52409.

Motivation

  • Performance: Avoid torch.save / torch.load and base64 encoding/decoding for small metadata arrays. The MUIRBench comparison below observed 2.59% higher throughput with JSON, with no aggregate accuracy regression; different node pairs prevent attributing the entire gain to this change.
  • Router and Rust frontend integration: Provide a language-neutral metadata format for future EPD support in vllm-project/router and the Rust frontend ([Frontend][EPD] Support JSON metadata references in Rust HTTP frontend #55842). Both can handle metadata as JSON arrays without depending on PyTorch or implementing its tensor serialization format.

Validation

.venv/bin/python -m pytest tests/entrypoints/unit_tests/test_chat_utils.py -k 'image_embeds or json_metadata or json_arrays' -q
.venv/bin/python -m pytest tests/v1/ec_connector/unit/test_epd_proxy_round_robin.py -q

17 + 11 tests passed; applicable pre-commit hooks passed.

MUIRBench, Qwen3.5-35B-A3B + Mooncake RDMA, 4E+4PD, V2, concurrency 96, CUDA graphs through 16384 tokens (no eager): 200 warmup questions, then five repetitions of the first 1200/2600 questions.

Base64 → JSON: accuracy 59.02% → 59.10%, mean throughput 60.48 → 62.05 req/s; both 0/6000 failures. Sequential runs on different node pairs, so the throughput difference is not an isolated causal estimate.

Prepared with AI assistance (OpenAI Codex).

Co-authored-by: OpenAI Codex <codex@openai.com>

Signed-off-by: Tianyu Guo <guoty@inferact.ai>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify

mergify Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Documentation preview: https://vllm--56090.org.readthedocs.build/en/56090/

@mergify mergify Bot added documentation Improvements or additions to documentation frontend kv-connector labels Sep 9, 2026
@DarkLight1337

Copy link
Copy Markdown
Member

cc @Isotr0py @zhouyou9505

@Isotr0py Isotr0py left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall look reasonable, leave a nit.

Comment thread vllm/entrypoints/chat_utils.py Outdated
Comment thread vllm/entrypoints/chat_utils.py Outdated
Co-authored-by: OpenAI Codex <codex@openai.com>

Signed-off-by: Tianyu Guo <guoty@inferact.ai>
@gty111 gty111 added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 10, 2026
@Isotr0py

Copy link
Copy Markdown
Member

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #88038 for commit 98c61c734dc4.

@Isotr0py
Isotr0py enabled auto-merge (squash) September 10, 2026 03:52
@zhouyou9505

zhouyou9505 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

I’ve reviewed this and it looks good to me.

@Isotr0py
Isotr0py merged commit 479611c into vllm-project:main Sep 10, 2026
112 checks passed
ItsRoy69 pushed a commit to ItsRoy69/vllm that referenced this pull request Sep 10, 2026
…#56090)

Signed-off-by: Tianyu Guo <guoty@inferact.ai>
Signed-off-by: Jyotirmoy Roy <jyotirmoyroy649@gmail.com>
pctablet505 added a commit to pctablet505/vllm that referenced this pull request Sep 10, 2026
Clears the `needs-rebase` conflict. The only conflict was the
`vllm.entrypoints.chat_utils` import block in
tests/entrypoints/unit_tests/test_chat_utils.py: vllm-project#56090 (479611c,
"[Frontend][EPD] Use JSON arrays for multimodal metadata") added
`_load_embeds_dict` and `_parse_metadata_array` at the same spot where this
branch added `_parse_chat_message_content`. All three are kept, in isort
order.

Nothing was dropped from either side. Upstream's new multimodal-metadata
tests and this branch's reasoning round-trip tests are unrelated, and the
behaviour this branch covers (the `reasoning` -> `reasoning_content` mirror
in `_parse_chat_message_content`, and `include_reasoning` gating the message
field but not the usage counter) is unchanged on upstream main.

Signed-off-by: pctablet505 <pctablet505@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jiaran-king added a commit to jiaran-king/vllm that referenced this pull request Sep 15, 2026
Merge upstream main at 3192898.
Include the EPD proxy serialization optimization (vllm-project#56657), JSON-array
multimodal metadata (vllm-project#56090), and media processing options forwarding
(vllm-project#56786). Git merged the overlapping Mooncake KV worker and tests without
conflicts; no manual code adjustments were needed.

Validation: 61 EC/cache/runner/proxy CPU tests and 171 Mooncake KV Store
worker CPU tests passed. PR-file pre-commit, including mypy 3.10, passed.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Zhou ziheng <jiaranran2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation frontend kv-connector ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants