Skip to content

[BugFix] Fix NoneType' object has no attribute 'detach'#2797

Merged
linyueqian merged 1 commit intovllm-project:mainfrom
amy-why-3459:bugfix
Apr 14, 2026
Merged

[BugFix] Fix NoneType' object has no attribute 'detach'#2797
linyueqian merged 1 commit intovllm-project:mainfrom
amy-why-3459:bugfix

Conversation

@amy-why-3459
Copy link
Copy Markdown
Contributor

@amy-why-3459 amy-why-3459 commented Apr 14, 2026

PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS (AT THE BOTTOM) HAVE BEEN CONSIDERED.

Purpose

fix #2788

k:tts_bos_embed, v:[tensor([[[ 0.0003, -0.0022,  0.0005,  ...,  0.0018,  0.0003,  0.0007]]],
(Worker pid=77251) INFO 04-14 12:29:51 [gpu_ar_model_runner.py:800]        dtype=torch.bfloat16)], idx:3, len(v):1

When the key is something like tts_bos_embed, idx will be greater than len(v), causing the key to not be assigned a value, thus resulting in None when detaching.

Test Plan

vllm bench serve \
    --omni \
  --dataset-name random \
  --port 28889 \
  --max-concurrency 4 \
  --model /home/models/Qwen/Qwen3-Omni-30B-A3B-Instruct \
  --endpoint /v1/chat/completions \
  --backend openai-chat-omni \
  --num-prompts 8 \
  --random-input-len 2500 \
  --ignore-eos \
  --percentile-metrics ttft,tpot,itl,e2el,audio_ttfp,audio_rtf \
  --random-output-len 900 \
  --extra_body '{"modalities": ["text", "audio"]}'

Test Result

============ Serving Benchmark Result ============
Successful requests:                     8
Failed requests:                         0
Maximum request concurrency:             4
Benchmark duration (s):                  199.45
Request throughput (req/s):              0.04
Peak concurrent requests:                5.00
----------------End-to-end Latency----------------
Mean E2EL (ms):                          87468.74
Median E2EL (ms):                        87588.02
P99 E2EL (ms):                           106065.05
================== Text Result ===================
Total input tokens:                      20112
Total generated tokens:                  6304
Output token throughput (tok/s):         31.61
Peak output token throughput (tok/s):    206.00
Peak concurrent requests:                5.00
Total Token throughput (tok/s):          132.45
---------------Time to First Token----------------
Mean TTFT (ms):                          1393.74
Median TTFT (ms):                        512.06
P99 TTFT (ms):                           3004.43
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          27.19
Median TPOT (ms):                        22.15
P99 TPOT (ms):                           52.22
---------------Inter-token Latency----------------
Mean ITL (ms):                           21.44
Median ITL (ms):                         0.01
P99 ITL (ms):                            330.02
================== Audio Result ==================
Total audio duration generated(s):       2153.29
Total audio frames generated:            51678825
Audio throughput(audio duration/s):      10.80
---------------Time to First Packet---------------
Mean AUDIO_TTFP (ms):                    3382.07
Median AUDIO_TTFP (ms):                  3047.07
P99 AUDIO_TTFP (ms):                     5916.30
-----------------Real Time Factor-----------------
Mean AUDIO_RTF:                          0.33
Median AUDIO_RTF:                        0.33
P99 AUDIO_RTF:                           0.34
==================================================

Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan. Please provide the test scripts & test commands. Please state the reasons if your codes don't require additional test scripts. For test file guidelines, please check the test style doc
  • The test results. Please paste the results comparison before and after, or the e2e results.
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model. Please run mkdocs serve to sync the documentation editions to ./docs.
  • (Optional) Release notes update. If your change is user-facing, please update the release notes draft.

BEFORE SUBMITTING, PLEASE READ https://github.com/vllm-project/vllm-omni/blob/main/CONTRIBUTING.md (anything written below this line will be removed by GitHub Actions)

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@yenuo26 yenuo26 added the nightly-test label to trigger buildkite nightly test CI label Apr 14, 2026
@amy-why-3459
Copy link
Copy Markdown
Contributor Author

@Sy0307 @linyueqian @yenuo26 PTAL

Copy link
Copy Markdown
Collaborator

@linyueqian linyueqian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Gaohan123 Gaohan123 added this to the v0.20.0 milestone Apr 14, 2026
Signed-off-by: amy-why-3459 <wuhaiyan17@huawei.com>
if isinstance(element, torch.Tensor):
element = element.clone()
mm_payload[k] = element
element = v[idx] if idx < len(v) else v[0]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also sync the code to NPUARModelRunner please?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was modified in this PR #2690, and it was found that npu_ar_model_runner.py was not modified, so NPU does not need to be modified.

element = v[idx] if idx < len(v) else v[0]
# Clone tensors to avoid cross-request aliasing
if isinstance(element, torch.Tensor):
    element = element.clone()
mm_payload[k] = element

@gcanlin gcanlin added ready label to trigger buildkite CI and removed nightly-test label to trigger buildkite nightly test CI labels Apr 14, 2026
@amy-why-3459
Copy link
Copy Markdown
Contributor Author

@linyueqian @Gaohan123 @gcanlin @hsliuustc0106 I think this PR is ready and can be merged. Ideally, it should be merged tonight, otherwise it will affect the nightly test results.

@linyueqian linyueqian merged commit f03ab38 into vllm-project:main Apr 14, 2026
8 checks passed
y123456y78 pushed a commit to y123456y78/vllm-omni that referenced this pull request Apr 15, 2026
y123456y78 pushed a commit to y123456y78/vllm-omni that referenced this pull request Apr 16, 2026
lvliang-intel pushed a commit to lvliang-intel/vllm-omni that referenced this pull request Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready label to trigger buildkite CI

Projects

None yet

5 participants