forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CPU] Improve distribution tile sizes selection for mmt4d ops. (iree-…
…org#15448) Perfect distribution is a really hard problem, especially for the whole program/model. As a general rule workgroups like these should be processing thousands to tens of thousands of operations in order to amortize the scheduling overheads. Ideally each workgroup would roughly take 100us-500us; less than that and overhead starts to dominate and more than that needs to be balanced with total count: ~200 workgroups is more than enough to hide latencies and more than that adds overhead with diminishing returns. The basic heuristic we want is to spend enough time inside each workgroup to justify the overhead involved in launching it but not so much time and so few total that variance in the system can't be hidden (4 x 400ms workgroups on 3 threads will always have 400ms of work happen on one thread with the other 2 idle, or 4 x 400ms on 4 threads where 1 thread gets delayed 50ms will cause the total latency to increase 50ms, etc). In the context, `maxTileSizes` is critical because it is one of factors about number of workgroups. In IREE CPU, we've been using `defaultDistTileSize` to model tile sizes. It is used by matmul and other generic ops. In `mmt4d` semantics, some data are already tiled and moved to inner loops. To model distribution with the same factor, we should scale it down with corresponding inner tile sizes. Then the distribution of all the dispatches is modeled by the same factor. Fixes iree-org#15391
- Loading branch information
Showing
2 changed files
with
29 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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