test: use block_dim=0 (auto) instead of hardcoded platform max#1309
test: use block_dim=0 (auto) instead of hardcoded platform max#1309doraemonmj wants to merge 1 commit into
Conversation
Many scene tests hardcoded the runtime config block_dim to the platform maximum (24 on a2a3, 36 on a5). That value is exactly what block_dim=0 resolves to: DeviceRunner treats 0 as the CallConfig auto sentinel and resolves it at run() time to the stream's max capacity (onboard queries the actual cube/vector core counts via aclrtGetStreamResLimit and caps at PLATFORM_MAX_BLOCKDIM; sim uses PLATFORM_MAX_BLOCKDIM directly). Zero out the a2a3 (24) and a5 (36) config block_dim values so the tests follow the hardware's actual available core count instead of pinning a literal. Kernel-side params.block_dim (tiling arg) is left untouched.
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
📝 WalkthroughWalkthroughThis change updates Changesblock_dim configuration reset
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/st/a2a3/tensormap_and_ringbuffer/spmd_basic/test_spmd_basic.py (1)
74-86: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueCase1 and Case2_AutoBlockDim are now functionally equivalent.
Case1 explicitly sets
block_dim: 0and Case2_AutoBlockDim omitsblock_dim(defaulting to 0 via_build_config). Both resolve to the sameCallConfig, making the two cases redundant in terms of runtime configuration. If the intent is to test both the explicit-0 and omitted paths as distinct regression cases, consider adding a comment to Case1 clarifying that distinction. Otherwise, Case2_AutoBlockDim could be removed.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/st/a2a3/tensormap_and_ringbuffer/spmd_basic/test_spmd_basic.py` around lines 74 - 86, Case1 and Case2_AutoBlockDim are redundant because both end up using the same CallConfig through block_dim=0. Update the table entry in test_spmd_basic to either remove Case2_AutoBlockDim or add a clear comment near Case1 and Case2 explaining that one exercises the explicit block_dim=0 path and the other exercises the omitted-field path via _build_config, so the distinction is intentional.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/st/a2a3/tensormap_and_ringbuffer/spmd_basic/test_spmd_basic.py`:
- Around line 74-86: Case1 and Case2_AutoBlockDim are redundant because both end
up using the same CallConfig through block_dim=0. Update the table entry in
test_spmd_basic to either remove Case2_AutoBlockDim or add a clear comment near
Case1 and Case2 explaining that one exercises the explicit block_dim=0 path and
the other exercises the omitted-field path via _build_config, so the distinction
is intentional.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9a577d69-2578-4554-831e-3134c73b3635
📒 Files selected for processing (26)
examples/a2a3/tensormap_and_ringbuffer/benchmark_bgemm/test_benchmark_bgemm.pyexamples/a2a3/tensormap_and_ringbuffer/paged_attention/test_paged_attention.pyexamples/a2a3/tensormap_and_ringbuffer/paged_attention_manual_scope/test_paged_attention.pyexamples/a2a3/tensormap_and_ringbuffer/paged_attention_ringbuffer/test_paged_attention_ringbuffer.pyexamples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll.pyexamples/a5/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll.pytests/st/a2a3/host_build_graph/bgemm/test_bgemm.pytests/st/a2a3/host_build_graph/paged_attention/test_paged_attention.pytests/st/a2a3/tensormap_and_ringbuffer/alternating_matmul_add/test_alternating_matmul_add.pytests/st/a2a3/tensormap_and_ringbuffer/batch_paged_attention/test_batch_paged_attention.pytests/st/a2a3/tensormap_and_ringbuffer/fanin_lookup_perf/test_fanin_lookup_perf.pytests/st/a2a3/tensormap_and_ringbuffer/multi_round_paged_attention/test_multi_round_paged_attention.pytests/st/a2a3/tensormap_and_ringbuffer/paged_attention_unroll/test_paged_attention_unroll.pytests/st/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_4dims/test_paged_attention_unroll_4dims.pytests/st/a2a3/tensormap_and_ringbuffer/spmd_basic/test_spmd_basic.pytests/st/a2a3/tensormap_and_ringbuffer/spmd_batch_dispatch_oob/test_spmd_batch_dispatch_oob.pytests/st/a2a3/tensormap_and_ringbuffer/spmd_multiblock_aiv/test_spmd_multiblock_aiv.pytests/st/a2a3/tensormap_and_ringbuffer/spmd_multiblock_mix/test_spmd_multiblock_mix.pytests/st/a2a3/tensormap_and_ringbuffer/spmd_paged_attention/test_spmd_paged_attention.pytests/st/a2a3/tensormap_and_ringbuffer/spmd_paged_attention_highperf/test_spmd_paged_attention_highperf.pytests/st/a2a3/tensormap_and_ringbuffer/spmd_starvation/test_spmd_starvation.pytests/st/a2a3/tensormap_and_ringbuffer/spmd_sync_start/test_spmd_sync_start.pytests/st/a2a3/tensormap_and_ringbuffer/spmd_sync_start_aiv/test_spmd_sync_start_aiv.pytests/st/a2a3/tensormap_and_ringbuffer/spmd_sync_start_edge/test_spmd_sync_start_edge.pytests/st/a2a3/tensormap_and_ringbuffer/spmd_sync_start_stress/test_spmd_sync_start_stress.pytests/st/a5/tensormap_and_ringbuffer/paged_attention_unroll/test_paged_attention_unroll.py
What
Many scene tests hardcoded the runtime
configblock_dimto the platformmaximum — 24 on a2a3, 36 on a5. That literal is exactly what
block_dim=0already resolves to.
block_dim=0is the CallConfig auto sentinel:DeviceRunnerresolves itat
run()time to the stream's max block capacity.aclrtGetStreamResLimitand caps atPLATFORM_MAX_BLOCKDIM.PLATFORM_MAX_BLOCKDIMdirectly (a2a3=24, a5=36).Change
Zero out the a2a3 (
24) and a5 (36)configblock_dimvalues so thesetests follow the hardware's actual available core count instead of pinning a
literal that happens to equal today's platform max.
CASES[*]["config"]["block_dim"].params.block_dim(a tiling arg, e.g. inspmd_paged_attention_highperf) is left untouched.9/3, a5 SPMD/PA cases pinned to24,block_dim1/2) are left untouched.26 files, 70 config values →
0.