Skip to content

Conversation

@haojiangzheng
Copy link
Contributor

@haojiangzheng haojiangzheng commented Jul 14, 2025

What this PR does / why we need it?

chunkprefill mla only support eager mode now,we want to optimaze it by support torchair graph, the idea is simpler, when all the request is running in decode, use torchair graph to deal with it, else when chunkprefill or prefill only, use the eager mode

Does this PR introduce any user-facing change?

we can start the serve with chunkprefill mla torchair graph like this:

export VLLM_USE_V1=1
export VLLM_VERSION=0.9.0
python -m vllm.entrypoints.openai.api_server --model=DeepSeek-R1-W8A8-VLLM
--quantization ascend
--trust-remote-code
--distributed-executor-backend=mp
--port 8006
-tp=8
-dp=2
--max-num-seqs 24
--max-model-len 32768
--max-num-batched-tokens 8192
--block-size 128
--additional-config '{"torchair_graph_config":{"enabled":true,"use_cached_graph":true,"graph_batch_sizes":[24]},"expert_tensor_parallel_size":16}'
--gpu-memory-utilization 0.96

How was this patch tested?

@ApsarasX
Copy link
Collaborator

Missing the fix code for ChunkPrefill OOM

@haojiangzheng
Copy link
Contributor Author

Missing the fix code for ChunkPrefill OOM

fixed

@haojiangzheng haojiangzheng force-pushed the main branch 7 times, most recently from 68474e4 to 1c68685 Compare July 22, 2025 06:52
@codecov
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

❌ Patch coverage is 14.28571% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.22%. Comparing base (1ab1541) to head (3863246).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
vllm_ascend/attention/mla_v1.py 7.69% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1772      +/-   ##
==========================================
- Coverage   76.31%   76.22%   -0.09%     
==========================================
  Files         116      117       +1     
  Lines       13238    13273      +35     
==========================================
+ Hits        10102    10117      +15     
- Misses       3136     3156      +20     
Flag Coverage Δ
unittests 76.22% <14.28%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@haojiangzheng haojiangzheng force-pushed the main branch 2 times, most recently from 1c68685 to 0666d8f Compare July 22, 2025 08:39
@ApsarasX ApsarasX added the ready read for review label Jul 24, 2025
@github-actions github-actions bot added merge-conflicts and removed ready read for review labels Jul 26, 2025
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@haojiangzheng haojiangzheng reopened this Jul 30, 2025
@haojiangzheng haojiangzheng changed the title chunkprefill mla support torchair graph [Feat] chunkprefill mla support torchair graph Jul 31, 2025
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link

