History log of /llvm-project/mlir/test/python/dialects/transform_structured_ext.py (Results 1 – 25 of 52)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7
# 579ced4f 03-Jan-2025 Hugo Trachino <hugo.trachino@huawei.com>

[MLIR][Python] Add structured.fuseop to python interpreter (#120601)

Implements a python interface for structured.fuseOp allowing more freedom with inputs.


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4
# 618f231a 15-Nov-2024 Jinyun (Joey) Ye <jinyunye@huawei.com>

[MLIR][Transform] Consolidate result of structured.split into one list (#111171)

Follow-up a review comment from
https://github.com/llvm/llvm-project/pull/82792#discussion_r1604925239
as a separat

[MLIR][Transform] Consolidate result of structured.split into one list (#111171)

Follow-up a review comment from
https://github.com/llvm/llvm-project/pull/82792#discussion_r1604925239
as a separate PR:

E.g.:
```
%0:2 = transform.structured.split
```
is changed to
```
%t = transform.structured.split
%0:2 = transform.split_handle %t
```

show more ...


Revision tags: llvmorg-19.1.3
# a758bcdb 15-Oct-2024 Andrzej Warzyński <andrzej.warzynski@arm.com>

[mlir][td] Rename pack_paddings in structured.pad (#111036)

The pack_paddings attribute in the structure.pad TD Op is used to set
the `nofold` attribute in the generated tensor.pad Op. The current

[mlir][td] Rename pack_paddings in structured.pad (#111036)

The pack_paddings attribute in the structure.pad TD Op is used to set
the `nofold` attribute in the generated tensor.pad Op. The current name
is confusing and suggests that there's a relation with the tensor.pack
Op. This patch renames it as `nofold_flags` to better match the actual
usage.

show more ...


Revision tags: llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# a9efcbf4 21-Jun-2024 muneebkhan85 <150162960+muneebkhan85@users.noreply.github.com>

[MLIR] Add continuous tiling to transform dialect (#82792)

This patch enables continuous tiling of a target structured op using
diminishing tile sizes. In cases where the tensor dimensions are not

[MLIR] Add continuous tiling to transform dialect (#82792)

This patch enables continuous tiling of a target structured op using
diminishing tile sizes. In cases where the tensor dimensions are not
exactly divisible by the tile size, we are left with leftover tensor
chunks that are irregularly tiled. This approach enables tiling of the
leftover chunk with a smaller tile size and repeats this process
recursively using exponentially diminishing tile sizes. This eventually
generates a chain of loops that apply tiling using diminishing tile
sizes.

Adds `continuous_tile_sizes` op to the transform dialect. This op, when
given a tile size and a dimension, computes a series of diminishing tile
sizes that can be used to tile the target along the given dimension.
Additionally, this op also generates a series of chunk sizes that the
corresponding tile sizes should be applied to along the given dimension.

Adds `multiway` attribute to `transform.structured.split` that enables
multiway splitting of a single target op along the given dimension, as
specified in a list enumerating the chunk sizes.

show more ...


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7
# f0b0c025 24-May-2024 klensy <klensy@users.noreply.github.com>

[mlir][test] Fix filecheck annotation typos (#92897)

Moved fixes for mlir from
https://github.com/llvm/llvm-project/pull/91854, plus few additional in
second commit.

---------

Co-authored-by

[mlir][test] Fix filecheck annotation typos (#92897)

Moved fixes for mlir from
https://github.com/llvm/llvm-project/pull/91854, plus few additional in
second commit.

---------

Co-authored-by: klensy <nightouser@gmail.com>

show more ...


Revision tags: llvmorg-18.1.6
# 2c1c6767 08-May-2024 srcarroll <50210727+srcarroll@users.noreply.github.com>

[mlir][transform] Consistent `linalg` `transform` op syntax for dynamic index lists (#90897)

This patch is a first pass at making consistent syntax across the
`LinalgTransformOp`s that use dynamic

[mlir][transform] Consistent `linalg` `transform` op syntax for dynamic index lists (#90897)

This patch is a first pass at making consistent syntax across the
`LinalgTransformOp`s that use dynamic index lists for size parameters.
Previously, there were two different forms: inline types in the list, or
place them in the functional style tuple. This patch goes for the
latter.

In order to do this, the `printPackedOrDynamicIndexList`,
`printDynamicIndexList` and their `parse` counterparts were modified so
that the types can be optionally provided to the corresponding custom
directives.

All affected ops now use tablegen `assemblyFormat`, so custom
`parse`/`print` functions have been removed. There are a couple ops that
will likely add dynamic size support, and once that happens it should be
made sure that the assembly remains consistent with the changes in this
patch.

The affected ops are as follows: `pack`, `pack_greedily`,
`tile_using_forall`. The `tile_using_for` and `vectorize` ops already
used this syntax, but their custom assembly was removed.

---------

Co-authored-by: Oleksandr "Alex" Zinenko <ftynse@gmail.com>

show more ...


# f2f65edd 04-May-2024 srcarroll <50210727+srcarroll@users.noreply.github.com>

[mlir][transform] Add support for transform.param pad multiples in `PadOp` (#90755)

This patch modifies the definition of `PadOp` to take transform params
and handles for the `pad_to_multiple_of` o

[mlir][transform] Add support for transform.param pad multiples in `PadOp` (#90755)

This patch modifies the definition of `PadOp` to take transform params
and handles for the `pad_to_multiple_of` operand.

---------

Co-authored-by: Oleksandr "Alex" Zinenko <ftynse@gmail.com>

show more ...


Revision tags: llvmorg-18.1.5, llvmorg-18.1.4
# b79db396 09-Apr-2024 srcarroll <50210727+srcarroll@users.noreply.github.com>

[mlir][linalg] Support `ParamType` in `vector_sizes` option of `VectorizeOp` transform (#87557)


Revision tags: llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3
# f54dc7b3 13-Oct-2023 Benjamin Maxwell <benjamin.maxwell@arm.com>

[mlir][ODS] Omit printing default-valued attributes in oilists (#68880)

This makes these match the behaviour of optional attributes (which are
omitted when they are their default value of none). Th

[mlir][ODS] Omit printing default-valued attributes in oilists (#68880)

This makes these match the behaviour of optional attributes (which are
omitted when they are their default value of none). This allows for
concise assembly formats without a custom printer.

An extra print of " " is also removed, this does change any existing
uses of oilists, but if the parameter before the oilist is optional,
that would previously add an extra space.

This #68694 + some fixes for the MLIR Python tests, unfortunately GitHub
does not allow re-opening PRs :confused:

show more ...


Revision tags: llvmorg-17.0.2
# 96ff0255 26-Sep-2023 Oleksandr "Alex" Zinenko <zinenko@google.com>

[mlir] cleanup of structured.tile* transform ops (#67320)

Rename and restructure tiling-related transform ops from the structured
extension to be more homogeneous. In particular, all ops now follow

[mlir] cleanup of structured.tile* transform ops (#67320)

Rename and restructure tiling-related transform ops from the structured
extension to be more homogeneous. In particular, all ops now follow a
consistent naming scheme:

- `transform.structured.tile_using_for`;
- `transform.structured.tile_using_forall`;
- `transform.structured.tile_reduction_using_for`;
- `transform.structured.tile_reduction_using_forall`.

This drops the "_op" naming artifact from `tile_to_forall_op` that
shouldn't have been included in the first place, consistently specifies
the name of the control flow op to be produced for loops (instead of
`tile_reduction_using_scf` since `scf.forall` also belongs to `scf`),
and opts for the `using` connector to avoid ambiguity.

The loops produced by tiling are now systematically placed as *trailing*
results of the transform op. While this required changing 3 out of 4 ops
(except for `tile_using_for`), this is the only choice that makes sense
when producing multiple `scf.for` ops that can be associated with a
variadic number of handles. This choice is also most consistent with
*other* transform ops from the structured extension, in particular with
fusion ops, that produce the structured op as the leading result and the
loop as the trailing result.

show more ...


# 6464a016 21-Sep-2023 Ingo Müller <ingomueller@google.com>

[mlir][linalg][transform] Fix test breakage from 69bc1cbb. (NFC)

That commit introduced a trivial test breakage due to a bad rebase,
which this commit fixes.


# 69bc1cbb 21-Sep-2023 Ingo Müller <ingomueller@google.com>

[mlir][linalg][transform] Rename {masked_vectorize => vectorize => vectorize_children_and...}. (#66575)

This PR renames the vectorization transform ops as follows:

* `structured.masked_vectorize`

[mlir][linalg][transform] Rename {masked_vectorize => vectorize => vectorize_children_and...}. (#66575)

This PR renames the vectorization transform ops as follows:

* `structured.masked_vectorize` => `structured.vectorize`. This reflects
the fact that since [recently](https://reviews.llvm.org/D157774) the op
can also handle the unmasked case.
* `structured.vectorize` =>
`structured.vectorize_children_and_applies_patterns`. This reflects the
fact that the op does not just vectorize the given payload op but all
vectorizable children contained in it, and applies patterns before and
after for preparation and clean-up.

This rename was discussed first
[here](https://reviews.llvm.org/D157774).

The PR also adapts and cleans ups the tablegen description of the
`VectorizeChildrenAndApplyPatternsOp` (formerly `VectorizeOp`).

show more ...


Revision tags: llvmorg-17.0.1
# 86ddbdd3 19-Sep-2023 Ingo Müller <ingomueller@google.com>

[mlir][linalg][transform][python] Allow no args in MaskedVectorize. (#66541)

The mix-in of this op did not allow to pass in no argument. This special
case is now handled correctly and covered by th

[mlir][linalg][transform][python] Allow no args in MaskedVectorize. (#66541)

The mix-in of this op did not allow to pass in no argument. This special
case is now handled correctly and covered by the tests.

show more ...


Revision tags: llvmorg-17.0.0
# f167dc4f 15-Sep-2023 Ingo Müller <ingomueller@google.com>

[mlir][linalg][transform][python] Clean up _ext.py test. (#66469)

This PR cleans up the test of the mix-ins of this dialect. Most of the
character diff is due to factoring out the creation of the t

[mlir][linalg][transform][python] Clean up _ext.py test. (#66469)

This PR cleans up the test of the mix-ins of this dialect. Most of the
character diff is due to factoring out the creation of the the top-level
sequence into a decorator. This decorator siginficantly shortens the
definition of the individual tests and can be used in all but one test,
where the top-level op is a PDL op. The only functional diff is due to
the fact that the decator uses `transform.any_op` instead of
`pdl.operation` for the type of the root handle. The only remaining
usages of the PDL dialects is now in the test a PDL-related op.

show more ...


Revision tags: llvmorg-17.0.0-rc4
# 33278321 04-Sep-2023 Ingo Müller <ingomueller@google.com>

[mlir][linalg][transform][python] Make divisor arg to Multitile optional

The mix-in of the `MultiTileSizesOp` set the default value of its
`divisor` argument. This repeats information from the table

[mlir][linalg][transform][python] Make divisor arg to Multitile optional

The mix-in of the `MultiTileSizesOp` set the default value of its
`divisor` argument. This repeats information from the tablegen
defintion, is not necessary (since the generic code deals with `None`
and default values), and has the risk of running out of sync without
people noticing. This patch removes the setting of the value and forward
`None` to the generic constructor instead.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D159416

show more ...


# ea4a5127 04-Sep-2023 Ingo Müller <ingomueller@google.com>

[mlir][linalg][transform][python] Refactor TileOp mix-in.

This patch simplifies and improves the mix-in of the `TileOp`. In
particular:

* Accept all types of sizes (static, dynamic, scalable) in a

[mlir][linalg][transform][python] Refactor TileOp mix-in.

This patch simplifies and improves the mix-in of the `TileOp`. In
particular:

* Accept all types of sizes (static, dynamic, scalable) in a single
argument `sizes`.
* Use the existing convenience function to dispatch different types of
sizes instead of repeating the implementation in the mix-in.
* Pass on `None` values as is of optional arguments to the init function
of the super class.
* Reformat with default indentation width (4 spaces vs 2 spaces).
* Add a a test for providing scalable sizes.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D159417

show more ...


# 6ff7ef43 02-Sep-2023 Ingo Müller <ingomueller@google.com>

[mlir][python] Fix-forward 9442b441c1c50e4e6782fd2e6aa16925c9d22e29.

That commit changed the mix-ins for the Python bindings of the PadOp
including some tests, but did not change the corresponding `

[mlir][python] Fix-forward 9442b441c1c50e4e6782fd2e6aa16925c9d22e29.

That commit changed the mix-ins for the Python bindings of the PadOp
including some tests, but did not change the corresponding `CHECK`
statements. This patch does that.

show more ...


# 9442b441 25-Aug-2023 Ingo Müller <ingomueller@google.com>

[mlir][linalg][transform][python] Fix optional args of PadOp mix-in.

The mix-in did not allow to *not* set many of the arguments, even though
they represent optional attributes. Instead, it set defa

[mlir][linalg][transform][python] Fix optional args of PadOp mix-in.

The mix-in did not allow to *not* set many of the arguments, even though
they represent optional attributes. Instead, it set default values,
which have different semantics in some cases. In other cases, setting
the default values is already done by the C++ layer, in which case they
are currently redundant and may be wrong in some potential future change
in the TD or C++ files. With this patch, `None` is preserved until the
generated binding, which handles them as desired.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D158844

show more ...


# a470df3f 28-Aug-2023 Ingo Müller <ingomueller@google.com>

[mlir][linalg][transform][python] Extend mix-in for Vectorize

Extends the existing mix-in for VectorizeOp with support for the missing unit attributes.

Also fixes the unintuitive implementation whe

[mlir][linalg][transform][python] Extend mix-in for Vectorize

Extends the existing mix-in for VectorizeOp with support for the missing unit attributes.

Also fixes the unintuitive implementation where
`structured.VectorizeOp(target=target, vectorize_padding=False)` still resulted in the creation of the UnitAttr `vectorize_padding`.

Reviewed By: ingomueller-net

Differential Revision: https://reviews.llvm.org/D158726

show more ...


# 92233062 23-Aug-2023 max <maksim.levental@gmail.com>

[mlir][python bindings] generate all the enums

This PR implements python enum bindings for *all* the enums - this includes `I*Attrs` (including positional/bit) and `Dialect/EnumAttr`.

There are a f

[mlir][python bindings] generate all the enums

This PR implements python enum bindings for *all* the enums - this includes `I*Attrs` (including positional/bit) and `Dialect/EnumAttr`.

There are a few parts to this:

1. CMake: a small addition to `declare_mlir_dialect_python_bindings` and `declare_mlir_dialect_extension_python_bindings` to generate the enum, a boolean arg `GEN_ENUM_BINDINGS` to make it opt-in (even though it works for basically all of the dialects), and an optional `GEN_ENUM_BINDINGS_TD_FILE` for handling corner cases.
2. EnumPythonBindingGen.cpp: there are two weedy aspects here that took investigation:
1. If an enum attribute is not a `Dialect/EnumAttr` then the `EnumAttrInfo` record is canonical, as far as both the cases of the enum **and the `AttrDefName`**. On the otherhand, if an enum is a `Dialect/EnumAttr` then the `EnumAttr` record has the correct `AttrDefName` ("load bearing", i.e., populates `ods.ir.AttributeBuilder('<NAME>')`) but its `enum` field contains the cases, which is an instance of `EnumAttrInfo`. The solution is to generate an one enum class for both `Dialect/EnumAttr` and "independent" `EnumAttrInfo` but to make that class interopable with two builder registrations that both do the right thing (see next sub-bullet).
2. Because we don't have a good connection to cpp `EnumAttr`, i.e., only the `enum class` getters are exposed (like `DimensionAttr::get(Dimension value)`), we have to resort to parsing e.g., `Attribute.parse(f'#gpu<dim {x}>')`. This means that the set of supported `assemblyFormat`s (for the enum) is fixed at compile of MLIR (currently 2, the only 2 I saw). There might be some things that could be done here but they would require quite a bit more C API work to support generically (e.g., casting ints to enum cases and binding all the getters or going generically through the `symbolize*` methods, like `symbolizeDimension(uint32_t)` or `symbolizeDimension(StringRef)`).

A few small changes:

1. In addition, since this patch registers default builders for attributes where people might've had their own builders already written, I added a `replace` param to `AttributeBuilder.insert` (`False` by default).
2. `makePythonEnumCaseName` can't handle all the different ways in which people write their enum cases, e.g., `llvm.CConv.Intel_OCL_BI`, which gets turned into `INTEL_O_C_L_B_I` (because `llvm::convertToSnakeFromCamelCase` doesn't look for runs of caps). So I dropped it. On the otherhand regularization does need to done because some enums have `None` as a case (and others might have other python keywords).
3. I turned on `llvm` dialect generation here in order to test `nvvm.WGMMAScaleIn`, which is an enum with [[ https://github.com/llvm/llvm-project/blob/d7e26b56207cbd8995296c5bb7c11ce676b649da/mlir/include/mlir/IR/EnumAttr.td#L22-L25 | no explicit discriminator ]] for the `neg` case.

Note, dialects that didn't get a `GEN_ENUM_BINDINGS` don't have any enums to generate.

Let me know if I should add more tests (the three trivial ones I added exercise both the supported `assemblyFormat`s and `replace=True`).

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D157934

show more ...


Revision tags: llvmorg-17.0.0-rc3
# 57c090b2 12-Aug-2023 Ingo Müller <ingomueller@google.com>

[mlir][linalg][transform][python] Improve mix-in for PadOp.

In particular:

* Fix and extend the support for constructing possibly nested ArrayAttrs
from lists of Python ints. This can probably be

[mlir][linalg][transform][python] Improve mix-in for PadOp.

In particular:

* Fix and extend the support for constructing possibly nested ArrayAttrs
from lists of Python ints. This can probably be generalized further
and used in many more places.
* Add arguments for `pad_to_multiple_of` and `copy_back_op`.
* Format with black and reorder (keyword-only) arguments to match
tablegen and (`*_gen.py`) order.
* Extend tests for new features.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D157789

show more ...


# dac19b45 11-Aug-2023 Ingo Müller <ingomueller@google.com>

[mlir][linalg][transform][python] Add mix-in for MaskedVectorize.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D157735


# 2d3dcd4a 11-Aug-2023 Ingo Müller <ingomueller@google.com>

[mlir][linalg][transform][python] Add mix-in for BufferizeToAllocOp.

Re-apply https://reviews.llvm.org/D157704.

The original patch broke the tests on Python 3.8 and got reverted by
0c4aad050c23254c

[mlir][linalg][transform][python] Add mix-in for BufferizeToAllocOp.

Re-apply https://reviews.llvm.org/D157704.

The original patch broke the tests on Python 3.8 and got reverted by
0c4aad050c23254c3c612e860e1278961d161aef. This patch replaces the usage
of the vertical bar operator for type hints with `Union`.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D158075

show more ...


# a7fdb90b 11-Aug-2023 Ingo Müller <ingomueller@google.com>

[mlir][linalg][transform][python] Add mix-in for MapCopyToThreadsOp.

Reviewed By: springerm

Re-land 691a2fab88a0f2c763bbd26de517dcde156c5188 which was incorrectly
reverted.

Differential Revision:

[mlir][linalg][transform][python] Add mix-in for MapCopyToThreadsOp.

Reviewed By: springerm

Re-land 691a2fab88a0f2c763bbd26de517dcde156c5188 which was incorrectly
reverted.

Differential Revision: https://reviews.llvm.org/D157706

show more ...


# 0c4aad05 14-Aug-2023 Mehdi Amini <joker.eph@gmail.com>

Revert "[mlir][linalg][transform][python] Add mix-in for BufferizeToAllocOp."

This reverts commit 20966fcbfea53f7d660b8b93ce56ea6149bcf9f0.

Bot is broken https://lab.llvm.org/buildbot/#/builders/61

Revert "[mlir][linalg][transform][python] Add mix-in for BufferizeToAllocOp."

This reverts commit 20966fcbfea53f7d660b8b93ce56ea6149bcf9f0.

Bot is broken https://lab.llvm.org/buildbot/#/builders/61/builds/47577

show more ...


123