[Lint]Style: Convert vllm-ascend/ to ruff format(new Batch #8)#6604
[Lint]Style: Convert vllm-ascend/ to ruff format(new Batch #8)#6604wangxiyuan merged 1 commit intovllm-project:mainfrom
vllm-ascend/ to ruff format(new Batch #8)#6604Conversation
|
👋 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. |
Summary of ChangesHello @MrZ20, 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 is a comprehensive code style and linting initiative for 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 applies ruff format to a batch of files in vllm_ascend/, leading to various stylistic improvements such as line wrapping, import formatting, and modernizing type hints. While most changes are purely stylistic, I've identified two critical issues in vllm_ascend/ops/register_custom_ops.py where refactoring has removed necessary null checks, potentially leading to runtime AttributeError crashes. These logical changes seem unintended for a formatting-focused PR and should be addressed.
| (num_tokens_across_dp_cpu.sum(), *x.shape[1:]), | ||
| device=x.device, | ||
| dtype=x.dtype) | ||
| result = torch.empty((num_tokens_across_dp_cpu.sum(), *x.shape[1:]), device=x.device, dtype=x.dtype) |
There was a problem hiding this comment.
The refactoring of this function has removed a null check for dp_metadata. The previous implementation handled cases where dp_metadata could be None when is_ep_comm is true. The new logic directly accesses dp_metadata.num_tokens_across_dp_cpu on line 58, which will raise an AttributeError if dp_metadata is None. This introduces a potential crash. Please restore the null check.
| (dp_size, forward_context.padded_length, *x.shape[1:]), | ||
| device=x.device, | ||
| dtype=x.dtype) | ||
| num_tokens_across_dp_cpu = get_forward_context().dp_metadata.num_tokens_across_dp_cpu |
There was a problem hiding this comment.
The refactoring of this function has removed a null check for dp_metadata. The previous implementation handled cases where dp_metadata could be None when is_ep_comm is true. The new logic directly accesses get_forward_context().dp_metadata.num_tokens_across_dp_cpu, which will raise an AttributeError if dp_metadata is None. This introduces a potential crash. Please restore the null check.
…to qwen3next_rebase * 'main' of https://github.com/vllm-project/vllm-ascend: [Patch] Remove the patch of MiniCPM (vllm-project#5975) [P/D] layerwise connector support recompute scheduler (vllm-project#5900) [CI] Add workflow support for lint image build (vllm-project#6489) [Bugfix] Fix problematic dummy_run & improper input_batch_size in eagle (vllm-project#6517) [Refactor]310p_e2e test case update (vllm-project#6539) [Refactor]refactor p2p connector (vllm-project#6551) [Refactor]refactor 310p attention impl and add ut (vllm-project#6579) [Refactor]refactor 310p ops and add ut (vllm-project#6591) [Ops][Refactor] Remove custom rotary_embedding operator (vllm-project#6523) [Lint]Style: Convert `vllm-ascend/` to ruff format(new Batch vllm-project#8) (vllm-project#6604) [Test] Add initial multi modal cases of Qwen2.5-VL-7B-Instruct for disaggregated encoder (vllm-project#5301) [CI] Fix broken CI (vllm-project#6599) [Lint]Style: Convert `vllm-ascend/` to ruff format(Batch vllm-project#10) (vllm-project#6173) [Lint]Style: Convert `vllm-ascend/` to ruff format(Batch vllm-project#11) (vllm-project#6176) [Lint]Style: Convert `vllm-ascend/` to ruff format(Batch vllm-project#8) (vllm-project#6129) [Lint]Style: Convert `vllm-ascend/` to ruff format(Batch vllm-project#7) (vllm-project#6023) [CI][Misc] Some improvement for github action (vllm-project#6587) [Image] Bump mooncake version to v0.3.8.post1 (vllm-project#6428)
…ject#8) (vllm-project#6604) ### What this PR does / why we need it? **Scope of Changes**: | File Path | | :--- | | vllm_ascend/ops/\_\_init\_\_.py | | vllm_ascend/ops/activation.py | | vllm_ascend/ops/flashcomm2_oshard_manager.py | | vllm_ascend/ops/layernorm.py | | vllm_ascend/ops/mla.py | | vllm_ascend/ops/mm_encoder_attention.py | | vllm_ascend/ops/register_custom_ops.py | | vllm_ascend/ops/vocab_parallel_embedding.py | | vllm_ascend/ops/weight_prefetch.py | | vllm_ascend/spec_decode/\_\_init\_\_.py | | vllm_ascend/spec_decode/eagle_proposer.py | | vllm_ascend/spec_decode/interface.py | | vllm_ascend/spec_decode/mtp_proposer.py | | vllm_ascend/spec_decode/ngram_proposer.py | | vllm_ascend/spec_decode/suffix_proposer.py | ### Does this PR introduce _any_ user-facing change? ### How was this patch tested? - vLLM version: v0.15.0 - vLLM main: vllm-project/vllm@d7e17aa Signed-off-by: MrZ20 <2609716663@qq.com> Signed-off-by: momochenchuw <chenchuw@huawei.com>
…ject#8) (vllm-project#6604) ### What this PR does / why we need it? **Scope of Changes**: | File Path | | :--- | | vllm_ascend/ops/\_\_init\_\_.py | | vllm_ascend/ops/activation.py | | vllm_ascend/ops/flashcomm2_oshard_manager.py | | vllm_ascend/ops/layernorm.py | | vllm_ascend/ops/mla.py | | vllm_ascend/ops/mm_encoder_attention.py | | vllm_ascend/ops/register_custom_ops.py | | vllm_ascend/ops/vocab_parallel_embedding.py | | vllm_ascend/ops/weight_prefetch.py | | vllm_ascend/spec_decode/\_\_init\_\_.py | | vllm_ascend/spec_decode/eagle_proposer.py | | vllm_ascend/spec_decode/interface.py | | vllm_ascend/spec_decode/mtp_proposer.py | | vllm_ascend/spec_decode/ngram_proposer.py | | vllm_ascend/spec_decode/suffix_proposer.py | ### Does this PR introduce _any_ user-facing change? ### How was this patch tested? - vLLM version: v0.15.0 - vLLM main: vllm-project/vllm@d7e17aa Signed-off-by: MrZ20 <2609716663@qq.com> Signed-off-by: zrj026 <zhangrunjiang026@gmail.com>
…ject#8) (vllm-project#6604) ### What this PR does / why we need it? **Scope of Changes**: | File Path | | :--- | | vllm_ascend/ops/\_\_init\_\_.py | | vllm_ascend/ops/activation.py | | vllm_ascend/ops/flashcomm2_oshard_manager.py | | vllm_ascend/ops/layernorm.py | | vllm_ascend/ops/mla.py | | vllm_ascend/ops/mm_encoder_attention.py | | vllm_ascend/ops/register_custom_ops.py | | vllm_ascend/ops/vocab_parallel_embedding.py | | vllm_ascend/ops/weight_prefetch.py | | vllm_ascend/spec_decode/\_\_init\_\_.py | | vllm_ascend/spec_decode/eagle_proposer.py | | vllm_ascend/spec_decode/interface.py | | vllm_ascend/spec_decode/mtp_proposer.py | | vllm_ascend/spec_decode/ngram_proposer.py | | vllm_ascend/spec_decode/suffix_proposer.py | ### Does this PR introduce _any_ user-facing change? ### How was this patch tested? - vLLM version: v0.15.0 - vLLM main: vllm-project/vllm@d7e17aa Signed-off-by: MrZ20 <2609716663@qq.com>
…ject#8) (vllm-project#6604) ### What this PR does / why we need it? **Scope of Changes**: | File Path | | :--- | | vllm_ascend/ops/\_\_init\_\_.py | | vllm_ascend/ops/activation.py | | vllm_ascend/ops/flashcomm2_oshard_manager.py | | vllm_ascend/ops/layernorm.py | | vllm_ascend/ops/mla.py | | vllm_ascend/ops/mm_encoder_attention.py | | vllm_ascend/ops/register_custom_ops.py | | vllm_ascend/ops/vocab_parallel_embedding.py | | vllm_ascend/ops/weight_prefetch.py | | vllm_ascend/spec_decode/\_\_init\_\_.py | | vllm_ascend/spec_decode/eagle_proposer.py | | vllm_ascend/spec_decode/interface.py | | vllm_ascend/spec_decode/mtp_proposer.py | | vllm_ascend/spec_decode/ngram_proposer.py | | vllm_ascend/spec_decode/suffix_proposer.py | ### Does this PR introduce _any_ user-facing change? ### How was this patch tested? - vLLM version: v0.15.0 - vLLM main: vllm-project/vllm@d7e17aa Signed-off-by: MrZ20 <2609716663@qq.com> Signed-off-by: zrj026 <zhangrunjiang026@gmail.com>
…ject#8) (vllm-project#6604) ### What this PR does / why we need it? **Scope of Changes**: | File Path | | :--- | | vllm_ascend/ops/\_\_init\_\_.py | | vllm_ascend/ops/activation.py | | vllm_ascend/ops/flashcomm2_oshard_manager.py | | vllm_ascend/ops/layernorm.py | | vllm_ascend/ops/mla.py | | vllm_ascend/ops/mm_encoder_attention.py | | vllm_ascend/ops/register_custom_ops.py | | vllm_ascend/ops/vocab_parallel_embedding.py | | vllm_ascend/ops/weight_prefetch.py | | vllm_ascend/spec_decode/\_\_init\_\_.py | | vllm_ascend/spec_decode/eagle_proposer.py | | vllm_ascend/spec_decode/interface.py | | vllm_ascend/spec_decode/mtp_proposer.py | | vllm_ascend/spec_decode/ngram_proposer.py | | vllm_ascend/spec_decode/suffix_proposer.py | ### Does this PR introduce _any_ user-facing change? ### How was this patch tested? - vLLM version: v0.15.0 - vLLM main: vllm-project/vllm@d7e17aa Signed-off-by: MrZ20 <2609716663@qq.com>
What this PR does / why we need it?
Scope of Changes:
Does this PR introduce any user-facing change?
How was this patch tested?