<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/llvm.git/mlir/python, branch EmptyLineAfterFunctionDefinition</title>
<subtitle>github.com: llvm/llvm-project.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/'/>
<entry>
<title>[mlir][Python] Fix generation of accessors for Optional</title>
<updated>2021-11-18T08:42:57+00:00</updated>
<author>
<name>Michal Terepeta</name>
<email>michal.terepeta@gmail.com</email>
</author>
<published>2021-11-18T08:41:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=54c99842079997b0fe208acdab01e540c0d81b51'/>
<id>54c99842079997b0fe208acdab01e540c0d81b51</id>
<content type='text'>
Previously, in case there was only one `Optional` operand/result within
the list, we would always return `None` from the accessor, e.g., for a
single optional result we would generate:

```
return self.operation.results[0] if len(self.operation.results) &gt; 1 else None
```

But what we really want is to return `None` only if the length of
`results` is smaller than the total number of element groups (i.e.,
the optional operand/result is in fact missing).

This commit also renames a few local variables in the generator to make
the distinction between `isVariadic()` and `isVariableLength()` a bit
more clear.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D113855
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, in case there was only one `Optional` operand/result within
the list, we would always return `None` from the accessor, e.g., for a
single optional result we would generate:

```
return self.operation.results[0] if len(self.operation.results) &gt; 1 else None
```

But what we really want is to return `None` only if the length of
`results` is smaller than the total number of element groups (i.e.,
the optional operand/result is in fact missing).

This commit also renames a few local variables in the generator to make
the distinction between `isVariadic()` and `isVariableLength()` a bit
more clear.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D113855
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Fix wrong variable name in Linalg OpDSL</title>
<updated>2021-11-17T21:55:35+00:00</updated>
<author>
<name>Alex Zinenko</name>
<email>zinenko@google.com</email>
</author>
<published>2021-11-16T16:09:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=bca003dea8df9d87ce3cf17defb4e89b3166462d'/>
<id>bca003dea8df9d87ce3cf17defb4e89b3166462d</id>
<content type='text'>
The name seems to have been left over from a renaming effort on an unexercised
codepaths that are difficult to catch in Python. Fix it and add a test that
exercises the codepath.

Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D114004
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The name seems to have been left over from a renaming effort on an unexercised
codepaths that are difficult to catch in Python. Fix it and add a test that
exercises the codepath.

Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D114004
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Move min/max ops from Std to Arith.</title>
<updated>2021-11-15T12:19:17+00:00</updated>
<author>
<name>Alexander Belyaev</name>
<email>pifon@google.com</email>
</author>
<published>2021-11-15T11:52:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=9b1d90e8ac9c95ba55a0b949118377f31e6703f8'/>
<id>9b1d90e8ac9c95ba55a0b949118377f31e6703f8</id>
<content type='text'>
Differential Revision: https://reviews.llvm.org/D113881
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Differential Revision: https://reviews.llvm.org/D113881
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][Linalg] Make depthwise convolution naming scheme consistent.</title>
<updated>2021-11-15T07:54:29+00:00</updated>
<author>
<name>Nicolas Vasilache</name>
<email>nicolas.vasilache@gmail.com</email>
</author>
<published>2021-11-15T07:54:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=f67171ac5896d232b4b9826937ce97064909770b'/>
<id>f67171ac5896d232b4b9826937ce97064909770b</id>
<content type='text'>
Names should be consistent across all operations otherwise painful bugs will surface.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D113762
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Names should be consistent across all operations otherwise painful bugs will surface.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D113762
</pre>
</div>
</content>
</entry>
<entry>
<title>Re-apply "[mlir] Allow out-of-tree python building from installed MLIR."</title>
<updated>2021-11-15T04:31:34+00:00</updated>
<author>
<name>Stella Laurenzo</name>
<email>stellaraccident@gmail.com</email>
</author>
<published>2021-11-14T22:44:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=132bc6e2d48122823101a058e25b7b317b885a81'/>
<id>132bc6e2d48122823101a058e25b7b317b885a81</id>
<content type='text'>
Re-applies D111513:
* Adds a full-fledged Python example dialect and tests to the Standalone example (need to do a bit of tweaking in the top level CMake and lit tests to adapt better to if not building with Python enabled).
* Rips out remnants of custom extension building in favor of pybind11_add_module which does the right thing.
* Makes python and extension sources installable (outputs to src/python/${name} in the install tree): Both Python and C++ extension sources get installed as downstreams need all of this in order to build a derived version of the API.
* Exports sources targets (with our properties that make everything work) by converting them to INTERFACE libraries (which have export support), as recommended for the forseeable future by CMake devs. Renames custom properties to start with lower-case letter, as also recommended/required (groan).
* Adds a ROOT_DIR argument to declare_mlir_python_extension since now all C++ sources for an extension must be under the same directory (to line up at install time).
* Downstreams will need to adapt by:

  * Remove absolute paths from any SOURCES for declare_mlir_python_extension (I believe all downstreams are just using ${CMAKE_CURRENT_SOURCE_DIR} here, which can just be ommitted). May need to set ROOT_DIR if not relative to the current source directory.
  * To allow further downstreams to install/build, will need to make sure that all C++ extension headers are also listed under SOURCES for declare_mlir_python_extension.

