perf(multimodal): Prewarm Kimi vision encoder before readiness#556
perf(multimodal): Prewarm Kimi vision encoder before readiness#556qimcis wants to merge 2 commits into
Conversation
|
cc @chenht2022 |
|
Hi, @qimcis. Is it possible to make Warmup more general, including multimodal models other than Kimi such as qwen3.5 image/video, including EPD encoder? |
24fb931 to
aab1942
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aab19429fc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| prewarm_multimodal_encoders( | ||
| target.model, | ||
| skip_server_warmup=server_args.skip_server_warmup, | ||
| device=f"cuda:{gpu_id}", | ||
| ) |
There was a problem hiding this comment.
Skip vision prewarm on decode-only workers
When a VLM server starts with disaggregation_mode="decode", run_event_loop still constructs EventLoop (only the encode role bypasses it), so this unconditional startup path prewarms/captures the vision encoder on decode workers. Decode workers only receive remote KV for extends and run decode steps, so they do not use the vision tower; because this happens before KV-cache sizing, the encoder allocations reduce decode capacity and add startup latency for no benefit. Gate the prewarm to aggregated/prefill roles, leaving EPD encode warmup in encode_loop.
Useful? React with 👍 / 👎.
|
Ran the exact Kimi setup on Qwen:
Results look good, have yet to test with video and EPD yet but will get to that next |
Summary
Previously during warmup, only text was was warmed up, in this pr i add multimodal vision warmup as well so that the overhead is not in the first real image request
Test Plan
b300 benchmark with Kimi-K2.5-NVFP4
16 requests at concurrency 4
benchmark times do not include server startup or warmup time, "no prewarm" run still had the normal text/server warmup, but it did not warm up the encoder
-> first image encode without prewarm was ~15010-15025ms
-> the startup prewarm cost was ~10717-10725ms per rank, before ready
-> then, the first real image encode after prewarm: ~39-41ms