[BugFix] Improve GDN layer detection for multimodal models#6941
[BugFix] Improve GDN layer detection for multimodal models#6941wangxiyuan merged 1 commit intovllm-project:mainfrom
Conversation
Co-authored-by: wanghuanjun2113 <wanghuanjun2113@gmail.com> Co-authored-by: SlightwindSec <slightwindsec@gmail.com> Signed-off-by: SlightwindSec <slightwindsec@gmail.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the robustness and compatibility of GDN layer detection within the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request enhances the check_gdn_layer function in vllm_ascend/utils.py to improve the detection of GDN layers, particularly for multimodal models. The changes introduce support for checking text_config.layer_types in addition to the root-level layer_types and fix a potential None reference error by using getattr with a fallback. The implementation is correct and addresses the stated goals effectively. I have no major concerns with this change.
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. |
…to qwen3next_graph * 'main' of https://github.com/vllm-project/vllm-ascend: (40 commits) [Feature] Add docs of batch invariance and make some extra operators patch (vllm-project#6910) [bugfix]Qwen2.5VL accurate question (vllm-project#6975) [CI] Add DeepSeek-V3.2 large EP nightly ci (vllm-project#6378) [Ops][BugFix] Fix RoPE shape mismatch for mtp models with flashcomm v1 enabled (vllm-project#6939) [bugfix]fix file not found error in nightly of single-node (vllm-project#6976) [Bugfix] Fix the acceptance rates dorp issue when applying eagle3 to QuaRot model (vllm-project#6914) [CI] Enable auto upgrade e2e estimated time for auto-partition suites (vllm-project#6840) [Doc][Misc] Fix msprobe_guide.md documentation issues (vllm-project#6965) [Nightly][Refactor]Migrate nightly single-node model tests from `.py` to `.yaml` (vllm-project#6503) [BugFix] Improve GDN layer detection for multimodal models (vllm-project#6941) [feat]ds3.2 pcp support mtp and chunkprefill (vllm-project#6917) [CPU binding] Implement global CPU slicing and improve IRQ binding for Ascend NPUs (vllm-project#6945) [Triton] Centralize Ascend extension op dispatch in triton_utils (vllm-project#6937) [csrc][bugfix] Add compile-time Ascend950/910_95 compatibility for custom ops between CANN8.5 and 9.0 (vllm-project#6936) [300I][Bugfix] fix unquant model weight nd2nz error (vllm-project#6851) [doc] fix supported_models (vllm-project#6930) [CI] nightly test timeout (vllm-project#6912) [CI] Upgrade CANN to 8.5.1 (vllm-project#6897) [Model]Add Qwen3-Omni quantization Ascend NPU adaptation and optimization (vllm-project#6828) [P/D][v0.16.0]Adapt to RecomputeScheduler in vLLM 0.16.0 (vllm-project#6898) ...
…ect#6941) ## Summary - Enhanced `check_gdn_layer()` function to properly detect GDN layers in multimodal models - Added support for checking `text_config.layer_types` in addition to root-level `layer_types` - Fixed potential None reference errors when `layer_types` attribute is missing ## Changes - Modified `vllm_ascend/utils.py`: - Replaced `hasattr()` check with safer `getattr()` approach - Added fallback to empty list when `layer_types` is None - Added secondary check for `text_config.layer_types` to support models like Qwen-Omni ## Motivation Previous implementation only checked `layer_types` at the root config level, which failed to detect GDN layers in multimodal models where this information is nested under `text_config`. Additionally, it could raise errors when `layer_types` was None. --- Co-authored-by: wanghuanjun2113 <wanghuanjun2113@gmail.com> Co-authored-by: SlightwindSec <slightwindsec@gmail.com> 🤖 Generated with [Claude Code](https://claude.com/claude-code) - vLLM version: v0.16.0 - vLLM main: vllm-project/vllm@15d76f7 Signed-off-by: SlightwindSec <slightwindsec@gmail.com> Co-authored-by: wanghuanjun2113 <wanghuanjun2113@gmail.com>
Summary
check_gdn_layer()function to properly detect GDN layers in multimodal modelstext_config.layer_typesin addition to root-levellayer_typeslayer_typesattribute is missingChanges
vllm_ascend/utils.py:hasattr()check with safergetattr()approachlayer_typesis Nonetext_config.layer_typesto support models like Qwen-OmniMotivation
Previous implementation only checked
layer_typesat the root config level, which failed to detect GDN layers in multimodal models where this information is nested undertext_config. Additionally, it could raise errors whenlayer_typeswas None.Co-authored-by: wanghuanjun2113 wanghuanjun2113@gmail.com
Co-authored-by: SlightwindSec slightwindsec@gmail.com
🤖 Generated with Claude Code