Skip to content

fix: handle missing out_hidden_size for LLaVA models in EPD encode worker#6759

Merged
KrishnanPrash merged 1 commit into
mainfrom
kprashanth/vllm-epd-llava
Mar 2, 2026
Merged

fix: handle missing out_hidden_size for LLaVA models in EPD encode worker#6759
KrishnanPrash merged 1 commit into
mainfrom
kprashanth/vllm-epd-llava

Conversation

@KrishnanPrash
Copy link
Copy Markdown
Contributor

@KrishnanPrash KrishnanPrash commented Mar 2, 2026

Overview:

  • Fix AttributeError: 'LlavaModel' object has no attribute 'out_hidden_size' crash in EncodeWorkerHandler initialization when using LLaVA models (e.g., llava-hf/llava-1.5-7b-hf) in disaggregated EPD multimodal serving.
  • Use getattr with fallback to model.config.hidden_size, then "unknown"

Fixes: DIS-1529

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced vision model configuration handling with improved fallback logic for better compatibility across different model types.
    • Improved logging for model configuration visibility.

Signed-off-by: Krishnan Prashanth <kprashanth@nvidia.com>
@KrishnanPrash KrishnanPrash requested a review from a team as a code owner March 2, 2026 19:11
@KrishnanPrash KrishnanPrash requested a review from a team March 2, 2026 19:11
@github-actions github-actions Bot added fix backend::vllm Relates to the vllm backend multimodal labels Mar 2, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6324523 and 265bf4c.

📒 Files selected for processing (1)
  • components/src/dynamo/vllm/multimodal_handlers/encode_worker_handler.py

Walkthrough

This pull request adds defensive programming to safely access the vision model's hidden size attribute. The change implements a fallback chain that attempts to retrieve the hidden size from multiple sources, defaulting to "unknown" if unavailable, and logs the result for transparency.

Changes

Cohort / File(s) Summary
Multimodal Handler Enhancement
components/src/dynamo/vllm/multimodal_handlers/encode_worker_handler.py
Replaces direct vision_model.out_hidden_size access with a safe lookup chain: attempts out_hidden_size, falls back to vision_model.config.hidden_size, defaults to "unknown", and logs the hidden size value for debugging.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Bouncing through the code with care,
We've added fallbacks here and there,
When hidden sizes play hide-and-seek,
Our gentle checks are never weak!
Safe lookups make the vision clear,

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the fix: handling missing out_hidden_size for LLaVA models in EPD encode worker, matching the core change.
Description check ✅ Passed The description includes overview, problem statement, solution, and issue reference (Fixes: DIS-1529), covering all template requirements adequately.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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 and usage tips.

@KrishnanPrash KrishnanPrash enabled auto-merge (squash) March 2, 2026 19:24
@KrishnanPrash KrishnanPrash disabled auto-merge March 2, 2026 19:25
@KrishnanPrash KrishnanPrash enabled auto-merge (squash) March 2, 2026 19:40
@KrishnanPrash KrishnanPrash merged commit 63070dd into main Mar 2, 2026
59 checks passed
@KrishnanPrash KrishnanPrash deleted the kprashanth/vllm-epd-llava branch March 2, 2026 19:42
KrishnanPrash added a commit that referenced this pull request Mar 2, 2026
…worker (#6759)

Signed-off-by: Krishnan Prashanth <kprashanth@nvidia.com>
KrishnanPrash added a commit that referenced this pull request Mar 2, 2026
…worker (#6759)

Signed-off-by: Krishnan Prashanth <kprashanth@nvidia.com>
yao531441 pushed a commit to yao531441/dynamo that referenced this pull request May 13, 2026
…worker (ai-dynamo#6759)

Signed-off-by: Krishnan Prashanth <kprashanth@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants