commit | 1cd62fdcea39512a80d6c9acaf34d9b9ea471075 | [log] [tgz] |
---|---|---|
author | Max191 <44243577+Max191@users.noreply.github.com> | Tue Jan 21 15:20:08 2025 -0500 |
committer | GitHub <noreply@github.com> | Tue Jan 21 12:20:08 2025 -0800 |
tree | 04ac3901788f6f31b4902a76cbb44bece1a06cc9 | |
parent | 3e15a5a8383b787c52bea47dfa7d837df7d28ccc [diff] |
[DT][GPU] Permute cross-thread dims of TileSwizzle to outermost (#19734) This PR adds a new constraint on the generated TileSwizzles during GPU encoding materialization. The new constraint is that all `CrossThread` dimensions in the ACC layout must come from the outermost dimensions within their reassociation groups of the swizzle's expand_shape. For example, consider the following TileSwizzle for an ACC layout generated without this constraint: ``` expandShape = [[8, {4}, 4], [{4}, 2, {16}]], permutation = [3, 0, 4, 1, 5, 2] ``` `CrossThread` dimensions are denoted with braces {}, and this TileSwizzle does not follow the new constrain because the first `{4}` dim of reassociation group 0 and the `{16}` dim of reassociation group 1 are not outermost. After adding the new constraint, this swizzle would look like the following: ``` expandShape = [[{4}, 8, 4], [{4}, {16}, 2]], permutation = [3, 1, 5, 0, 4, 2] ``` Now, all `CrossThread` dimensions are outermost within their reassociation groups. The permutation has been adjusted accordingly so that the result shape of the swizzled tile remains the same in both cases. The LHS and RHS swizzle layouts also have to be adjusted to match the new ACC layout, but the CrossThread dimensions are not necessarily the same between corresponding M and N tiles of the ACC swizzle and LHS/RHS swizzles. Because of this, the LHS and RHS (currently only LHS needs this) swizzle shapes must be expanded to match the dimensionality of the ACC layout. This is the reason why some of the LHS layouts have additional expansion after this PR. The reason for adding this constraint is so that the swizzle operations of unset_encoding operations are able to be fused into the thread loop of their data tiled multi_mma operation. This constraint makes the fusion possible by forcing the slices that are held by a thread at the end of the multi_mma computation to be contiguous in the linear layout tensor within each reassociation group. This matters because we need to fuse the collapse_shape op of the unset_encoding into the thread loop, which is only possible when the written slice is contiguous in the result for each reassociation group. --------- Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
IREE (Intermediate Representation Execution Environment, pronounced as “eerie”) is an MLIR-based end-to-end compiler and runtime that lowers Machine Learning (ML) models to a unified IR that scales up to meet the needs of the datacenter and down to satisfy the constraints and special considerations of mobile and edge deployments.
See our website for project details, user guides, and instructions on building from source.
Releases notes are published on GitHub releases.
Package | Release status |
---|---|
GitHub release (stable) | |
GitHub release (nightly) | |
Python iree-base-compiler | |
Python iree-base-runtime |
Operating system | Build status |
---|---|
Linux | |
macOS | |
macOS | |
Windows |
For the full list of workflows see https://iree.dev/developers/general/github-actions/.
See our website for more information.
Community meeting recordings: IREE YouTube channel
Date | Title | Recording | Slides |
---|---|---|---|
2021-06-09 | IREE Runtime Design Tech Talk | recording | slides |
2020-08-20 | IREE CodeGen (MLIR Open Design Meeting) | recording | slides |
2020-03-18 | Interactive HAL IR Walkthrough | recording | |
2020-01-31 | End-to-end MLIR Workflow in IREE (MLIR Open Design Meeting) | recording | slides |
IREE is licensed under the terms of the Apache 2.0 License with LLVM Exceptions. See LICENSE for more information.