This reverts commit 1a6c26d1f52999edbfbf6a978ae3f0e6759ea755.

Reviewed By: stephenneuendorffer

Differential Revision: https://reviews.llvm.org/D113732
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Re-applies D111513:
* Adds a full-fledged Python example dialect and tests to the Standalone example (need to do a bit of tweaking in the top level CMake and lit tests to adapt better to if not building with Python enabled).
* Rips out remnants of custom extension building in favor of pybind11_add_module which does the right thing.
* Makes python and extension sources installable (outputs to src/python/${name} in the install tree): Both Python and C++ extension sources get installed as downstreams need all of this in order to build a derived version of the API.
* Exports sources targets (with our properties that make everything work) by converting them to INTERFACE libraries (which have export support), as recommended for the forseeable future by CMake devs. Renames custom properties to start with lower-case letter, as also recommended/required (groan).
* Adds a ROOT_DIR argument to declare_mlir_python_extension since now all C++ sources for an extension must be under the same directory (to line up at install time).
* Downstreams will need to adapt by:

  * Remove absolute paths from any SOURCES for declare_mlir_python_extension (I believe all downstreams are just using ${CMAKE_CURRENT_SOURCE_DIR} here, which can just be ommitted). May need to set ROOT_DIR if not relative to the current source directory.
  * To allow further downstreams to install/build, will need to make sure that all C++ extension headers are also listed under SOURCES for declare_mlir_python_extension.

This reverts commit 1a6c26d1f52999edbfbf6a978ae3f0e6759ea755.

Reviewed By: stephenneuendorffer

Differential Revision: https://reviews.llvm.org/D113732
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[mlir] Allow out-of-tree python building from installed MLIR."</title>
<updated>2021-11-12T02:30:53+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2021-11-12T02:30:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=1a6c26d1f52999edbfbf6a978ae3f0e6759ea755'/>
<id>1a6c26d1f52999edbfbf6a978ae3f0e6759ea755</id>
<content type='text'>
This reverts commit c7be8b75399c727ec9e1ddc3f81510f284c65155.

Build is broken (multiple buildbots)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit c7be8b75399c727ec9e1ddc3f81510f284c65155.

Build is broken (multiple buildbots)
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Allow out-of-tree python building from installed MLIR.</title>
<updated>2021-11-12T02:04:31+00:00</updated>
<author>
<name>Stella Laurenzo</name>
<email>stellaraccident@gmail.com</email>
</author>
<published>2021-11-12T01:31:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=c7be8b75399c727ec9e1ddc3f81510f284c65155'/>
<id>c7be8b75399c727ec9e1ddc3f81510f284c65155</id>
<content type='text'>
* Depends on D111504, which provides the boilerplate for building aggregate shared libraries from installed MLIR.
* Adds a full-fledged Python example dialect and tests to the Standalone example (need to do a bit of tweaking in the top level CMake and lit tests to adapt better to if not building with Python enabled).
* Rips out remnants of custom extension building in favor of `pybind11_add_module` which does the right thing.
* Makes python and extension sources installable (outputs to src/python/${name} in the install tree): Both Python and C++ extension sources get installed as downstreams need all of this in order to build a derived version of the API.
* Exports sources targets (with our properties that make everything work) by converting them to INTERFACE libraries (which have export support), as recommended for the forseeable future by CMake devs. Renames custom properties to start with lower-case letter, as also recommended/required (groan).
* Adds a ROOT_DIR argument to `declare_mlir_python_extension` since now all C++ sources for an extension must be under the same directory (to line up at install time).
* Need to validate against a downstream or two and adjust, prior to submitting.

Downstreams will need to adapt by:

* Remove absolute paths from any SOURCES for `declare_mlir_python_extension` (I believe all downstreams are just using `${CMAKE_CURRENT_SOURCE_DIR}` here, which can just be ommitted). May need to set `ROOT_DIR` if not relative to the current source directory.
* To allow further downstreams to install/build, will need to make sure that all C++ extension headers are also listed under SOURCES for `declare_mlir_python_extension`.

