-
Notifications
You must be signed in to change notification settings - Fork 494
[1/N][Feat] Implement primal full graph with limited scenario #1503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ganyi1996ppo
merged 12 commits into
vllm-project:v0.9.1-dev
from
yiz-liu:feat-full-graph
Jul 7, 2025
Merged
[1/N][Feat] Implement primal full graph with limited scenario #1503
ganyi1996ppo
merged 12 commits into
vllm-project:v0.9.1-dev
from
yiz-liu:feat-full-graph
Jul 7, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34e1ac7
to
45d59fd
Compare
5987715
to
ffdb493
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Should this part also be changed when full graph is enabled? Does it still need to divide by vllm-ascend/vllm_ascend/utils.py Lines 316 to 317 in c58accc
|
yiz-liu
commented
Jul 7, 2025
Signed-off-by: Yizhou Liu <[email protected]>
Signed-off-by: Yizhou Liu <[email protected]>
Signed-off-by: Yizhou Liu <[email protected]>
Signed-off-by: Yizhou Liu <[email protected]>
Signed-off-by: Yizhou Liu <[email protected]>
Signed-off-by: Yizhou Liu <[email protected]>
…izes Signed-off-by: Yizhou Liu <[email protected]>
Signed-off-by: Yizhou Liu <[email protected]>
… common metadata Signed-off-by: Yizhou Liu <[email protected]>
Signed-off-by: Yizhou Liu <[email protected]>
…ature both enabled and disabled Signed-off-by: Yizhou Liu <[email protected]>
… mode Signed-off-by: Yizhou Liu <[email protected]>
ganyi1996ppo
approved these changes
Jul 7, 2025
yiz-liu
added a commit
to yiz-liu/vllm-ascend
that referenced
this pull request
Jul 31, 2025
…t#1503) This pull request introduces full-graph capture, replacing the previous piecewise-graph approach. Key improvements include: * **Reduced dispatch latency:** By capturing the entire model execution graph at once, we minimize overhead compared to multiple smaller captures. * **Stabilized multi-GPU performance:** Eliminates throughput fluctuations during the `MODEL_EXECUTE` phase across multiple cards. * **Stream resource savings:** Consolidating graph captures frees up streams, allowing more graphs to be captured concurrently. **Known issues:** 1. Capturing larger or more numerous graphs increases GPU memory usage, which can lead to OOM errors or inference hangs. 2. The new paged-attention implementation relies on the FIA operator, which in certain workloads is slower than the previous approach—resulting in a regression in end-to-end throughput. There may be other undiscovered corner cases. This PR is the first in a planned series; we will continue to iterate on and address any remaining issues in subsequent submissions. ```python compilation_config={ "full_cuda_graph": True, }, ``` --------- Signed-off-by: Yizhou Liu <[email protected]>
yiz-liu
added a commit
to yiz-liu/vllm-ascend
that referenced
this pull request
Aug 1, 2025
…t#1503) This pull request introduces full-graph capture, replacing the previous piecewise-graph approach. Key improvements include: * **Reduced dispatch latency:** By capturing the entire model execution graph at once, we minimize overhead compared to multiple smaller captures. * **Stabilized multi-GPU performance:** Eliminates throughput fluctuations during the `MODEL_EXECUTE` phase across multiple cards. * **Stream resource savings:** Consolidating graph captures frees up streams, allowing more graphs to be captured concurrently. **Known issues:** 1. Capturing larger or more numerous graphs increases GPU memory usage, which can lead to OOM errors or inference hangs. 2. The new paged-attention implementation relies on the FIA operator, which in certain workloads is slower than the previous approach—resulting in a regression in end-to-end throughput. There may be other undiscovered corner cases. This PR is the first in a planned series; we will continue to iterate on and address any remaining issues in subsequent submissions. ```python compilation_config={ "full_cuda_graph": True, }, ``` --------- Signed-off-by: Yizhou Liu <[email protected]>
yiz-liu
added a commit
to yiz-liu/vllm-ascend
that referenced
this pull request
Aug 11, 2025
…t#1503) This pull request introduces full-graph capture, replacing the previous piecewise-graph approach. Key improvements include: * **Reduced dispatch latency:** By capturing the entire model execution graph at once, we minimize overhead compared to multiple smaller captures. * **Stabilized multi-GPU performance:** Eliminates throughput fluctuations during the `MODEL_EXECUTE` phase across multiple cards. * **Stream resource savings:** Consolidating graph captures frees up streams, allowing more graphs to be captured concurrently. **Known issues:** 1. Capturing larger or more numerous graphs increases GPU memory usage, which can lead to OOM errors or inference hangs. 2. The new paged-attention implementation relies on the FIA operator, which in certain workloads is slower than the previous approach—resulting in a regression in end-to-end throughput. There may be other undiscovered corner cases. This PR is the first in a planned series; we will continue to iterate on and address any remaining issues in subsequent submissions. ```python compilation_config={ "full_cuda_graph": True, }, ``` --------- Signed-off-by: Yizhou Liu <[email protected]>
yiz-liu
added a commit
to yiz-liu/vllm-ascend
that referenced
this pull request
Aug 11, 2025
…t#1503) This pull request introduces full-graph capture, replacing the previous piecewise-graph approach. Key improvements include: * **Reduced dispatch latency:** By capturing the entire model execution graph at once, we minimize overhead compared to multiple smaller captures. * **Stabilized multi-GPU performance:** Eliminates throughput fluctuations during the `MODEL_EXECUTE` phase across multiple cards. * **Stream resource savings:** Consolidating graph captures frees up streams, allowing more graphs to be captured concurrently. **Known issues:** 1. Capturing larger or more numerous graphs increases GPU memory usage, which can lead to OOM errors or inference hangs. 2. The new paged-attention implementation relies on the FIA operator, which in certain workloads is slower than the previous approach—resulting in a regression in end-to-end throughput. There may be other undiscovered corner cases. This PR is the first in a planned series; we will continue to iterate on and address any remaining issues in subsequent submissions. ```python compilation_config={ "full_cuda_graph": True, }, ``` --------- Signed-off-by: Yizhou Liu <[email protected]>
yiz-liu
added a commit
to yiz-liu/vllm-ascend
that referenced
this pull request
Aug 12, 2025
…t#1503) This pull request introduces full-graph capture, replacing the previous piecewise-graph approach. Key improvements include: * **Reduced dispatch latency:** By capturing the entire model execution graph at once, we minimize overhead compared to multiple smaller captures. * **Stabilized multi-GPU performance:** Eliminates throughput fluctuations during the `MODEL_EXECUTE` phase across multiple cards. * **Stream resource savings:** Consolidating graph captures frees up streams, allowing more graphs to be captured concurrently. **Known issues:** 1. Capturing larger or more numerous graphs increases GPU memory usage, which can lead to OOM errors or inference hangs. 2. The new paged-attention implementation relies on the FIA operator, which in certain workloads is slower than the previous approach—resulting in a regression in end-to-end throughput. There may be other undiscovered corner cases. This PR is the first in a planned series; we will continue to iterate on and address any remaining issues in subsequent submissions. ```python compilation_config={ "full_cuda_graph": True, }, ``` --------- Signed-off-by: Yizhou Liu <[email protected]>
yiz-liu
added a commit
to yiz-liu/vllm-ascend
that referenced
this pull request
Aug 12, 2025
…t#1503) This pull request introduces full-graph capture, replacing the previous piecewise-graph approach. Key improvements include: * **Reduced dispatch latency:** By capturing the entire model execution graph at once, we minimize overhead compared to multiple smaller captures. * **Stabilized multi-GPU performance:** Eliminates throughput fluctuations during the `MODEL_EXECUTE` phase across multiple cards. * **Stream resource savings:** Consolidating graph captures frees up streams, allowing more graphs to be captured concurrently. **Known issues:** 1. Capturing larger or more numerous graphs increases GPU memory usage, which can lead to OOM errors or inference hangs. 2. The new paged-attention implementation relies on the FIA operator, which in certain workloads is slower than the previous approach—resulting in a regression in end-to-end throughput. There may be other undiscovered corner cases. This PR is the first in a planned series; we will continue to iterate on and address any remaining issues in subsequent submissions. ```python compilation_config={ "full_cuda_graph": True, }, ``` --------- Signed-off-by: Yizhou Liu <[email protected]>
yiz-liu
added a commit
to yiz-liu/vllm-ascend
that referenced
this pull request
Aug 13, 2025
…t#1503) This pull request introduces full-graph capture, replacing the previous piecewise-graph approach. Key improvements include: * **Reduced dispatch latency:** By capturing the entire model execution graph at once, we minimize overhead compared to multiple smaller captures. * **Stabilized multi-GPU performance:** Eliminates throughput fluctuations during the `MODEL_EXECUTE` phase across multiple cards. * **Stream resource savings:** Consolidating graph captures frees up streams, allowing more graphs to be captured concurrently. **Known issues:** 1. Capturing larger or more numerous graphs increases GPU memory usage, which can lead to OOM errors or inference hangs. 2. The new paged-attention implementation relies on the FIA operator, which in certain workloads is slower than the previous approach—resulting in a regression in end-to-end throughput. There may be other undiscovered corner cases. This PR is the first in a planned series; we will continue to iterate on and address any remaining issues in subsequent submissions. ```python compilation_config={ "full_cuda_graph": True, }, ``` --------- Signed-off-by: Yizhou Liu <[email protected]>
yiz-liu
added a commit
to yiz-liu/vllm-ascend
that referenced
this pull request
Aug 15, 2025
…t#1503) This pull request introduces full-graph capture, replacing the previous piecewise-graph approach. Key improvements include: * **Reduced dispatch latency:** By capturing the entire model execution graph at once, we minimize overhead compared to multiple smaller captures. * **Stabilized multi-GPU performance:** Eliminates throughput fluctuations during the `MODEL_EXECUTE` phase across multiple cards. * **Stream resource savings:** Consolidating graph captures frees up streams, allowing more graphs to be captured concurrently. **Known issues:** 1. Capturing larger or more numerous graphs increases GPU memory usage, which can lead to OOM errors or inference hangs. 2. The new paged-attention implementation relies on the FIA operator, which in certain workloads is slower than the previous approach—resulting in a regression in end-to-end throughput. There may be other undiscovered corner cases. This PR is the first in a planned series; we will continue to iterate on and address any remaining issues in subsequent submissions. ```python compilation_config={ "full_cuda_graph": True, }, ``` --------- Signed-off-by: Yizhou Liu <[email protected]>
yiz-liu
added a commit
to yiz-liu/vllm-ascend
that referenced
this pull request
Sep 17, 2025
…th the latest design Revert "[Feat] Implement primal full graph with limited scenario (vllm-project#1503)" This reverts commit 14660be. Signed-off-by: Yizhou Liu <[email protected]>
wangxiyuan
pushed a commit
that referenced
this pull request
Sep 22, 2025
Note: This depends on [vLLM #25161](vllm-project/vllm#25161) and the torch\_npu release from September 30. ### What this PR does / why we need it? This pull request adds `FULL_DECODE_ONLY` mode for GQA/MHA models (MLA models like DeepSeek V3/R1 are not included). Key improvements include: * **Reduced dispatch latency:** By replaying the entire model execution graph at once, we cut overhead compared with multiple smaller replays. * **Stabilized multi-device performance:** Captureing the whole model as one static graph also mitigates the dispatch fluctuations across devices. * **Stream/resource savings:** Consolidating graph captures frees up streams, allowing more graphs to be captured. **Known issues:** 1. `_npu_paged_attention` currently manages its own workspace in `torch_npu`, which can deadlock when synchronizing during graph replay — we’re working on a fix. There may be other corner cases. This PR is the first in a planned series; we’ll continue to iterate and address remaining issues in follow-ups. This is essentially a port of #1503 and #1677, but includes two major changes: 1. Let `graph_dispatcher` decide the graph mode instead of hard-coding it in the backend, which decouples Full Graph and Piecewise Graph and could make it possible to remove dynamo. 2. Adapt to the new `attn_group` logic, but leave a small hack in `update_graph_params`; multi-attention models may or may not be fully supported yet. ### Does this PR introduce _any_ user-facing change? ```python compilation_config={ "cudagraph_mode": "FULL_DECODE_ONLY", }, ``` ### How was this patch tested? Tests included. - vLLM version: v0.10.2 - vLLM main: vllm-project/vllm@9607d5e --------- Signed-off-by: Yizhou Liu <[email protected]>
Mercykid-bash
pushed a commit
to Mercykid-bash/vllm-ascend
that referenced
this pull request
Sep 22, 2025
…m-project#2128) Note: This depends on [vLLM #25161](vllm-project/vllm#25161) and the torch\_npu release from September 30. ### What this PR does / why we need it? This pull request adds `FULL_DECODE_ONLY` mode for GQA/MHA models (MLA models like DeepSeek V3/R1 are not included). Key improvements include: * **Reduced dispatch latency:** By replaying the entire model execution graph at once, we cut overhead compared with multiple smaller replays. * **Stabilized multi-device performance:** Captureing the whole model as one static graph also mitigates the dispatch fluctuations across devices. * **Stream/resource savings:** Consolidating graph captures frees up streams, allowing more graphs to be captured. **Known issues:** 1. `_npu_paged_attention` currently manages its own workspace in `torch_npu`, which can deadlock when synchronizing during graph replay — we’re working on a fix. There may be other corner cases. This PR is the first in a planned series; we’ll continue to iterate and address remaining issues in follow-ups. This is essentially a port of vllm-project#1503 and vllm-project#1677, but includes two major changes: 1. Let `graph_dispatcher` decide the graph mode instead of hard-coding it in the backend, which decouples Full Graph and Piecewise Graph and could make it possible to remove dynamo. 2. Adapt to the new `attn_group` logic, but leave a small hack in `update_graph_params`; multi-attention models may or may not be fully supported yet. ### Does this PR introduce _any_ user-facing change? ```python compilation_config={ "cudagraph_mode": "FULL_DECODE_ONLY", }, ``` ### How was this patch tested? Tests included. - vLLM version: v0.10.2 - vLLM main: vllm-project/vllm@9607d5e --------- Signed-off-by: Yizhou Liu <[email protected]> Signed-off-by: Che Ruan <[email protected]>
Mercykid-bash
pushed a commit
to Mercykid-bash/vllm-ascend
that referenced
this pull request
Sep 22, 2025
…m-project#2128) Note: This depends on [vLLM #25161](vllm-project/vllm#25161) and the torch\_npu release from September 30. ### What this PR does / why we need it? This pull request adds `FULL_DECODE_ONLY` mode for GQA/MHA models (MLA models like DeepSeek V3/R1 are not included). Key improvements include: * **Reduced dispatch latency:** By replaying the entire model execution graph at once, we cut overhead compared with multiple smaller replays. * **Stabilized multi-device performance:** Captureing the whole model as one static graph also mitigates the dispatch fluctuations across devices. * **Stream/resource savings:** Consolidating graph captures frees up streams, allowing more graphs to be captured. **Known issues:** 1. `_npu_paged_attention` currently manages its own workspace in `torch_npu`, which can deadlock when synchronizing during graph replay — we’re working on a fix. There may be other corner cases. This PR is the first in a planned series; we’ll continue to iterate and address remaining issues in follow-ups. This is essentially a port of vllm-project#1503 and vllm-project#1677, but includes two major changes: 1. Let `graph_dispatcher` decide the graph mode instead of hard-coding it in the backend, which decouples Full Graph and Piecewise Graph and could make it possible to remove dynamo. 2. Adapt to the new `attn_group` logic, but leave a small hack in `update_graph_params`; multi-attention models may or may not be fully supported yet. ### Does this PR introduce _any_ user-facing change? ```python compilation_config={ "cudagraph_mode": "FULL_DECODE_ONLY", }, ``` ### How was this patch tested? Tests included. - vLLM version: v0.10.2 - vLLM main: vllm-project/vllm@9607d5e --------- Signed-off-by: Yizhou Liu <[email protected]> Signed-off-by: Che Ruan <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it?
This pull request introduces full-graph capture, replacing the previous piecewise-graph approach. Key improvements include:
MODEL_EXECUTE
phase across multiple cards.Known issues:
There may be other undiscovered corner cases. This PR is the first in a planned series; we will continue to iterate on and address any remaining issues in subsequent submissions.
Does this PR introduce any user-facing change?
How was this patch tested?