Repository navigation
Commit 91e6e46
authored
[Test][Misc] Align operator test names and organize single-card suites (#20064)
### What this PR does / why we need it?
Organize `singlecard_ops` by the implementation being tested: keep csrc
operator tests at the root, move local Triton suites into `triton/`, and
retain companion metadata and graph regressions with their operator.
Update test commands in the operator documentation.
Rename the following eight files in
`tests/e2e/nightly/single_node/ops/singlecard_ops/` without changing
their contents:
| Before | After |
| --- | --- |
| `test_causal_conv1d_310.py` | `test_causal_conv1d_v310.py` |
| `test_grouped_matmul_situ_quant_weight_nz.py` |
`test_grouped_matmul_situ_quant.py` |
| `test_npu_hc_pre.py` | `test_hc_pre.py` |
| `test_npu_moe_gating_top_k.py` | `test_moe_gating_top_k.py` |
| `test_npu_moe_gating_top_k_hash.py` | `test_moe_gating_top_k_hash.py`
|
| `test_quant_lightning_indexer.py` |
`test_quant_lightning_indexer_v2.py` |
| `test_recurrent_gated_delta_rule_310.py` |
`test_recurrent_gated_delta_rule_v310.py` |
| `test_sparse_flash_mla_band.py` | `test_sparse_flash_mla.py` |
Move these five files from the root into `triton/` without changing
their contents, names, assertions, parameters, or skip conditions:
| File | Collected parameter combinations |
| --- | ---: |
| `test_prepare_indexer_indices.py` | 91 |
| `test_quantize_indexer_query.py` | 45 |
| `test_kda_state_copy_triton.py` | 20 |
| `test_glm5next_state_gather_npu.py` | 7 |
| `test_kda_state_copy_integration.py` | 48 |
Merge all eight cases and their helpers from
`test_lim_mtp_index_reuse.py` into
`test_fused_scatter_copy_sparse_flash_attention.py`, retaining their
original parameters, assertions and hardware conditions. Also retain all
26 CopySFA metadata/lifecycle cases in the same operator suite. The
destination now contains 39 cases: five original, eight LIM regressions
and 26 metadata regressions. Existing A2/A3 hardware guards apply only
to the native cases, not to the restored metadata cases.
Retain local-kernel regressions and document the explicitly removed
coverage:
| Source | Retained coverage and intentional removal |
| --- | --- |
| `test_copy_conv_state.py` | Move into `triton/`. Retain two original
direct-copy cases and eight extracted FP16/BF16 layout and graph-copy
cases. Restore 20 dimension-first convolution adapter combinations that
exercise local `copy_conv_state` packing/writeback: six first-row,
twelve decode/graph and two empty-prefill cases. Keep their original
parameters and assertions, filtered to the relevant layout. Import FLA
only inside these wrapper tests. The other 38 convolution combinations
do not reach the local copy path and remain removed. Total: 30 cases. |
| `test_qfa_c8_paged_layout.py` | Move the complete original file into
`triton/`, preserving all four A5 QFA/cache-layout comparison
combinations and all parameters, assertions, and hardware conditions.
Also retain the two extracted MXFP block-zeroing cases in
`triton/test_kv_block_zeroer.py` (four cases in that file). Existing
local K-scale scatter tests remain unchanged. |
| `test_fused_moe.py` | Keep the four extracted BF16 routed SwiGLU
shapes and restore the four W8A8 AllGather caller combinations in
`triton/test_swiglu_quant.py` (16 cases total). Preserve shapes, routing
parameters, hardware guards and the final output-shape assertion; use
valid INT8 weights and initialized positive scales. With fusion
disabled, assert that the MLP calls the real local `swiglu_quant` once
with valid activation/expert metadata, and check its output/scales
against the existing numerical reference and tolerances. The original
eight non-quantized integration combinations remain removed; full MoE
output numerical accuracy is not established by the shape assertion. |
| `test_mla_dcp_dim0_stride.py` | Remove 14 external FIA
layout/causal-attention combinations. |
| `test_mla_strided_kv_writer_a5.py` | Remove 18 MLA writer adapter
combinations. |
| `test_copy_sfa_offload_metadata.py` | Merge all 26 metadata/lifecycle
combinations and their helpers into
`test_fused_scatter_copy_sparse_flash_attention.py`, then remove the old
file. Preserve parameters, assertions and decorators. These regressions
protect input preparation, layout, graph-buffer and lifecycle contracts
for local CopySFA/LIM operators; mocked LIM cases do not claim
native-kernel execution. |
| `triton/test_mrope.py` | Remove eight combinations that directly test
the upstream vLLM MRoPE kernel. |
| `triton/test_trace_replay.py` | Remove four wrapper/upstream-kernel
replay cases. |
| `benchmark_kda_state_copy_triton.py` | Remove the manual benchmark,
which is not collected by pytest by default, and remove its obsolete
invocation and script-specific instructions from the KDA documentation.
|
The eight filename alignments and six whole-file moves (including QFA)
preserve contents. Retain adapters, metadata and binding regressions
that protect an identified local csrc/Triton operator; remove the
unrelated external-kernel and generic adapter coverage listed above.
Keep the existing BGMV Expand/Shrink, Sparse-KV Host, and UVA suites at
the root with their current names. No operator implementation,
test-selection logic, CI configuration, 310P suite, or multi-card suite
is changed.
### Does this PR introduce _any_ user-facing change?
No model/runtime API change. Commands targeting renamed or relocated
test files must use the updated paths. Directory-based nightly
entrypoints remain unchanged. This test/documentation maintenance does
not require a release-note fragment.
### How was this patch tested?
- Verified all eight original filename alignments and the five original
whole-file moves preserve their Git content and test/decorator ASTs. The
restored QFA file is byte-identical to its original root version.
- Compared the moved LIM and CopySFA metadata helpers/tests, plus the
destination's existing definitions, by AST. Original parameters,
assertions and decorators are preserved. CopySFA now collects `5 + 8 +
26 = 39` cases; convolution copy/adapter collects 30; SwiGLU
direct/caller coverage collects 16.
- Verified the four extracted SwiGLU shapes and restored caller
contracts. CPU input/reference checks and 16 invalid-input contract
checks passed. Actual A2/A5 NPU results are reported separately below;
CPU checks alone do not establish NPU correctness.
- After rebasing onto main `ad2dd91fa`, Python syntax checks for all 108
current files (36 at the root and 72 in `triton/`), Ruff lint/format,
operator-document Markdownlint and `git diff --check` passed. The
earlier extraction/rename patch also passed focused codespell, typos,
forbidden-import, boolean-context-manager and package-init checks.
- Full `bash format.sh ci` was attempted in an isolated checkout. Local
hook-environment provisioning has not completed successfully; full
repository-wide CI remains required. Focused lint/format checks above
passed.
- Earlier full-directory validation at commit
`258f1f83610f94be43786a6bcbb45e678a2cbd3e`, before restoring the 50
metadata/adapter/caller cases above, covered all 105 files (35 at the
root and 70 in `triton/`) and collected 2,493 cases per platform. Tests
ran in four complete-file shards. The suite path remains
`tests/e2e/nightly/single_node/ops/singlecard_ops/`. The following table
records that earlier run, not a new full-directory run of the restored
coverage.
- Both platforms used Python 3.11.10, torch-npu 2.10.0.post7, Triton
Ascend 3.6.0, CANN 9.2, and vLLM 0.32.0+empty
(`5df63a7203cdb9328d824a27b682e77c7b9928be`). PyTorch was 2.10.0 on A2
and 2.10.0+cpu on A5. Existing skip conditions, test parameters, and
assertions were retained during validation.
| Platform | Host architecture | Passed | Skipped | Validation result |
| --- | --- | ---: | ---: | --- |
| Ascend A2 | aarch64 | 2,158 | 335 | Passed, including follow-up reruns
|
| Ascend A5 | x86_64 | 1,208 | 1,285 | Passed |
After restoring the operator-related regressions, targeted NPU
validation ran all three changed files with normal repository conftests
and the same pinned software environment above:
| Current changed file | A2 passed / skipped / failed | A5 passed /
skipped / failed |
| --- | --- | --- |
| `test_fused_scatter_copy_sparse_flash_attention.py` | 39 / 0 / 0 | 28
/ 11 / 0 |
| `triton/test_copy_conv_state.py` | 30 / 0 / 0 | 30 / 0 / 0 |
| `triton/test_swiglu_quant.py` | 16 / 0 / 0 | 16 / 0 / 0 |
| Total | 85 / 0 / 0 | 74 / 11 / 0 |
All 50 restored cases passed on both devices. A5's 11 skips are
pre-existing A2/A3-only native CopySFA guards. Node IDs, per-phase
reports, JUnit and test hashes were reconciled: no failures, teardown
errors or unrun cases; all three workers exited 0 on each platform. No
skip override or operator/conftest edits were used. This was targeted
validation, not a new full-directory or full-model run. These hardware
runs preceded the latest rebase onto main `ad2dd91fa`; all three
targeted test files remain byte-identical to the validated versions. The
four test files inherited during the earlier rebase were preserved
unchanged and have not been included in a new local hardware run.
```bash
T=tests/e2e/nightly/single_node/ops/singlecard_ops
python -m pytest -sv \
"$T/test_fused_scatter_copy_sparse_flash_attention.py" \
"$T/triton/test_copy_conv_state.py" \
"$T/triton/test_swiglu_quant.py"
```
---
### Checklist
Operator implementations and existing hardware/version guards are
unchanged. Static checks and A2/A5 hardware validation cover the
reorganization plus the restored operator-related regressions;
historical full-directory and current targeted results are distinguished
above.
#### Testing
- [ ] **Boundary / edge-case coverage**: I reviewed whether this change
involves boundary conditions. Where applicable, I added unit tests
covering these edge cases.
- [ ] **Regression test**: If this PR fixes a bug, I added a regression
test that would fail without the fix.
- [ ] **Error / failure path coverage**: I covered abnormal paths in
addition to the happy path.
- [x] **Meaningful & reliable tests**: Restored regressions assert
operator input/lifecycle contracts, real local-kernel invocation and
numerical activation results; shape-only and mocked coverage are
identified above.
- [ ] **Performance impact**: If this PR touches a performance-sensitive
path, I attached benchmark results and added performance regression
tests.
- vLLM main:
vllm-project/vllm@544f182
---------
Signed-off-by: Foriv <2293567056@qq.com>1 parent 0f2eee9 commit 91e6e46
31 files changed
Lines changed: 1148 additions & 2024 deletions
File tree
- csrc/moe/grouped_matmul_situ_quant
- tests/e2e/nightly/single_node/ops/singlecard_ops
- triton
- vllm_ascend/ops/triton/docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
This file was deleted.
0 commit comments