github-actions bot commented Aug 6, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Signed-off-by: haojiangzheng <justineric096@gmail.com>
@jianzs jianzs merged commit eb43a47 into vllm-project:main Aug 11, 2025
25 checks passed
Csrayz added a commit to Csrayz/vllm-ascend that referenced this pull request Aug 13, 2025
* enable mm allreduce test (vllm-project#2192)

### What this PR does / why we need it?
This PR is to add e2e test for using npu_mm_all_reduce_base fusion
kernel.
### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?
not involved

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@5d5d419

Signed-off-by: Ronald1995 <ronaldautomobile@163.com>

* [main] remove torch.cat and replace it by List[0] (vllm-project#2153)

### What this PR does / why we need it?
torch_npu.npu_grouped_matmul:

https://www.hiascend.com/document/detail/zh/Pytorch/710/apiref/torchnpuCustomsapi/context/torch_npu-npu_grouped_matmul.md

According to the document, when `split_item` is 2 or 3,
`torch_npu.npu_grouped_matmul` will return a list which has one element.
Therefore, the `torch.cat` after `torch_npu.npu_grouped_matmul` is
unnecessary.

### Does this PR introduce _any_ user-facing change?
not involved

### How was this patch tested?
ut and e2e covered: `tests/ut/ops/test_fused_ops.py`,
`tests/e2e/singlecard/ops/test_fused_moe.py`

**performance**:
(qwen3 30B, 2k->20k)

base:
Total Token throughput (tok/s):          667.76 

remove cat:
Total Token throughput (tok/s):          680.82 


- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@fa00c5d

Signed-off-by: huangxialu <huangxialu1@huawei.com>

* [CI][Quickfix] Fix AscendFusedMoE init error (vllm-project#2268)

### What this PR does / why we need it?
Fix AscendFusedMoE init error. Use `super().__init__()` instead of
`super(FusedMoE, self).__init__()` to ensure the member variables in
base class could be called by the children class

### Does this PR introduce _any_ user-facing change?
N/A
### How was this patch tested?
CI passed with new existing test.


- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@766bc81

---------

Signed-off-by: MengqingCao <cmq0113@163.com>

* Fix accuracy test config and add DeepSeek-V2-Lite test (vllm-project#2261)

### What this PR does / why we need it?
This PR fix accuracy test related to
vllm-project#2073, users can now
perform accuracy tests on multiple models simultaneously and generate
different report files by running:

```bash
cd ~/vllm-ascend
pytest -sv ./tests/e2e/models/test_lm_eval_correctness.py \
          --config-list-file ./tests/e2e/models/configs/accuracy.txt
```

### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?
<img width="1648" height="511" alt="image"
src="https://github.com/user-attachments/assets/1757e3b8-a6b7-44e5-b701-80940dc756cd"
/>


- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@766bc81

---------

Signed-off-by: Icey <1790571317@qq.com>

* Fix accuracy test create PR (vllm-project#2274)

### What this PR does / why we need it?

Fix create PR of accuracy test 

### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?
Local testing: nv-action/vllm-benchmarks#87

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@099c046

---------

Signed-off-by: Icey <1790571317@qq.com>

* Add ut for test_communicator.py (vllm-project#2293)

### What this PR does / why we need it?

Add ut for test_communicator.py 

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@e5ebeeb

Signed-off-by: yangqinghao-cmss <yangqinghao_yewu@cmss.chinamobile.com>

* [CI] Fix broken CI (vllm-project#2302)

1. disable test_eagle_ccorrectness test, we'll reopen it once oom error
fixed.
2. drop transformers version limit for main, since vLLM rely on
>=4.55.0, see:
vllm-project/vllm@65552b4
3. fix kv_connector_output bug, see:
vllm-project/vllm@796bae0

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@d1af8b7

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>

* [2/N][Refactor] torchair model runner refactor (vllm-project#2204)

There is lot of torchair code in model runner leading the code hard for
maintenance. We'll create new torchair_model_runner to split torchair
related logic. Following the workflow vllm-project#2203

What's this PR do:

move `torchair` related logic into `_get_forward_metadata_across_dp` and
override it in torchair model runner


- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@1b99028

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>

* [core] Support capture custom ops into aclgraph (vllm-project#2113)

### What this PR does / why we need it?
Thanks to the PR vllm-project#426
make vllm-ascend support the aclgraph inference to reduce the host
overhead. However, the capability of aclgraph strongly relies on the
functionality provided by `torch.compile`, which is the key feature
supported in torch 2.x . Therefore, capture custom op into aclgraph is
only possible when it can be recognize and captured by `torch.compile`.

In this PR, we register the meta implementation of current custom ops to
enable the fx graph capture. And by doing that, insert those custom ops
into aclgraph become a natural thing to the ascend runtime.

### Does this PR introduce _any_ user-facing change?
No user face change.

### How was this patch tested?
Tested in unittest, we will integrate the `rotary_embedding` op into a
small custom model and use `torch.compile` and aclgraph to capture and
replay it to verify its functionality.

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@1b99028

---------

Signed-off-by: ganyi <pleaplusone.gy@gmail.com>

* Bump actions/download-artifact from 4 to 5 (vllm-project#2311)

Bumps
[actions/download-artifact](https://github.com/actions/download-artifact)
from 4 to 5.

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@ebf7605

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [Perf][MTP] Optimize reject sampler in greedy situation. (vllm-project#2137)

This PR port optimization in PR vllm-project#2002 to main and makes it cleaner.

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@afa5b7c

---------

Signed-off-by: whx-sjtu <2952154980@qq.com>

* [3/N][Refactor] torchair model runner refactor  (vllm-project#2207)

There is lot of torchair code in model runner leading the code hard for
maintenance. We'll create new torchair_model_runner to split torchair
related logic. Following the workflow vllm-project#2203, this is the first PR.

What's this PR do:

create common function `_build_attention_metadata` and
`_generate_dummy_run_hidden_states` for dummy_run

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@ebf7605

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>

* [Feat] chunkprefill mla support torchair graph (vllm-project#1772)

chunkprefill mla only support eager mode now,we want to optimaze it by
support torchair graph, the idea is simple, when all the request is
running in decode, use torchair graph to deal with it, else when
chunkprefill or prefill only, use the eager mode

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@ebf7605

Signed-off-by: haojiangzheng <justineric096@gmail.com>
Co-authored-by: haojiangzheng <justineric096@gmail.com>

* [4/N][Refactor] torchair model runner refactor (vllm-project#2208)

There is lot of torchair code in model runner leading the code hard for
maintenance. We'll create new torchair_model_runner to split torchair
related logic. Following the workflow vllm-project#2203, this is the first PR.

What's this PR do:

create common function `_convert_torch_foramt`  for initialize_kv_cache


- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@14a5d90

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>

* Configure Gemini (vllm-project#2298)

### What this PR does / why we need it?
This PR requests Gemini AI to review PRs.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
NA

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@14a5d90

Signed-off-by: QwertyJack <7554089+QwertyJack@users.noreply.github.com>

* ut: add ci guard for ut coverage (vllm-project#2317)

### What this PR does / why we need it?
add ci guard for ut coverage, if ut coverage of patch pr is below 80%,
the ci will failed/

### Does this PR introduce _any_ user-facing change?
not involved

### How was this patch tested?
not involved

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@458e74e

---------

Signed-off-by: Ronald1995 <ronaldautomobile@163.com>

* [main][prefill optimization] Optimize parallel strategies to reduce communication overhead (vllm-project#2198)

### What this PR does / why we need it?
1.Shared Expert Sharding Strategy Update: Switched from TP-aligned to
pure DP for shared experts, enabling more efficient execution.
2.O_Proj AllReduce → ReduceScatter: Reduced communication overhead by
using ReduceScatter, made possible by pure DP sharding.
3.AllGather Postponed: Delayed to after QKV down projection to reduce
synchronization impact during prefill.

### How was this patch tested?
Adding ut case in `tests/ut/attention/test_mla_v1.py`

#### How to run

use parameter `--additional_config='{"enable_shared_expert_dp": true}'`

##### a.How to run eager mode

eg:
python -m vllm.entrypoints.openai.api_server --model=/model_path
--trust-remote-code -tp 8 -dp 2 --enable_expert_parallel --port 8002
--max-model-len 5120 --max-num-batched-tokens 16384 --enforce-eager
--disable-log-requests
--additional_config='{"ascend_scheduler_config":{"enabled":true},"enable_shared_expert_dp":
true,"chunked_prefill_for_mla":true}'

##### b.How to run graph mode

eg:
python -m vllm.entrypoints.openai.api_server --model=/model_path
--trust-remote-code -tp 8 -dp 2 --enable_expert_parallel --port 8002
--max-model-len 5120 --max-num-batched-tokens 16384
--disable-log-requests
--additional_config='{"ascend_scheduler_config":{"enabled":true},"enable_shared_expert_dp":
true,"chunked_prefill_for_mla":true,"torchair_graph_config":{"enabled":true}}'


- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@9edd1db

---------

Signed-off-by: Wang Kunpeng <1289706727@qq.com>
Signed-off-by: SlightwindSec <slightwindsec@gmail.com>
Co-authored-by: SlightwindSec <slightwindsec@gmail.com>

* [Doc] Update faq (vllm-project#2334)

### What this PR does / why we need it?
  - update determinitic calculation
  - update support device

### Does this PR introduce _any_ user-facing change?
- Users should update ray and protobuf when using ray as distributed
backend
- Users should change to use `export HCCL_DETERMINISTIC=true` when
enabling determinitic calculation

### How was this patch tested?
N/A

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@ea1292a

Signed-off-by: MengqingCao <cmq0113@163.com>

* [5/N][Refactor] torchair model runner refactor (vllm-project#2216)

There is lot of torchair code in model runner leading the code hard for
maintenance. We'll create new torchair_model_runner to split torchair
related logic. Following the workflow vllm-project#2203

What's this PR do:

create common function `_capture_model` for capture_model

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@1891a26

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>

* [1/N][Feat] Support MoE models with ACL Graph and refactor MoE communication logic (vllm-project#2125)

### What this PR does / why we need it?
This PR refactors the MoE (Mixture of Experts) communication logic by
introducing a strategy pattern. It defines an abstract base class,
`MoECommMethod`, which encapsulates different communication strategies
for MoE layers. By decoupling the MoE implementation from any single
communication method, this change makes it simpler to add, replace, or
optimize communication strategies in the future.

Plan / Roadmap

1. Introduce `MoECommMethod`, implement `AllGatherImpl`, and adapt ACL
Graph handling to cover all scenarios (this PR).
2. Implement `MC2CommImpl` and `AllToAllCommImpl` to optimize
performance in specific scenarios.
3. Enable W8A8 / Int8 models to use `unified_fused_experts`.

Other notes

* Data-parallel (DP) communication currently does not work with vLLM's
dispatch/combine mechanisms; an alternative approach is required to
resolve this incompatibility.

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@f7ad6a1

---------

Signed-off-by: Yizhou Liu <liu_yizhou@outlook.com>

* [Doc] Add container image save/load FAQ for offline environments (vllm-project#2347)

### What this PR does / why we need it?

Add Docker export/import guide for air-gapped environments

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?

NA

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@d16aa3d

Signed-off-by: QwertyJack <7554089+QwertyJack@users.noreply.github.com>

* [Bugfix] fix the oom when chunkprefill with long context like 64k (vllm-project#2319)

The attn mask was declared in the mla.py,we don't need the splitfuse
mask when mla chunkprefill, and this mask will cause memory problem when
long context like 64k or 128k

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@14a5d90

---------

Signed-off-by: haojiangzheng <justineric096@gmail.com>

---------

Signed-off-by: Ronald1995 <ronaldautomobile@163.com>
Signed-off-by: huangxialu <huangxialu1@huawei.com>
Signed-off-by: MengqingCao <cmq0113@163.com>
Signed-off-by: Icey <1790571317@qq.com>
Signed-off-by: yangqinghao-cmss <yangqinghao_yewu@cmss.chinamobile.com>
Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
Signed-off-by: ganyi <pleaplusone.gy@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: whx-sjtu <2952154980@qq.com>
Signed-off-by: haojiangzheng <justineric096@gmail.com>
Signed-off-by: QwertyJack <7554089+QwertyJack@users.noreply.github.com>
Signed-off-by: Wang Kunpeng <1289706727@qq.com>
Signed-off-by: SlightwindSec <slightwindsec@gmail.com>
Signed-off-by: Yizhou Liu <liu_yizhou@outlook.com>
Co-authored-by: Ronald1995 <ronaldautomobile@163.com>
Co-authored-by: huangxialu <huangxialu1@huawei.com>
Co-authored-by: Mengqing Cao <cmq0113@163.com>
Co-authored-by: Icey <1790571317@qq.com>
Co-authored-by: yangqinghao-cmss <yangqinghao_yewu@cmss.chinamobile.com>
Co-authored-by: wangxiyuan <wangxiyuan1007@gmail.com>
Co-authored-by: Pleaplusone <pleaplusone.gy@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: whx <56632993+whx-sjtu@users.noreply.github.com>
Co-authored-by: zhenghaojiang <zhjoneson@163.com>
Co-authored-by: haojiangzheng <justineric096@gmail.com>
Co-authored-by: jack <QwertyJack@users.noreply.github.com>
Co-authored-by: Wang Kunpeng <1289706727@qq.com>
Co-authored-by: SlightwindSec <slightwindsec@gmail.com>
Co-authored-by: yiz-liu <136800916+yiz-liu@users.noreply.github.com>
chopper0126 pushed a commit to chopper0126/vllm-ascend that referenced this pull request Sep 26, 2025
chunkprefill mla only support eager mode now,we want to optimaze it by
support torchair graph, the idea is simple, when all the request is
running in decode, use torchair graph to deal with it, else when
chunkprefill or prefill only, use the eager mode

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@ebf7605

Signed-off-by: haojiangzheng <justineric096@gmail.com>
Co-authored-by: haojiangzheng <justineric096@gmail.com>
Angazenn pushed a commit to Angazenn/vllm-ascend that referenced this pull request Oct 21, 2025
chunkprefill mla only support eager mode now,we want to optimaze it by
support torchair graph, the idea is simple, when all the request is
running in decode, use torchair graph to deal with it, else when
chunkprefill or prefill only, use the eager mode

- vLLM version: v0.10.0
- vLLM main:
vllm-project/vllm@ebf7605

Signed-off-by: haojiangzheng <justineric096@gmail.com>
Co-authored-by: haojiangzheng <justineric096@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants