Skip to content

fix(client): add Qwen35Renderer to _build_mm_features dispatch#45

Open
eligotts wants to merge 1 commit into
mainfrom
fix/qwen35-mm-features-dispatch
Open

fix(client): add Qwen35Renderer to _build_mm_features dispatch#45
eligotts wants to merge 1 commit into
mainfrom
fix/qwen35-mm-features-dispatch

Conversation

@eligotts
Copy link
Copy Markdown
Contributor

@eligotts eligotts commented May 17, 2026

Summary

renderers.client._build_mm_features dispatches by renderer class to
serialize a renderer-emitted MultiModalData into vLLM's
/inference/v1/generate features payload. Only Qwen3VLRenderer was
registered; Qwen35Renderer — which is also a MultimodalRenderer and
ships the same pixel_values + image_grid_thw payload — fell through
to raise NotImplementedError(...). Every multimodal call routed
through a Qwen3.5 / Qwen3.6 model failed before reaching the engine.

Fix

Add Qwen35Renderer to the existing issubclass check, reusing
_build_qwen_vl_features with the same spatial_merge_size=2 default.
This matches the Qwen-VL family convention — every Qwen-VL image
processor in tree (Qwen2-VL, Qwen3-VL, Qwen3.5, Qwen3.6) ships with
merge_size=2, which is a vision-tower architectural parameter (set
at training time, not a runtime config).

Test plan

  • Parametrized the existing test_generate_serializes_multimodal_features_for_qwen3_vl
    to also cover Qwen35Renderer, mirroring the parametrize-over-models
    pattern in test_bridge.py and test_roundtrip.py. Both cases pass.
  • Verified end-to-end against Qwen/Qwen3.5-2B: rendered a real
    multimodal prompt ({user: [text, image_url]}), confirmed the
    previously-failing _build_mm_features(renderer, rendered.multi_modal_data)
    now returns a valid features payload (mm_hashes, mm_placeholders,
    kwargs_data all populated as expected).

Fixes #39.

Qwen35Renderer is a MultimodalRenderer and emits pixel_values +
image_grid_thw matching the Qwen-VL family payload schema, but wasn't
registered in renderers.client._build_mm_features — every multimodal
generate() call through it raised NotImplementedError. Add it to the
existing issubclass check, reusing _build_qwen_vl_features with the
same spatial_merge_size=2 default (the Qwen-VL family convention,
matched by every in-tree image processor).

Parametrizes the existing test_generate_serializes_multimodal_features
test over both Qwen3VLRenderer and Qwen35Renderer to guard the dispatch
on both branches, matching the parametrize-over-models pattern in
test_bridge.py and test_roundtrip.py.

Fixes #39.
@eligotts eligotts force-pushed the fix/qwen35-mm-features-dispatch branch from 60b72f9 to 6dfd643 Compare May 17, 2026 05:20
@eligotts eligotts marked this pull request as ready for review May 17, 2026 05:45
@eligotts eligotts requested a review from hallerite May 17, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Qwen35Renderer: missing dispatch in renderers.client._build_mm_features for vLLM multimodal payload

1 participant