Skip to content

[Bugfix] Fix num_hidden_layers when Qwen2-Audio 7B #1803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2025

Conversation

zhangxinyuehfad
Copy link
Contributor

@zhangxinyuehfad zhangxinyuehfad commented Jul 15, 2025

What this PR does / why we need it?

Fix num_hidden_layers when Qwen2-Audio 7B and #1760

INFO 07-15 04:38:53 [platform.py:174] PIECEWISE compilation enabled on NPU. use_inductor not supported - using only ACL Graph mode
Traceback (most recent call last):
  File "/workspace/test1.py", line 58, in <module>
    main(audio_count)
  File "/workspace/test1.py", line 38, in main
    llm = LLM(model="Qwen/Qwen2-Audio-7B-Instruct",
  File "/vllm-workspace/vllm/vllm/entrypoints/llm.py", line 271, in __init__
    self.llm_engine = LLMEngine.from_engine_args(
  File "/vllm-workspace/vllm/vllm/engine/llm_engine.py", line 494, in from_engine_args
    vllm_config = engine_args.create_engine_config(usage_context)
  File "/vllm-workspace/vllm/vllm/engine/arg_utils.py", line 1286, in create_engine_config
    config = VllmConfig(
  File "/usr/local/python3.10.17/lib/python3.10/site-packages/pydantic/_internal/_dataclasses.py", line 123, in __init__
    s.__pydantic_validator__.validate_python(ArgsKwargs(args, kwargs), self_instance=s)
  File "/vllm-workspace/vllm/vllm/config.py", line 4624, in __post_init__
    current_platform.check_and_update_config(self)
  File "/vllm-workspace/vllm-ascend/vllm_ascend/platform.py", line 180, in check_and_update_config
    update_aclgraph_sizes(vllm_config)
  File "/vllm-workspace/vllm-ascend/vllm_ascend/utils.py", line 307, in update_aclgraph_sizes
    num_hidden_layers = vllm_config.model_config.hf_config.num_hidden_layers
  File "/usr/local/python3.10.17/lib/python3.10/site-packages/transformers/configuration_utils.py", line 211, in __getattribute__
    return super().__getattribute__(key)
AttributeError: 'Qwen2AudioConfig' object has no attribute 'num_hidden_layers'

Does this PR introduce any user-facing change?

How was this patch tested?

Closes: #1780 #1760 #1276 #359

@github-actions github-actions bot added documentation Improvements or additions to documentation module:core labels Jul 15, 2025
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

❌ Patch coverage is 97.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 73.26%. Comparing base (17a430f) to head (f764481).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
vllm_ascend/utils.py 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1803      +/-   ##
==========================================
+ Coverage   73.16%   73.26%   +0.09%     
==========================================
  Files          90       90              
  Lines        9929     9968      +39     
==========================================
+ Hits         7265     7303      +38     
- Misses       2664     2665       +1     
Flag Coverage Δ
unittests 73.26% <97.50%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wangxiyuan
Copy link
Collaborator

Is there any e2e test to run this model?

@zhangxinyuehfad
Copy link
Contributor Author

Is there any e2e test to run this model?

not yet, I will add it

@zhangxinyuehfad zhangxinyuehfad force-pushed the zxy_fix branch 3 times, most recently from de00b2f to c2f2750 Compare July 18, 2025 01:35
@zhangxinyuehfad zhangxinyuehfad force-pushed the zxy_fix branch 4 times, most recently from 9c90322 to 1c5749a Compare July 18, 2025 03:55
@Yikun
Copy link
Collaborator

Yikun commented Jul 23, 2025

@yiz-liu @MengqingCao Please taking a look?

@zhangxinyuehfad Cloud you also have a test on: #1760

@zhangxinyuehfad
Copy link
Contributor Author

@zhangxinyuehfad Cloud you also have a test on: #1760

yes, it also pass on Qwen/Qwen2.5-Omni-7B

Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@Yikun
Copy link
Collaborator

Yikun commented Jul 26, 2025

LGTM.

BTW, I had an offline discuss with @ganyi1996ppo and @yiz-liu They also think this is an accept way to resolve the problem.

@Yikun Yikun merged commit d1c6408 into vllm-project:main Jul 26, 2025
30 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation module:core module:tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Doc]: Remove enforce_eager and --enforce-eager if tutorial model ready
5 participants