Skip to content

Conversation

@ForBetterCodeNine
Copy link
Contributor

@ForBetterCodeNine ForBetterCodeNine commented Nov 11, 2025

What this PR does / why we need it?

Currently, the UT tests lack coverage for the Qwen3_moe network and torchair_sfa. Therefore, supplementary tests are being added.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Signed-off-by: CodeNine-CJ <[email protected]>
@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:‌‌

  • A PR should do only one thing, smaller PRs enable faster reviews.
  • Every PR should include unit tests and end-to-end tests ‌to ensure it works and is not broken by other future PRs.
  • Write the commit message by fulfilling the PR description to help reviewer and future developers understand.

If CI fails, you can run linting and testing checks locally according Contributing and Testing.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds unit tests for Qwen3_moe and torchair_sfa, which is a valuable contribution to improving test coverage. My review has identified a couple of areas for improvement. The test for CustomSparseMoeBlock is currently very basic and should be expanded to cover the forward method's logic. Additionally, a typo in the test setup for AscendSFATorchairImpl could lead to incorrect test behavior and needs to be corrected. Please see the detailed comments for suggestions.

Comment on lines +59 to +61
def test_init(self, mocker: MockerFixture, setup_csmb):
custom_moe_block = setup_csmb
assert isinstance(custom_moe_block, CustomSparseMoeBlock)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The test coverage for CustomSparseMoeBlock is insufficient. The current test only verifies that the class can be instantiated, but it does not test the forward method, which contains the core logic. To ensure the correctness of the implementation, please add unit tests for the forward method. These tests should cover different execution paths, such as prefill and decode phases.

def setUp(self, ascend_config, vllm_config, mock_get_tp_size, mock_tp):
mock_tp.world_size = 2
ascend_config.torchair_graph_config.enabled = True
ascend_config.torchari_graph_config.enable_kv_nz = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

There is a typo in the attribute name. It should be torchair_graph_config instead of torchari_graph_config. This typo causes the enable_kv_nz configuration to not be set correctly on the mock object, potentially leading to incorrect test behavior as the code under test reads from ascend_config.torchair_graph_config.enable_kv_nz.

Suggested change
ascend_config.torchari_graph_config.enable_kv_nz = False
ascend_config.torchair_graph_config.enable_kv_nz = False

Signed-off-by: CodeNine-CJ <[email protected]>
Signed-off-by: CodeNine-CJ <[email protected]>
Signed-off-by: CodeNine-CJ <[email protected]>
Signed-off-by: CodeNine-CJ <[email protected]>
Signed-off-by: CodeNine-CJ <[email protected]>
Signed-off-by: CodeNine-CJ <[email protected]>
Signed-off-by: CodeNine-CJ <[email protected]>
Signed-off-by: CodeNine-CJ <[email protected]>
@wangxiyuan wangxiyuan merged commit 49818db into vllm-project:main Nov 13, 2025
18 checks passed
luolun pushed a commit to luolun/vllm-ascend that referenced this pull request Nov 19, 2025
### What this PR does / why we need it?
Currently, the UT tests lack coverage for the Qwen3_moe network and
torchair_sfa. Therefore, supplementary tests are being added.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
by CI

- vLLM version: v0.11.0
- vLLM main:
vllm-project/vllm@83f478b

---------

Signed-off-by: CodeNine-CJ <[email protected]>
Signed-off-by: luolun <[email protected]>
hwhaokun pushed a commit to hwhaokun/vllm-ascend that referenced this pull request Nov 19, 2025
### What this PR does / why we need it?
Currently, the UT tests lack coverage for the Qwen3_moe network and
torchair_sfa. Therefore, supplementary tests are being added.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
by CI

- vLLM version: v0.11.0
- vLLM main:
vllm-project/vllm@83f478b

---------

Signed-off-by: CodeNine-CJ <[email protected]>
Signed-off-by: hwhaokun <[email protected]>
NSDie pushed a commit to NSDie/vllm-ascend that referenced this pull request Nov 24, 2025
### What this PR does / why we need it?
Currently, the UT tests lack coverage for the Qwen3_moe network and
torchair_sfa. Therefore, supplementary tests are being added.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
by CI

- vLLM version: v0.11.0
- vLLM main:
vllm-project/vllm@83f478b

---------

Signed-off-by: CodeNine-CJ <[email protected]>
Signed-off-by: nsdie <[email protected]>
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