Skip to content

Conversation

ChenTaoyu-SJTU
Copy link
Collaborator

@ChenTaoyu-SJTU ChenTaoyu-SJTU commented Sep 4, 2025

What this PR does / why we need it?

Refector prepare_inputs in model_runner_v1.py for more easy read.

Does this PR introduce any user-facing change?

NO

How was this patch tested?

PASS CI

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the _prepare_inputs method in model_runner_v1.py to improve readability by extracting a helper function and using more idiomatic Python. The changes are generally good and achieve the stated goal. I have found one instance of redundant computation that can be removed to further improve the code's clarity and performance.

Copy link

github-actions bot commented Sep 4, 2025

👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:‌‌

  • A PR should do only one thing, smaller PRs enable faster reviews.
  • Every PR should include unit tests and end-to-end tests ‌to ensure it works and is not broken by other future PRs.
  • Write the commit message by fulfilling the PR description to help reviewer and future developers understand.

If CI fails, you can run linting and testing checks locally according Contributing and Testing.

Copy link

codecov bot commented Sep 4, 2025

Codecov Report

❌ Patch coverage is 3.33333% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.91%. Comparing base (4c90fa7) to head (038d952).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
vllm_ascend/worker/model_runner_v1.py 3.33% 29 Missing ⚠️

❌ Your patch status has failed because the patch coverage (3.33%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2750      +/-   ##
==========================================
- Coverage   72.99%   72.91%   -0.09%     
==========================================
  Files         153      153              
  Lines       21331    21397      +66     
==========================================
+ Hits        15571    15601      +30     
- Misses       5760     5796      +36     
Flag Coverage Δ
unittests 72.91% <3.33%> (-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.

Signed-off-by: ChenTaoyu-SJTU <[email protected]>
@ChenTaoyu-SJTU ChenTaoyu-SJTU force-pushed the refector_some_pre_inputs branch from 7029cae to 7ae539a Compare September 5, 2025 03:34
Signed-off-by: ChenTaoyu-SJTU <[email protected]>
@wangxiyuan wangxiyuan merged commit dd087ef into vllm-project:main Sep 8, 2025
24 of 25 checks passed
1Fire4 pushed a commit to 1Fire4/vllm-ascend that referenced this pull request Sep 8, 2025
### What this PR does / why we need it?
Refector prepare_inputs in model_runner_v1.py for more easy read.

### Does this PR introduce _any_ user-facing change?
NO
### How was this patch tested?
PASS CI

- vLLM version: v0.10.1.1
- vLLM main:
vllm-project/vllm@e599e2c

---------

Signed-off-by: ChenTaoyu-SJTU <[email protected]>
Signed-off-by: 1Fire4 <[email protected]>
1Fire4 pushed a commit to 1Fire4/vllm-ascend that referenced this pull request Sep 8, 2025
### What this PR does / why we need it?
Refector prepare_inputs in model_runner_v1.py for more easy read.

### Does this PR introduce _any_ user-facing change?
NO
### How was this patch tested?
PASS CI

- vLLM version: v0.10.1.1
- vLLM main:
vllm-project/vllm@e599e2c

---------

Signed-off-by: ChenTaoyu-SJTU <[email protected]>
Signed-off-by: 1Fire4 <[email protected]>
Angazenn pushed a commit to Angazenn/vllm-ascend that referenced this pull request Sep 10, 2025
### What this PR does / why we need it?
Refector prepare_inputs in model_runner_v1.py for more easy read.

### Does this PR introduce _any_ user-facing change?
NO
### How was this patch tested?
PASS CI

- vLLM version: v0.10.1.1
- vLLM main:
vllm-project/vllm@e599e2c

---------

Signed-off-by: ChenTaoyu-SJTU <[email protected]>
offline893 pushed a commit to offline893/vllm-ascend that referenced this pull request Sep 16, 2025
### What this PR does / why we need it?
Refector prepare_inputs in model_runner_v1.py for more easy read.

### Does this PR introduce _any_ user-facing change?
NO
### How was this patch tested?
PASS CI

- vLLM version: v0.10.1.1
- vLLM main:
vllm-project/vllm@e599e2c

---------

Signed-off-by: ChenTaoyu-SJTU <[email protected]>
Signed-off-by: offline0806 <[email protected]>
wangxiaoteng888 pushed a commit to LCAIZJ/vllm-ascend that referenced this pull request Sep 25, 2025
### What this PR does / why we need it?
Refector prepare_inputs in model_runner_v1.py for more easy read.

### Does this PR introduce _any_ user-facing change?
NO
### How was this patch tested?
PASS CI

- vLLM version: v0.10.1.1
- vLLM main:
vllm-project/vllm@e599e2c

---------

Signed-off-by: ChenTaoyu-SJTU <[email protected]>
chopper0126 pushed a commit to chopper0126/vllm-ascend that referenced this pull request Sep 26, 2025
### What this PR does / why we need it?
Refector prepare_inputs in model_runner_v1.py for more easy read.

### Does this PR introduce _any_ user-facing change?
NO
### How was this patch tested?
PASS CI

- vLLM version: v0.10.1.1
- vLLM main:
vllm-project/vllm@e599e2c

---------

Signed-off-by: ChenTaoyu-SJTU <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants