Revert "[Refactor] Unify full-graph parameter update logic (#6041)"#6227
Revert "[Refactor] Unify full-graph parameter update logic (#6041)"#6227wangxiyuan merged 1 commit intovllm-project:mainfrom
Conversation
|
👋 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. |
There was a problem hiding this comment.
Code Review
This pull request reverts commit 8966a99, which refactored the full-graph parameter update logic. The revert moves the parameter update logic from static methods within attention implementation classes back to standalone functions in vllm_ascend/compilation/acl_graph.py. The changes appear to correctly restore the previous implementation across all affected files, including tests. My main feedback is regarding code duplication for the graph parameter update dispatch logic, which is now present in three different locations. Consolidating this into a helper method would improve maintainability.
| if self.vllm_config.model_config.use_mla: | ||
| if self.pcp_size * self.dcp_size > 1: | ||
| # FIXME: Try using `auto_dispatch_capture=True` | ||
| update_mla_attn_dcp_pcp_params(self.update_stream, | ||
| forward_context, | ||
| maybe_padded_num_tokens) | ||
| else: | ||
| # FIXME: Try using `auto_dispatch_capture=True` | ||
| update_mla_attn_params(self.update_stream, forward_context, | ||
| maybe_padded_num_tokens, | ||
| self.speculative_config) | ||
| else: | ||
| if self.pcp_size * self.dcp_size > 1: | ||
| update_attn_dcp_pcp_params(self.update_stream, | ||
| forward_context, | ||
| maybe_padded_num_tokens) | ||
| else: | ||
| update_attn_params(self.update_stream, forward_context, | ||
| maybe_padded_num_tokens, | ||
| self.vllm_config) |
There was a problem hiding this comment.
This dispatch logic for updating graph parameters is duplicated in _generate_dummy_run_hidden_states (lines 2041-2059) and also in vllm_ascend/spec_decode/eagle_proposer.py (lines 1184-1198). This introduces a maintainability issue, as changes to this logic must be replicated in three places, increasing the risk of inconsistencies.
To address this, consider refactoring this logic into a helper method within the NPUModelRunner class. This would centralize the dispatch logic, making the code cleaner and less prone to errors.
For example, a new method _update_graph_params could be created to encapsulate this logic, and then called from all three locations.
|
CI all pass after reverting #6041. Do we plan to revert it directly or fix the bug it introduced? |
|
let's merge this first |
…ject#6041)" (vllm-project#6227) This reverts commit 9564934.
…6227) (#6231) This reverts commit 9564934. The CI failure doesn't related to this change. Let's reapply it. - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094
…ect#6041)" (vllm-project#6227) This reverts commit 8966a99. It breaks the test `tests/e2e/singlecard/spec_decode/test_mtp_eagle_correctness.py::test_deepseek_mtp_correctness[True-FULL_DECODE_ONLY-2-wemaster/deepseek_mtp_main_random_bf16]` - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094
…ject#6041)" (vllm-project#6227) (vllm-project#6231) This reverts commit 9564934. The CI failure doesn't related to this change. Let's reapply it. - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094
…ect#6041)" (vllm-project#6227) This reverts commit 8966a99. It breaks the test `tests/e2e/singlecard/spec_decode/test_mtp_eagle_correctness.py::test_deepseek_mtp_correctness[True-FULL_DECODE_ONLY-2-wemaster/deepseek_mtp_main_random_bf16]` - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094 Signed-off-by: zrj026 <zhangrunjiang026@gmail.com>
…ject#6041)" (vllm-project#6227) (vllm-project#6231) This reverts commit 9564934. The CI failure doesn't related to this change. Let's reapply it. - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094 Signed-off-by: zrj026 <zhangrunjiang026@gmail.com>
…ect#6041)" (vllm-project#6227) This reverts commit 8966a99. It breaks the test `tests/e2e/singlecard/spec_decode/test_mtp_eagle_correctness.py::test_deepseek_mtp_correctness[True-FULL_DECODE_ONLY-2-wemaster/deepseek_mtp_main_random_bf16]` - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094
…ject#6041)" (vllm-project#6227) (vllm-project#6231) This reverts commit 9564934. The CI failure doesn't related to this change. Let's reapply it. - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094
…ect#6041)" (vllm-project#6227) This reverts commit 8966a99. It breaks the test `tests/e2e/singlecard/spec_decode/test_mtp_eagle_correctness.py::test_deepseek_mtp_correctness[True-FULL_DECODE_ONLY-2-wemaster/deepseek_mtp_main_random_bf16]` - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094 Signed-off-by: zrj026 <zhangrunjiang026@gmail.com>
…ject#6041)" (vllm-project#6227) (vllm-project#6231) This reverts commit 9564934. The CI failure doesn't related to this change. Let's reapply it. - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094 Signed-off-by: zrj026 <zhangrunjiang026@gmail.com>
…ect#6041)" (vllm-project#6227) This reverts commit 8966a99. It breaks the test `tests/e2e/singlecard/spec_decode/test_mtp_eagle_correctness.py::test_deepseek_mtp_correctness[True-FULL_DECODE_ONLY-2-wemaster/deepseek_mtp_main_random_bf16]` - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094
…ject#6041)" (vllm-project#6227) (vllm-project#6231) This reverts commit 9564934. The CI failure doesn't related to this change. Let's reapply it. - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094
…ect#6041)" (vllm-project#6227) This reverts commit 8966a99. It breaks the test `tests/e2e/singlecard/spec_decode/test_mtp_eagle_correctness.py::test_deepseek_mtp_correctness[True-FULL_DECODE_ONLY-2-wemaster/deepseek_mtp_main_random_bf16]` - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094
…ject#6041)" (vllm-project#6227) (vllm-project#6231) This reverts commit 9564934. The CI failure doesn't related to this change. Let's reapply it. - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094
…ect#6041)" (vllm-project#6227) This reverts commit 8966a99. It breaks the test `tests/e2e/singlecard/spec_decode/test_mtp_eagle_correctness.py::test_deepseek_mtp_correctness[True-FULL_DECODE_ONLY-2-wemaster/deepseek_mtp_main_random_bf16]` - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094
…ject#6041)" (vllm-project#6227) (vllm-project#6231) This reverts commit 9564934. The CI failure doesn't related to this change. Let's reapply it. - vLLM version: v0.14.0 - vLLM main: vllm-project/vllm@d682094
This reverts commit 8966a99.
It breaks the test
tests/e2e/singlecard/spec_decode/test_mtp_eagle_correctness.py::test_deepseek_mtp_correctness[True-FULL_DECODE_ONLY-2-wemaster/deepseek_mtp_main_random_bf16]