Skip to content

feat: append vit executor for qwen3 vl model - #2207

Open
AmpereKowk wants to merge 4 commits into
xLLM-AI:mainfrom
AmpereKowk:qwen3_vl_executor
Open

feat: append vit executor for qwen3 vl model#2207
AmpereKowk wants to merge 4 commits into
xLLM-AI:mainfrom
AmpereKowk:qwen3_vl_executor

Conversation

@AmpereKowk

@AmpereKowk AmpereKowk commented Aug 12, 2026

Copy link
Copy Markdown

Description

  1. Append vit executor
  2. Make encode api support graph compile mode

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor
  • Documentation
  • Test
  • Build or CI

Pull Request Checklist

Thank you for contributing to xLLM. Before requesting review, please make sure the following items are complete.

PR Title and Commit Messages

  • The PR title and each commit message follow the xLLM commit format: <type>: <subject>.

Allowed types: feat, bugfix, docs, test, refactor, chore, style, revert, perf, model, build, release.
The subject should use clear English, start with a verb, include at least 4 words, and end with ..

Pre-commit Checks

  • I have installed pre-commit by running pip install pre-commit or an equivalent command.
  • I have installed the hooks with pre-commit install.
  • I have run pre-commit run --all-files and fixed any reported issues.

If you are unsure how to set up pre-commit, see the pre-commit documentation.

Self Review

  • I have self-reviewed the code according to .agents/skills/code-review/references/custom-code-style.md, especially code written or assisted by AI.
  • I have rebased this PR onto the latest main branch.

Build and Test Coverage

  • Tests have been added or updated as needed.
  • CUDA: python setup.py build test has passed on a CUDA machine.
  • NPU: python setup.py build test has passed on an NPU machine.
  • MLU: python setup.py build test has passed on an MLU machine.

Reviewer Notes

nie-linfeng and others added 2 commits August 20, 2026 14:51
…oPE + video)

Serve Qwen3-VL-32B-Instruct through the Python model executor
(--model_impl=python --python_graph_backend=aclgraph --backend=vlm): the ViT,
deepstack merger (visual indexes [8,16,24]), mRoPE, and the LLM residual
injection all run inside the Python nn.Module graph
(xllm/python/models/qwen3_vl.py). The C++ side handles only multimodal request
parsing / preprocessing / scheduling (--backend=vlm), independent of
--model_impl.

- mRoPE via torch_npu.npu_mrope(rotary_mode="half", cache_mode="interleave"),
  verified bit-identical to the HF apply_rotary_pos_emb reference.
- PyExecutorImpl wires vision encode -> get_input_embeddings on prefill steps
  and collapses mRoPE decode positions [3,N] to 1-D for the aclgraph decode path.
- Image AND video inputs: pixel_values/image_grid_thw and
  pixel_values_videos/video_grid_thw are forwarded to encode + scatter at their
  placeholder positions (image_token_id / video_token_id masks); VideoHandler
  now accepts local file:// URLs, mirroring ImageHandler.
- The image processor delegates to HF AutoImageProcessor for the python path.

Scope: the embedding scatter assumes enable_chunked_prefill=False (shipped
default). Chunked-prefill item-level scatter + the NPU paged mixed-batch
attention are tracked for a follow-up PR.

Verified on 8-card TP (Qwen3-VL-32B, --model_impl=python,
--enable_chunked_prefill=False): image and video requests return correct
output; 8x concurrent image and 8x concurrent video are stable.

Tests: tests/python/test_qwen3_vl_scatter.py, test_qwen3_vl_video_encode.py.

Co-Authored-By: Claude <noreply@anthropic.com>

# Conflicts:
#	xllm/python/registry.py
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.

2 participants