[model_runner_v2]optimize the performance of the post_update.#7496
[model_runner_v2]optimize the performance of the post_update.#7496weijinqian0 merged 6 commits intovllm-project:mainfrom
Conversation
…rnel. Signed-off-by: weijinqian_v1 <weijinqian@huawei.com>
Signed-off-by: weijinqian_v1 <weijinqian@huawei.com>
|
👋 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, 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 focuses on a critical performance improvement 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. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a Triton kernel to optimize the post_update operation for model_runner_v2 on NPUs, which shows a significant performance improvement. A new end-to-end test is added to ensure the correctness of the new implementation by comparing it against the original PyTorch version. My review found one issue in the new test file where the assertion's debug message was incorrectly calculating the difference, which I've provided a suggestion to fix.
Signed-off-by: weijinqian_v1 <weijinqian@huawei.com>
…roject#7496) ### What this PR does / why we need it? - This PR aims to enhance the operator performance in the `post_update` phase of `model_runner_v2` on NPUs. By optimizing the relevant operations, it is expected to improve the overall efficiency and speed of the model running on NPU hardware, which is crucial for scenarios where high-performance inference is required. - when bs = 256, time cost reduce from 26us to 11 us; ### Does this PR introduce _any_ user-facing change? No, there are no changes to the API, interface, or other high-level behaviors that would directly affect the user's code or interaction with the system beyond the performance improvement. ### How was this patch tested? CI passed with new added/existing tests. In addition to the regular CI tests, specific benchmark tests were conducted on NPU hardware to measure the performance improvement of the `post_update` operators. --------- Signed-off-by: weijinqian_v1 <weijinqian@huawei.com> Co-authored-by: weijinqian_v1 <weijinqian@huawei.com>
- Remove is_skipped flag from tests/e2e/singlecard/model_runner_v2/test_basic.py - Test was originally skipped due to get_cuda_view_from_cpu_tensor error (vllm-project#5752) - Recent model_runner_v2 improvements may have resolved the issue: - vllm-project#7110: Added aclgraph support - vllm-project#7496: Optimized post_update performance - vllm-project#7221: Optimized _topk_log_softmax_kernel performance - CI will verify if the test now passes successfully Signed-off-by: hejianping <hejianping7@huawei.com>
- Remove is_skipped flag from tests/e2e/singlecard/model_runner_v2/test_basic.py - Test was originally skipped due to get_cuda_view_from_cpu_tensor error (vllm-project#5752) - Recent model_runner_v2 improvements may have resolved the issue: - vllm-project#7110: Added aclgraph support - vllm-project#7496: Optimized post_update performance - vllm-project#7221: Optimized _topk_log_softmax_kernel performance - CI will verify if test now passes successfully Signed-off-by: hejianping <hejianping7@huawei.com>
- Remove is_skipped flag from tests/e2e/singlecard/model_runner_v2/test_basic.py - Test was originally skipped due to get_cuda_view_from_cpu_tensor error (vllm-project#5752) - Recent model_runner_v2 improvements may have resolved the issue: - vllm-project#7110: Added aclgraph support - vllm-project#7496: Optimized post_update performance - vllm-project#7221: Optimized _topk_log_softmax_kernel performance - CI will verify if the test now passes successfully Signed-off-by: hejianping <hejianping7@huawei.com>
…roject#7496) ### What this PR does / why we need it? - This PR aims to enhance the operator performance in the `post_update` phase of `model_runner_v2` on NPUs. By optimizing the relevant operations, it is expected to improve the overall efficiency and speed of the model running on NPU hardware, which is crucial for scenarios where high-performance inference is required. - when bs = 256, time cost reduce from 26us to 11 us; ### Does this PR introduce _any_ user-facing change? No, there are no changes to the API, interface, or other high-level behaviors that would directly affect the user's code or interaction with the system beyond the performance improvement. ### How was this patch tested? CI passed with new added/existing tests. In addition to the regular CI tests, specific benchmark tests were conducted on NPU hardware to measure the performance improvement of the `post_update` operators. --------- Signed-off-by: weijinqian_v1 <weijinqian@huawei.com> Co-authored-by: weijinqian_v1 <weijinqian@huawei.com>
…roject#7496) ### What this PR does / why we need it? - This PR aims to enhance the operator performance in the `post_update` phase of `model_runner_v2` on NPUs. By optimizing the relevant operations, it is expected to improve the overall efficiency and speed of the model running on NPU hardware, which is crucial for scenarios where high-performance inference is required. - when bs = 256, time cost reduce from 26us to 11 us; ### Does this PR introduce _any_ user-facing change? No, there are no changes to the API, interface, or other high-level behaviors that would directly affect the user's code or interaction with the system beyond the performance improvement. ### How was this patch tested? CI passed with new added/existing tests. In addition to the regular CI tests, specific benchmark tests were conducted on NPU hardware to measure the performance improvement of the `post_update` operators. --------- Signed-off-by: weijinqian_v1 <weijinqian@huawei.com> Co-authored-by: weijinqian_v1 <weijinqian@huawei.com>
What this PR does / why we need it?
post_updatephase ofmodel_runner_v2on NPUs. By optimizing the relevant operations, it is expected to improve the overall efficiency and speed of the model running on NPU hardware, which is crucial for scenarios where high-performance inference is required.Does this PR introduce any user-facing change?
No, there are no changes to the API, interface, or other high-level behaviors that would directly affect the user's code or interaction with the system beyond the performance improvement.
How was this patch tested?
CI passed with new added/existing tests. In addition to the regular CI tests, specific benchmark tests were conducted on NPU hardware to measure the performance improvement of the
post_updateoperators.