- 
                Notifications
    You must be signed in to change notification settings 
- Fork 530
[0.9.1][2/N][Feat] Restore paged attention kernel in Full Graph for performence #1677
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
      
      
    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
    
  
  
    
    054b2db    to
    c40c808      
    Compare
  
    Signed-off-by: Yizhou Liu <liu_yizhou@outlook.com>
              
                    ganyi1996ppo
  
              
              approved these changes
              
                  
                    Jul 11, 2025 
                  
              
              
            
            
    
  yiz-liu 
      added a commit
        to yiz-liu/vllm-ascend
      that referenced
      this pull request
    
      Jul 31, 2025 
    
    
      
  
    
      
    
  
…erformence (vllm-project#1677) Rectified the performance regression wherein the FIA kernel underperformed the PA kernel by enabling dynamic updates of PA parameters during graph replay. Signed-off-by: Yizhou Liu <liu_yizhou@outlook.com>
    
  yiz-liu 
      added a commit
        to yiz-liu/vllm-ascend
      that referenced
      this pull request
    
      Aug 1, 2025 
    
    
      
  
    
      
    
  
…erformence (vllm-project#1677) Rectified the performance regression wherein the FIA kernel underperformed the PA kernel by enabling dynamic updates of PA parameters during graph replay. Signed-off-by: Yizhou Liu <liu_yizhou@outlook.com>
    
  yiz-liu 
      added a commit
        to yiz-liu/vllm-ascend
      that referenced
      this pull request
    
      Aug 11, 2025 
    
    
      
  
    
      
    
  
…erformence (vllm-project#1677) Rectified the performance regression wherein the FIA kernel underperformed the PA kernel by enabling dynamic updates of PA parameters during graph replay. Signed-off-by: Yizhou Liu <liu_yizhou@outlook.com>
    
  yiz-liu 
      added a commit
        to yiz-liu/vllm-ascend
      that referenced
      this pull request
    
      Aug 11, 2025 
    
    
      
  
    
      
    
  
…erformence (vllm-project#1677) Rectified the performance regression wherein the FIA kernel underperformed the PA kernel by enabling dynamic updates of PA parameters during graph replay. Signed-off-by: Yizhou Liu <liu_yizhou@outlook.com>
    
  yiz-liu 
      added a commit
        to yiz-liu/vllm-ascend
      that referenced
      this pull request
    
      Aug 12, 2025 
    
    
      
  
    
      
    
  
…erformence (vllm-project#1677) Rectified the performance regression wherein the FIA kernel underperformed the PA kernel by enabling dynamic updates of PA parameters during graph replay. Signed-off-by: Yizhou Liu <liu_yizhou@outlook.com>
    
  yiz-liu 
      added a commit
        to yiz-liu/vllm-ascend
      that referenced
      this pull request
    
      Aug 12, 2025 
    
    
      
  
    
      
    
  
…erformence (vllm-project#1677) Rectified the performance regression wherein the FIA kernel underperformed the PA kernel by enabling dynamic updates of PA parameters during graph replay. Signed-off-by: Yizhou Liu <liu_yizhou@outlook.com>
    
  yiz-liu 
      added a commit
        to yiz-liu/vllm-ascend
      that referenced
      this pull request
    
      Aug 13, 2025 
    
    
      
  
    
      
    
  
…erformence (vllm-project#1677) Rectified the performance regression wherein the FIA kernel underperformed the PA kernel by enabling dynamic updates of PA parameters during graph replay. Signed-off-by: Yizhou Liu <liu_yizhou@outlook.com>
    
  yiz-liu 
      added a commit
        to yiz-liu/vllm-ascend
      that referenced
      this pull request
    
      Aug 15, 2025 
    
    
      
  
    
      
    
  
…erformence (vllm-project#1677) Rectified the performance regression wherein the FIA kernel underperformed the PA kernel by enabling dynamic updates of PA parameters during graph replay. Signed-off-by: Yizhou Liu <liu_yizhou@outlook.com>
    
  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 <liu_yizhou@outlook.com>
    
  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 <liu_yizhou@outlook.com> Signed-off-by: Che Ruan <cr623@ic.ac.uk>
    
  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 <liu_yizhou@outlook.com> Signed-off-by: Che Ruan <cr623@ic.ac.uk>
    
  Angazenn 
      pushed a commit
        to Angazenn/vllm-ascend
      that referenced
      this pull request
    
      Oct 21, 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 <liu_yizhou@outlook.com>
  
    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?
Rectified the performance regression wherein the FIA kernel underperformed the PA kernel by enabling dynamic updates of PA parameters during graph replay.
Does this PR introduce any user-facing change?
How was this patch tested?