Reviewed By: stephenneuendorffer, mikeurbach

Differential Revision: https://reviews.llvm.org/D111513
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Depends on D111504, which provides the boilerplate for building aggregate shared libraries from installed MLIR.
* Adds a full-fledged Python example dialect and tests to the Standalone example (need to do a bit of tweaking in the top level CMake and lit tests to adapt better to if not building with Python enabled).
* Rips out remnants of custom extension building in favor of `pybind11_add_module` which does the right thing.
* Makes python and extension sources installable (outputs to src/python/${name} in the install tree): Both Python and C++ extension sources get installed as downstreams need all of this in order to build a derived version of the API.
* Exports sources targets (with our properties that make everything work) by converting them to INTERFACE libraries (which have export support), as recommended for the forseeable future by CMake devs. Renames custom properties to start with lower-case letter, as also recommended/required (groan).
* Adds a ROOT_DIR argument to `declare_mlir_python_extension` since now all C++ sources for an extension must be under the same directory (to line up at install time).
* Need to validate against a downstream or two and adjust, prior to submitting.

Downstreams will need to adapt by:

* Remove absolute paths from any SOURCES for `declare_mlir_python_extension` (I believe all downstreams are just using `${CMAKE_CURRENT_SOURCE_DIR}` here, which can just be ommitted). May need to set `ROOT_DIR` if not relative to the current source directory.
* To allow further downstreams to install/build, will need to make sure that all C++ extension headers are also listed under SOURCES for `declare_mlir_python_extension`.

Reviewed By: stephenneuendorffer, mikeurbach

Differential Revision: https://reviews.llvm.org/D111513
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][Linalg] Add 1-d depthwise conv with opdsl</title>
<updated>2021-11-11T17:49:26+00:00</updated>
<author>
<name>Nicolas Vasilache</name>
<email>nicolas.vasilache@gmail.com</email>
</author>
<published>2021-11-11T17:33:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=8fd2f56c990e2c9f2ea2578b136d0fdad1972a8d'/>
<id>8fd2f56c990e2c9f2ea2578b136d0fdad1972a8d</id>
<content type='text'>
Differential Revision: https://reviews.llvm.org/D113686
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Differential Revision: https://reviews.llvm.org/D113686
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][python] Segment MLIR Python test dialect to avoid testonly dependency.</title>
<updated>2021-10-26T18:47:36+00:00</updated>
<author>
<name>Stella Laurenzo</name>
<email>stellaraccident@gmail.com</email>
</author>
<published>2021-10-26T17:14:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=d86688fb1f14a640bdc5fe1792c318bd818e124d'/>
<id>d86688fb1f14a640bdc5fe1792c318bd818e124d</id>
<content type='text'>
With https://reviews.llvm.org/rG14c9207063bb00823a5126131e50c93f6e288bd3, the build is broken with -DMLIR_INCLUDE_TESTS=OFF. This patch fixes the build and we may want to do a better fix to the layering in a followup.

Differential Revision: https://reviews.llvm.org/D112560
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With https://reviews.llvm.org/rG14c9207063bb00823a5126131e50c93f6e288bd3, the build is broken with -DMLIR_INCLUDE_TESTS=OFF. This patch fixes the build and we may want to do a better fix to the layering in a followup.

Differential Revision: https://reviews.llvm.org/D112560
</pre>
</div>
</content>
</entry>
<entry>
<title>Make Python MLIR Operation not iterable</title>
<updated>2021-10-26T07:21:09+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2021-10-20T19:51:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=f431d3878a07a67e544dacb98ad553b6a0b6b25a'/>
<id>f431d3878a07a67e544dacb98ad553b6a0b6b25a</id>
<content type='text'>
The current behavior is conveniently allowing to iterate on the regions of an operation
implicitly by exposing an operation as Iterable. However this is also error prone and
code that may intend to iterate on the results or the operands could end up "working"
apparently instead of throwing a runtime error.
The lack of static type checking in Python contributes to the ambiguity here, it seems
safer to not do this and require and explicit qualification to iterate (`op.results`, `op.regions`, ...).

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D111697
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current behavior is conveniently allowing to iterate on the regions of an operation
implicitly by exposing an operation as Iterable. However this is also error prone and
code that may intend to iterate on the results or the operands could end up "working"
apparently instead of throwing a runtime error.
The lack of static type checking in Python contributes to the ambiguity here, it seems
safer to not do this and require and explicit qualification to iterate (`op.results`, `op.regions`, ...).

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D111697
</pre>
</div>
</content>
</entry>
</feed>
