<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/examples/standalone/python, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[MLIR][Python] make sure stubs get installed with LLVM_DISTRIBUTION_COMPONENTS (#168407)</title>
<updated>2025-11-19T15:07:28+00:00</updated>
<author>
<name>Maksim Levental</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2025-11-19T15:07:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=86a82f27ee8cb7477c25561bc5697a6a6a8ff21d'/>
<id>86a82f27ee8cb7477c25561bc5697a6a6a8ff21d</id>
<content type='text'>
Fixes https://github.com/llvm/llvm-project/issues/168393. Also adds
top-level `MLIR_PYTHON_STUBGEN_ENABLED` CMake option.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes https://github.com/llvm/llvm-project/issues/168393. Also adds
top-level `MLIR_PYTHON_STUBGEN_ENABLED` CMake option.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Python] Skip stubgen while any sanitizer is enabled (#164661)</title>
<updated>2025-10-23T05:49:07+00:00</updated>
<author>
<name>Twice</name>
<email>twice@apache.org</email>
</author>
<published>2025-10-23T05:49:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=13b5e396a007d119a65e0ba41b1f3604369376aa'/>
<id>13b5e396a007d119a65e0ba41b1f3604369376aa</id>
<content type='text'>
The intention of this PR is described
https://github.com/llvm/llvm-project/issues/164197#issuecomment-3432843709
(and
https://github.com/llvm/llvm-project/issues/164197#issuecomment-3432935838).

When sanitizers are enabled, some additional setup (such as preloading
certain libraries) seems to be required for the stubgen step to work
properly
(https://github.com/llvm/llvm-project/issues/164197#issuecomment-3432924034).
In this case, I chose to simply skip the stubgen process, as supporting
it would likely require some extra CMake logic, and type stubs don’t
appear to be particularly necessary in this configuration.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The intention of this PR is described
https://github.com/llvm/llvm-project/issues/164197#issuecomment-3432843709
(and
https://github.com/llvm/llvm-project/issues/164197#issuecomment-3432935838).

When sanitizers are enabled, some additional setup (such as preloading
certain libraries) seems to be required for the stubgen step to work
properly
(https://github.com/llvm/llvm-project/issues/164197#issuecomment-3432924034).
In this case, I chose to simply skip the stubgen process, as supporting
it would likely require some extra CMake logic, and type stubs don’t
appear to be particularly necessary in this configuration.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[MLIR][Python] use `FetchContent_Declare` for nanobind and remove pybind (#161230)" (#162309)</title>
<updated>2025-10-07T16:30:10+00:00</updated>
<author>
<name>Maksim Levental</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2025-10-07T16:30:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=93097b2d47c87bf5eee0a2612d961c7a01831eab'/>
<id>93097b2d47c87bf5eee0a2612d961c7a01831eab</id>
<content type='text'>
This reverts commit 84a214856ad989f37af19f5e8aaa9ec2346dde6f.

This gives us more time to work out the alternative and also people to
migrate</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 84a214856ad989f37af19f5e8aaa9ec2346dde6f.

This gives us more time to work out the alternative and also people to
migrate</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Python] use `FetchContent_Declare` for nanobind and remove pybind (#161230)</title>
<updated>2025-10-06T17:17:04+00:00</updated>
<author>
<name>Maksim Levental</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2025-10-06T17:17:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=84a214856ad989f37af19f5e8aaa9ec2346dde6f'/>
<id>84a214856ad989f37af19f5e8aaa9ec2346dde6f</id>
<content type='text'>
Inspired by this comment
https://github.com/llvm/llvm-project/pull/157930#issuecomment-3346634290
(and long-standing issues related to finding nanobind/pybind in the
right place), this PR moves to using `FetchContent_Declare` to get the
nanobind dependency. This is pretty standard (see e.g.,
[IREE](https://github.com/iree-org/iree/blob/cf60359b7443b0e92e15fb6ffc011525dc40e772/CMakeLists.txt#L842-L848)).
This PR also removes pybind which has been deprecated for almost a year
(https://github.com/llvm/llvm-project/pull/117922) and which isn't
compatible (for whatever reason) with `FetchContent_Declare`.

---------

Co-authored-by: Jacques Pienaar &lt;jpienaar@google.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Inspired by this comment
https://github.com/llvm/llvm-project/pull/157930#issuecomment-3346634290
(and long-standing issues related to finding nanobind/pybind in the
right place), this PR moves to using `FetchContent_Declare` to get the
nanobind dependency. This is pretty standard (see e.g.,
[IREE](https://github.com/iree-org/iree/blob/cf60359b7443b0e92e15fb6ffc011525dc40e772/CMakeLists.txt#L842-L848)).
This PR also removes pybind which has been deprecated for almost a year
(https://github.com/llvm/llvm-project/pull/117922) and which isn't
compatible (for whatever reason) with `FetchContent_Declare`.

---------

Co-authored-by: Jacques Pienaar &lt;jpienaar@google.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Python] don't generate type stubs when cross-compiling (#160793)</title>
<updated>2025-09-25T23:59:12+00:00</updated>
<author>
<name>Maksim Levental</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2025-09-25T23:59:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f6ded0be897e2878612dd903f7e8bb85448269e5'/>
<id>f6ded0be897e2878612dd903f7e8bb85448269e5</id>
<content type='text'>
Stubgen doesn't work when cross-compiling (stubgen will run in the host
interpreter and then fail to find the extension module for the host
arch). So disable it when `CMAKE_CROSSCOMPILING=ON`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Stubgen doesn't work when cross-compiling (stubgen will run in the host
interpreter and then fail to find the extension module for the host
arch). So disable it when `CMAKE_CROSSCOMPILING=ON`.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Standalone] use narrow registration instead of RegisterEverything (#160469)</title>
<updated>2025-09-24T20:13:18+00:00</updated>
<author>
<name>Maksim Levental</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2025-09-24T20:13:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f963d17f898c801193da3dafb40b29c62b622b68'/>
<id>f963d17f898c801193da3dafb40b29c62b622b68</id>
<content type='text'>
This PR cleans up a long-standing TODO by avoiding
`MLIRPythonExtension.RegisterEverything` in the Standalone example and
registering the necessary dialects explicitly instead.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR cleans up a long-standing TODO by avoiding
`MLIRPythonExtension.RegisterEverything` in the Standalone example and
registering the necessary dialects explicitly instead.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Python] quiet stubgen (#160368)</title>
<updated>2025-09-24T01:08:51+00:00</updated>
<author>
<name>Maksim Levental</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2025-09-24T01:08:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=79ad1bf1dbfaee5d7b3459610e12dc75b883b45d'/>
<id>79ad1bf1dbfaee5d7b3459610e12dc75b883b45d</id>
<content type='text'>
Silence all stdout from stubgen unless `VERBOSE` is passed to
`mlir_generate_type_stubs`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Silence all stdout from stubgen unless `VERBOSE` is passed to
`mlir_generate_type_stubs`.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Python] reland (narrower) type stub generation (#157930)</title>
<updated>2025-09-20T18:47:32+00:00</updated>
<author>
<name>Maksim Levental</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2025-09-20T18:47:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=efd96afedf2c0f6f2cc34cf5a9a7e3e78f592255'/>
<id>efd96afedf2c0f6f2cc34cf5a9a7e3e78f592255</id>
<content type='text'>
This a reland of https://github.com/llvm/llvm-project/pull/155741 which
was reverted at https://github.com/llvm/llvm-project/pull/157831. This
version is narrower in scope - it only turns on automatic stub
generation for `MLIRPythonExtension.Core._mlir` and **does not do
anything automatically**. Specifically, the only CMake code added to
`AddMLIRPython.cmake` is the `mlir_generate_type_stubs` function which
is then used only in a manual way. The API for
`mlir_generate_type_stubs` is:

```
Arguments:
  MODULE_NAME: The fully-qualified name of the extension module (used for importing in python).
  DEPENDS_TARGETS: List of targets these type stubs depend on being built; usually corresponding to the
    specific extension module (e.g., something like StandalonePythonModules.extension._standaloneDialectsNanobind.dso)
    and the core bindings extension module (e.g., something like StandalonePythonModules.extension._mlir.dso).
  OUTPUT_DIR: The root output directory to emit the type stubs into.
  OUTPUTS: List of expected outputs.
  DEPENDS_TARGET_SRC_DEPS: List of cpp sources for extension library (for generating a DEPFILE).
  IMPORT_PATHS: List of paths to add to PYTHONPATH for stubgen.
  PATTERN_FILE: (Optional) Pattern file (see https://nanobind.readthedocs.io/en/latest/typing.html#pattern-files).
Outputs:
  NB_STUBGEN_CUSTOM_TARGET: The target corresponding to generation which other targets can depend on.
```

Downstream users should use `mlir_generate_type_stubs` in coordination
with `declare_mlir_python_sources` to turn on stub generation for their
own downstream dialect extensions and upstream dialect extensions if
they so choose. Standalone example shows an example.

Note, downstream will also need to set
`-DMLIR_PYTHON_PACKAGE_PREFIX=...` correctly for their bindings.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This a reland of https://github.com/llvm/llvm-project/pull/155741 which
was reverted at https://github.com/llvm/llvm-project/pull/157831. This
version is narrower in scope - it only turns on automatic stub
generation for `MLIRPythonExtension.Core._mlir` and **does not do
anything automatically**. Specifically, the only CMake code added to
`AddMLIRPython.cmake` is the `mlir_generate_type_stubs` function which
is then used only in a manual way. The API for
`mlir_generate_type_stubs` is:

```
Arguments:
  MODULE_NAME: The fully-qualified name of the extension module (used for importing in python).
  DEPENDS_TARGETS: List of targets these type stubs depend on being built; usually corresponding to the
    specific extension module (e.g., something like StandalonePythonModules.extension._standaloneDialectsNanobind.dso)
    and the core bindings extension module (e.g., something like StandalonePythonModules.extension._mlir.dso).
  OUTPUT_DIR: The root output directory to emit the type stubs into.
  OUTPUTS: List of expected outputs.
  DEPENDS_TARGET_SRC_DEPS: List of cpp sources for extension library (for generating a DEPFILE).
  IMPORT_PATHS: List of paths to add to PYTHONPATH for stubgen.
  PATTERN_FILE: (Optional) Pattern file (see https://nanobind.readthedocs.io/en/latest/typing.html#pattern-files).
Outputs:
  NB_STUBGEN_CUSTOM_TARGET: The target corresponding to generation which other targets can depend on.
```

Downstream users should use `mlir_generate_type_stubs` in coordination
with `declare_mlir_python_sources` to turn on stub generation for their
own downstream dialect extensions and upstream dialect extensions if
they so choose. Standalone example shows an example.

Note, downstream will also need to set
`-DMLIR_PYTHON_PACKAGE_PREFIX=...` correctly for their bindings.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR] enable Standalone example test for Windows (#158183)</title>
<updated>2025-09-12T18:34:44+00:00</updated>
<author>
<name>Maksim Levental</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2025-09-12T18:34:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1a6b2b64b6fbbb33ce65ae27a3a9ded4545b48aa'/>
<id>1a6b2b64b6fbbb33ce65ae27a3a9ded4545b48aa</id>
<content type='text'>
This PR turns on all Standalone tests for Windows except for the plugins (which aren't enabled by default).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR turns on all Standalone tests for Windows except for the plugins (which aren't enabled by default).</pre>
</div>
</content>
</entry>
<entry>
<title>Revert stubgen-related patches (#157831)</title>
<updated>2025-09-10T11:35:38+00:00</updated>
<author>
<name>Oleksandr "Alex" Zinenko</name>
<email>git@ozinenko.com</email>
</author>
<published>2025-09-10T11:35:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0a83e96f6616c79a2ac63588a550ed420798791f'/>
<id>0a83e96f6616c79a2ac63588a550ed420798791f</id>
<content type='text'>
Despite several hotfixes, things remain broken, in particular:

- installation/distribution (`ninja install / install-distribution`);
- downstream projects with bindings exposed.

See
https://github.com/llvm/llvm-project/pull/157583#issuecomment-3274164357
for more details.

Reverts #155741, #157583, #157697. Let's make sure things are fixed and
re-land as a unit.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Despite several hotfixes, things remain broken, in particular:

- installation/distribution (`ninja install / install-distribution`);
- downstream projects with bindings exposed.

See
https://github.com/llvm/llvm-project/pull/157583#issuecomment-3274164357
for more details.

Reverts #155741, #157583, #157697. Let's make sure things are fixed and
re-land as a unit.</pre>
</div>
</content>
</entry>
</feed>
