这是indexloc提供的服务,不要输入任何密码
Skip to content

WIP - Switching to data-tiling fusion. #21441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

hanhanW
Copy link
Contributor

@hanhanW hanhanW commented Jul 21, 2025

No description provided.

hanhanW added a commit that referenced this pull request Jul 23, 2025
The compiler is very smart on static shape inference that can generate
partially dynamic shape during the lowering. It makes data-tiling fusion
very struggle because they are expected to be dynamic shape but some
dimensions are inferred to static values in Stream
AnnotateDispatchAssumptions pass. Because it will lead to `tensor.cast
-> set_encoding -> tensor.cast` sequence in a dispatch, while we expect
the bindings have encoded tensor types. E.g.,

Input IR:

```mlir
%0 = iree_tensor_ext.dispatch_load ... tensor<?x?xi8>
%1 = set_encoding %0 : tensor<?x?xi8> -> tensor<?x?xi8, #encoding>
iree_tensor_ext.dispatch_store %1, ... tensor<?x?xi8, #encoding> ->
  ... tensor<?x?xi8, #encoding>
```

After annotation:

```mlir
%0 = iree_tensor_ext.dispatch_load ... tensor<4x?xi8>
%cast = tensor.cast %0 : tensor<4x?xi8> -> tensor<?x?xi8>
%1 = set_encoding %cast : tensor<?x?xi8> -> tensor<?x?xi8, #encoding>
%cast_0 = tensor.cast %1 : tensor<?x?xi8, #encoding> to tensor<4x5xi8>
iree_tensor_ext.dispatch_store %cast_0, ... tensor<4x5xi8> ->
  ... tensor<?x?xi8, #encoding>
```

It is hard to materialize the encodings when cast op is present.

Given that the original goal is testing dynamic shape, modifying the
input program is an easier fix.

The issue is observed from #21441.

Signed-off-by: hanhanW <hanhan0912@gmail.com>
@hanhanW hanhanW force-pushed the dt-fusion-default branch from a2380b6 to 012f3a0 Compare July 23, 2025 18:02
Signed-off-by: hanhanW <hanhan0912@gmail.com>
@hanhanW hanhanW force-pushed the dt-fusion-default branch from 197faec to 01363d8 Compare July 24, 2025 18:27
hanhanW added 8 commits July 24, 2025 13:53
Signed-off-by: hanhanW <hanhan0912@gmail.com>
- Rename it to `materialize_encoding_vmvx.mlir` to follow the naming
  convention.
- Delete the legacy `tensor.extract_slice` op from tests, because
  UnSetEncodingOp has slicing semantics.

Signed-off-by: hanhanW <hanhan0912@gmail.com>
Signed-off-by: hanhanW <hanhan0912@gmail.com>
It also replaces `TileAndFuse` pass uses with
`TileRootAndFuseProducerConsumer` pass that may impact other dispatches,
if they use DoubleTilingExpert. E.g., generic ops dispatches.

Signed-off-by: hanhanW <hanhan0912@gmail.com>
…gConfigAttr.

Signed-off-by: hanhanW <hanhan0912@gmail.com>
Signed-off-by: hanhanW <hanhan0912@gmail.com>
…anonical form.

Signed-off-by: hanhanW <hanhan0912@gmail.com>
…ibution passes.

Signed-off-by: hanhanW <hanhan0912@gmail.com>
@hanhanW hanhanW force-pushed the dt-fusion-default branch from 01363d8 to efb04d1 Compare July 24, 2025 23:23
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.

1 participant