Skip to content

Re-commit Tile and distribute linalg.generic in DispatchLinalgOnTensors - #5172

Merged
ThomasRaoux merged 3 commits into
iree-org:mainfrom
ThomasRaoux:elementwise
Mar 19, 2021
Merged

ThomasRaoux merged 3 commits into
iree-org:mainfrom
ThomasRaoux:elementwise

Conversation

@ThomasRaoux

Copy link
Copy Markdown
Contributor

Recommit 156f0bb after fixing the
problem with vectorization. Skip vectorization for single element tiles
to avoid problem with vector<1> not supported in SPIR-V conversion.

Also add a test to exercise vectorization path.

@antiagainst antiagainst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; I just have a few comments about comments. :) Please rebase and make sure tests pass before landing.


for (size_t dim = 0; dim < numTiledLoops; ++dim) {
useTileSizes[(isConvOp ? numParallelDims : numTiledLoops) - dim - 1] =
useTileSizes[numParallelDims - dim - 1] =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment in the above can be deleted now?

ShapedType outputShape = op.getOutputShapedType(0);

SmallVector<int64_t, 4> sizes;
// When Vectororization is not enabled the convertToGPU pass assumes that that

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is misplaced? From what I can see the following code is for the case where vectorization is enabled and we want to set a larger tile size for it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I would suggest renaming sizes into candidateTileSizes to make it clear. And the comment in the old commit can be helpful here too:

  // Use the first tile size that can divide the shape. If the shape is not
  // aligned on any of the tile sizes pick the smallest tile of one element per
  // thread.

:)

size_t numLoops = getNumOuterParallelLoops(op);
ts.resize(numLoops, 1);
ts.back() = lowerTs;
tileSizes.emplace_back(ts);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comment will be clear. This is already super opaque.

L346 ... // For workgroup level
L347 ... // For subgroup level
L349 ... // For invocation level

Recommit 156f0bb after fixing the
problem with vectorization. Skip vectorization for single element tiles
to avoid problem with vector<1> not supported in SPIR-V conversion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants