perf(vllm-omni): batch BAGEL grouped t2i rollout into one packed generate_image - #203
Merged
Merged
Conversation
zzhuoxin1508
force-pushed
the
bagel-dit-batch-main
branch
from
July 14, 2026 06:21
8c534f8 to
d685cce
Compare
zzhuoxin1508
marked this pull request as ready for review
July 15, 2026 07:21
2 tasks
11 tasks
Only collapse samples_per_prompt when cfg<=1 so cfg>1 keeps the real sample-level path; refuse num_outputs>1 when not batchable. Treat missing CFG keys as non-batchable (upstream defaults CFG-ON). Rename/clarify the generate_image tap and reuse grouped_texts_from_req.
…decode Simplify spp access, rename packability helper, shorten comments, reuse upstream's first VAE decode, contiguous log-probs for IPC, and reject text-output modalities in the batchable guard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
num_outputs_per_prompt=samples_per_prompt(spp) instead of sending one diffusionrequest per image sample. The shared prompt KV is built once and replicated ×spp;
all spp images are denoised in one packed
generate_imageper step, then theengine splits them back per request.
recipes (grouped-span slice of
resolve_request_noise), splitting log-prob +trajectory per image (
[spp, T+1, seq, C]), and validating the grouped promptlayout via
grouped_texts_from_req.pack_initial_noise_extra_args()keywordn_prompts=->n_samples=and updated theshared
dit.pycaller, butBagelInputAdapter(merged from a side branch) stillpasses
n_prompts=. Since that rename, everybagel_t2irollout that packs adriver-authored x_T crashes on its first generate with `TypeError: pack_initial_noise_extra_args() got an
unexpected keyword argument 'n_prompts'
Compatibility / Risk
_is_packable_t2i/_is_batchable_t2i). cfg>1 / text-output / i2i keep the sample-level layout(
num_outputs_per_prompt=1); a mismatchednum_outputs>1on the worker raisesinstead of a broken silent fallback. spp=1 is byte-identical to before.
keys to CFG-ON @4.0/1.5).
== spp separate forwards. Only per-step SDE RNG differs (<0.1%, no collapse, ratio 1.0).
Test Plan
8×H20 BAGEL vLLM-Omni E2E, 3-way A/B (spp=16):
Confirm bagel_t2i with driver x_T (recipe /
initial_noise_batch) no longer raiseson
pack_initial_noise_extra_args.Smoke cfg>1 + spp>1: stays on sample-level path (no pack).
Reviewer Notes
resolve_request_noise— no new noise code._is_packable_t2i↔_is_batchable_t2i).