Skip to content

[Model][ROCm] Enable DeepSeek V4 Vision - #55107

Merged
vllm-bot merged 9 commits into
mainfrom
akaratza_deepseek_v4_vision_rocm
Sep 11, 2026
Merged

vllm-bot merged 9 commits into
mainfrom
akaratza_deepseek_v4_vision_rocm

Conversation

@AndreasKaratzas

@AndreasKaratzas AndreasKaratzas commented Sep 3, 2026

Copy link
Copy Markdown
Member
  • Enable DeepseekV4ForConditionalGeneration on ROCm by moving the platform-neutral wrapper to common/, retaining the NVIDIA compatibility shim and unsupported XPU stub, and enabling ROCm registry, dummy-init, and tensor-schema paths.
  • Build checkpoint mappings from the active text backend, preserving NVIDIA self-finalization while deferring and idempotently applying ROCm finalization after generic per-layer quantization.
  • Route image sentinels through bias_vl in hash and regular ROCm MoE layers, expose local logits, and extend sparse-prefill visibility across complete image spans without changing text-only row width.
  • This extends PR #54566, merged as 1356635d837c4ef002ec98c1a0296e7ff60be3c1, which introduced the checkpoint with a NVIDIA-only wrapper and non-CUDA guards.

AI assistance: OpenAI Codex assisted with merge resolution, source review, and regression testing.

Resolve model paths without a piecewise provider to safe full-decode or eager modes when breakable graphs are unavailable, preserving platform compile paths and rejecting late-invalid combinations.

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

Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
Enable the shared DeepSeek V4 vision wrapper on ROCm, preserve platform-specific text behavior, and add focused multimodal and attention coverage.

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

Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
@mergify mergify Bot added deepseek Related to DeepSeek models multi-modality Related to multi-modality (#4194) DSv4 rocm Related to AMD ROCm labels Sep 3, 2026
@github-project-automation github-project-automation Bot moved this to Todo in AMD Sep 3, 2026
@AndreasKaratzas
AndreasKaratzas marked this pull request as ready for review September 3, 2026 23:42

@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 repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: a91f78c5-f20d-4636-bb0b-ce18cd058c81

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread vllm/models/deepseek_v4/amd/rocm.py Outdated
Comment thread vllm/models/deepseek_v4/amd/rocm.py Outdated
Comment thread tests/models/test_deepseek_v4_vl_rocm.py Outdated
Comment thread tests/models/test_initialization.py Outdated
Comment thread vllm/models/deepseek_v4/amd/model.py

@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.

Look reasonable. But would like to let @tjtanaa to check the rocm implementation.

Comment thread tests/models/multimodal/processing/test_tensor_schema.py Outdated
Comment thread tests/models/test_registry.py Outdated
AndreasKaratzas and others added 2 commits September 4, 2026 04:19
Preserve default compilation dispatch, accept graph-safe auxiliary configs, and keep adaptive verification on a full decode graph when piecewise capture is unavailable.

Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
@AndreasKaratzas

Copy link
Copy Markdown
Member Author

/ci run

Bring in the latest stacked-base changes, including the AMD LoRA allocator configuration fix.

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
@AndreasKaratzas

Copy link
Copy Markdown
Member Author

/ci run

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #87318 for commit 141ab249ecf1.

Copy link
Copy Markdown
Member Author

DeepSeek-V4-Flash-Vision-Exp on 4× AMD gfx950 per run (ROCm, TP4/EP, FP8 KV, AITER, 1,024 batched tokens, graph mode NONE; #55107 141ab249ecf1 + #55095 c6b3c36d87b4). Full test sets with greedy decoding; GSM8K uses vLLM's 5-shot CI protocol (256-token output limit).

Benchmark Baseline DSpark (3 tokens) Request errors (B / D) Truncations (B / D)
OCRBench 825 / 1,000 (82.5%) 822 / 1,000 (82.2%) 0 / 0 0 / 0
GSM8K 1,243 / 1,319 (94.2%) 1,239 / 1,319 (93.9%) 0 / 0 3 / 3

OCRBench category accuracy uses the official scoring rule, thinking disabled, and a 4,096-token output limit.

Category Baseline DSpark (3 tokens)
Regular Text Recognition 47 / 50 (94.0%) 47 / 50 (94.0%)
Irregular Text Recognition 46 / 50 (92.0%) 45 / 50 (90.0%)
Artistic Text Recognition 47 / 50 (94.0%) 47 / 50 (94.0%)
Digit String Recognition 33 / 50 (66.0%) 34 / 50 (68.0%)
Non-Semantic Text Recognition 45 / 50 (90.0%) 45 / 50 (90.0%)
Handwriting Recognition 32 / 50 (64.0%) 32 / 50 (64.0%)
Text Recognition (subtotal) 250 / 300 (83.3%) 250 / 300 (83.3%)
Scene Text-centric VQA 175 / 200 (87.5%) 176 / 200 (88.0%)
Doc-oriented VQA 177 / 200 (88.5%) 173 / 200 (86.5%)
Key Information Extraction 175 / 200 (87.5%) 175 / 200 (87.5%)
Handwritten Mathematical Expression Recognition 48 / 100 (48.0%) 48 / 100 (48.0%)

DSpark acceptance is aggregated over each full run using Prometheus counter deltas with fixed verification (adaptive verification disabled).

Metric OCRBench GSM8K
Mean acceptance length (tokens/forward) 3.00 3.25
Draft acceptance (accepted / drafted) 66.5% (33,820 / 50,844) 75.1% (81,209 / 108,159)
Per-position acceptance (1 / 2 / 3) 84.8% / 67.2% / 47.6% 90.4% / 76.3% / 58.5%

@tjtanaa tjtanaa 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.

LGTM. Let check the Cuda ci.

Base automatically changed from akaratza_noncompiled_cudagraph_fallback to main September 11, 2026 08:56
@mergify mergify Bot added speculative-decoding mrv2 Model Runner V2 specific labels Sep 11, 2026
Use the upstream CUDA graph fallback implementation from #55095 while
preserving ROCm vision routing, shared wrapper weight finalization, and
complete image-span visibility. Keep incoming runtime, quantization,
multimodal embedding, and DeepSeek V4.1 fixes and features.

Update the MTP routing test for the registered warmup kernel callable and
retain the additional adaptive-verification graph fallback case.

Keep row-major FP8 weights for DeepSeek V4's custom ROCm GEMM consumers.
The incoming AITER preshuffled backend otherwise rearranges weights before
the model's own preparation, causing double shuffling and incorrect raw
weight reads. Other linears retain the new backend.

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
@AndreasKaratzas

Copy link
Copy Markdown
Member Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #88304 for commit 9759753e48b6.

@AndreasKaratzas
AndreasKaratzas removed this pull request from stack #55110 September 11, 2026 10:12
Adopt the upstream AITER FP8 preshuffle fix from #56433 and remove
our superseded row-major kernel workaround. Preserve Quark detection
so its custom consumers also avoid shuffling weights twice.

Keep vision routing, deferred weight finalization and image-span
attention support, and retain both DeepSeek vision and incoming
HY-V4 tests in the AMD CI job. Update the FP8 numerical regressions
for the upstream weight and activation-scale layout contracts.

Validation: 346 tests passed, 6 skipped across configuration,
adaptive verification, vision/FP8, focused attention and RoPE config
checks. Real TP4 vision smoke returned 4 for 2+2 and matched all five
prior OCR pass/fail outcomes (3/5 correct), without request errors or
truncation.

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
@AndreasKaratzas

Copy link
Copy Markdown
Member Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #88338 for commit 4eab7c39a837.

@vllm-bot
vllm-bot merged commit 9dd969d into main Sep 11, 2026
182 of 184 checks passed
@vllm-bot
vllm-bot deleted the akaratza_deepseek_v4_vision_rocm branch September 11, 2026 16:17
@github-project-automation github-project-automation Bot moved this from Todo to Done in AMD Sep 11, 2026
ItsRoy69 pushed a commit to ItsRoy69/vllm that referenced this pull request Sep 15, 2026
Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build deepseek Related to DeepSeek models DSv4 mrv2 Model Runner V2 specific multi-modality Related to multi-modality (#4194) rocm Related to AMD ROCm speculative-decoding

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants