Repository navigation
Refactor: migrate legacy tests to @scene_test format - #548
Merged
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the Batch Paged Attention implementation and its test suite, introducing production-scale chunked batching and runtime dispatch for multiple tile configurations and data types. It consolidates test logic into SceneTestCase classes and adds extensive functional and stress tests for SPMD, BGEMM, and mixed AIC/AIV operations. Feedback points out an unnecessary .flatten() call in the multi-round paged attention test, which is inconsistent with the PR's objective of maintaining original tensor shapes and complicates the golden result computation.
…est format
- Move 10 synthetic examples to tests/st/ as SceneTestCase tests:
spmd_basic, spmd_multiblock_aiv, spmd_multiblock_mix, spmd_starvation,
spmd_sync_start, spmd_sync_start_aiv, spmd_sync_start_edge,
spmd_sync_start_stress, mixed_example, multi_round_paged_attention
- Merge batch_paged_attention (examples + tests/st) into single example
with unified runtime-dispatch kernels (typename T template parameter)
- Merge paged_attention into examples/ with sim-compatible cases
- Convert bgemm, benchmark_bgemm, paged_attention_unroll to @scene_test
- Remove all golden.py and kernel_config.py legacy files
- Delete original example dirs after migration to tests/st/
Fix: add runtime common/ to incore kernel include path
The SPMD kernel sources #include "intrinsic.h" which lives in
src/{arch}/runtime/{runtime}/common/. This directory was implicitly
available via the legacy run_example.py pipeline but missing from
the SceneTestCase kernel compiler include dirs.
ChaoWao
approved these changes
Apr 14, 2026
nalinaly
pushed a commit
to nalinaly/simpler
that referenced
this pull request
Jul 31, 2026
…est format (hw-native-sys#548) - Move 10 synthetic examples to tests/st/ as SceneTestCase tests: spmd_basic, spmd_multiblock_aiv, spmd_multiblock_mix, spmd_starvation, spmd_sync_start, spmd_sync_start_aiv, spmd_sync_start_edge, spmd_sync_start_stress, mixed_example, multi_round_paged_attention - Merge batch_paged_attention (examples + tests/st) into single example with unified runtime-dispatch kernels (typename T template parameter) - Merge paged_attention into examples/ with sim-compatible cases - Convert bgemm, benchmark_bgemm, paged_attention_unroll to @scene_test - Remove all golden.py and kernel_config.py legacy files - Delete original example dirs after migration to tests/st/ Fix: add runtime common/ to incore kernel include path The SPMD kernel sources #include "intrinsic.h" which lives in src/{arch}/runtime/{runtime}/common/. This directory was implicitly available via the legacy run_example.py pipeline but missing from the SceneTestCase kernel compiler include dirs. Co-authored-by: majin0824 <majin15@huawei.com>
7 of 8 tasks
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
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.
Summary
Migrate all legacy
golden.py+kernel_config.pytests undera2a3/tensormap_and_ringbuffer/to the unified@scene_test/SceneTestCaseformat (singletest_*.pyper example).examples/→tests/st/with newtest_*.pybenchmark_bgemm,paged_attention_unroll,explicit_fatalkernels)batch_paged_attention,paged_attention): small-scale sim cases + production-scale hardware cases → singletest_*.pytypename Ttemplate parameter + 3-way runtime dispatch (fp16/bf16)kernel_compiler.pyaddsruntime_common_dirto resolveintrinsic.hgolden.py/kernel_config.pydeletedMigration Table
Location Changes
Parameters (all unchanged)
Key Changes
golden.py+kernel_config.py→ singletest_*.py(SceneTestCase)["a2a3sim", "a2a3"], hardware-only:["a2a3"]typename T+ 3-way runtime dispatch../batch_paged_attention/kernels(reuse merged kernels).flatten(), keep original tensor shapesargs.specstraversal instead of manual reshapekernel_compiler.pyaddssrc/{arch}/runtime/{rt}/common/forintrinsic.hgolden.py/kernel_config.pydeleted, zero remaining