You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Codegen][CPU] inner_tiled does not scale past 1 thread: distribution tile is always 1. #25028
setRootConfig for iree_codegen.inner_tiled sets every parallel distribution tile to 1 (KernelDispatch.cpp#L3083-L3095). Each workgroup computes a single tile over the full K: 6x32 for f32 and 14x32 for f16 RVV at VLEN 256. A large matmul becomes thousands of very small workgroups.
Ratio is ukernel wall / inner_tiled wall from #24932.
f16 native large: inner_tiled 4T wall is slower than 1T (19.6 vs 13.6 ms) while CPU/wall is about 3.91. Threads are busy but the total work grows.
CASTF32 and WIDENF32 already scale.
1T compiles use --iree-llvmcpu-disable-distribution, so they run the same inner loop without workgroup split. inner_tiled winning at 1T and losing at 4T/8T points at the distribtuion tile, not the kernel.
Likely cause, not yet measured: per-workgroup overhead and lost RHS/LHS reuse across cores when each workgroup is one inner tile. Comparing workgroup counts and cache misses between 1T and 4T would confirm it.
Where to look
the tile is set in setRootConfig for InnerTiledOp (#L3060-L3121). Its comment already names the mmt4d cost model as the template follow-up.
The mmt4d path picks larger tiles in getMmt4dLoweringConfig (#L1820-L1966), bounded by `iree-llvmcpu-matmul-tile-bytes (256 KiB)
Both ops use the Mmt4dTilingExpert pipeline, so the workgroup split itself is shared.
Open questions
How should the mmt4d byte model map onto inner_tiled, where one iteration is already a whole inner tile?
What should happen with dynamic outer dims and batch dims?
Should the search be shared with mmt4d or kept seperate?
Expected outcome
4T and 8T inner_tiled walls scale past 1T on the f32 and f16 large shapes, without regressing 1T, CASTF32 or WIDENF32.
Activity
[Codegen][CPU] Select inner_tiled distribution tiles with the mmt4d c…
[Codegen][CPU] Select inner_tiled distribution tiles with the mmt4d c…
[Codegen][CPU] Fix inner_tiled distribution fallbacks for scalable a…
[Codegen][CPU] Apply mmt4d cost model to inner_tiled distribution til…
[Codegen][CPU] Fix inner_tiled distribution fallbacks for scalable an…