<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/CAPI/IR/IR.cpp, branch users/nico/python-1</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] Add utils for more pythonic context creation and registration management</title>
<updated>2025-07-04T08:51:43+00:00</updated>
<author>
<name>Nicolas Vasilache</name>
<email>nico.vasilache@amd.com</email>
</author>
<published>2025-07-04T08:32:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2b8f82b2bad6b2ada988fb2b874d676aa748a35b'/>
<id>2b8f82b2bad6b2ada988fb2b874d676aa748a35b</id>
<content type='text'>
Co-authored-by: Fabian Mora &lt;fmora.dev@gmail.com
Co-authored-by: Oleksandr "Alex" Zinenko &lt;git@ozinenko.com&gt;
Co-authored-by: Tres &lt;tpopp@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Fabian Mora &lt;fmora.dev@gmail.com
Co-authored-by: Oleksandr "Alex" Zinenko &lt;git@ozinenko.com&gt;
Co-authored-by: Tres &lt;tpopp@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][python] bind block predecessors and successors (#145116)</title>
<updated>2025-06-23T23:59:03+00:00</updated>
<author>
<name>Maksim Levental</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2025-06-23T23:59:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a2aa812a31733f174cc15b1df30a1527f3f3ea9a'/>
<id>a2aa812a31733f174cc15b1df30a1527f3f3ea9a</id>
<content type='text'>
bind `block.getSuccessor` and `block.getPredecessors`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
bind `block.getSuccessor` and `block.getPredecessors`.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][py] Add PyThreadPool as wrapper around MlirLlvmThreadPool in MLIR python bindings (#130109)</title>
<updated>2025-03-10T10:19:23+00:00</updated>
<author>
<name>vfdev</name>
<email>vfdev.5@gmail.com</email>
</author>
<published>2025-03-10T10:19:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ab18cc246c2490564043161db5d9646cf1163de4'/>
<id>ab18cc246c2490564043161db5d9646cf1163de4</id>
<content type='text'>
In some projects like JAX ir.Context are used with disabled multi-threading to avoid
caching multiple threading pools:

https://github.com/jax-ml/jax/blob/623865fe9538100d877ba9d36f788d0f95a11ed2/jax/_src/interpreters/mlir.py#L606-L611

However, when context has enabled multithreading it also uses locks on
the StorageUniquers and this can be helpful to avoid data races in the
multi-threaded execution (for example with free-threaded cpython,
https://github.com/jax-ml/jax/issues/26272).
With this PR user can enable the multi-threading: 1) enables additional
locking and 2) set a shared threading pool such that cached contexts can
have one global pool.

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In some projects like JAX ir.Context are used with disabled multi-threading to avoid
caching multiple threading pools:

https://github.com/jax-ml/jax/blob/623865fe9538100d877ba9d36f788d0f95a11ed2/jax/_src/interpreters/mlir.py#L606-L611

However, when context has enabled multithreading it also uses locks on
the StorageUniquers and this can be helpful to avoid data races in the
multi-threaded execution (for example with free-threaded cpython,
https://github.com/jax-ml/jax/issues/26272).
With this PR user can enable the multi-threading: 1) enables additional
locking and 2) set a shared threading pool such that cached contexts can
have one global pool.

</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][CAPI][python] bind CallSiteLoc, FileLineColRange, FusedLoc, NameLoc (#129351)</title>
<updated>2025-03-10T09:10:34+00:00</updated>
<author>
<name>Maksim Levental</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2025-03-10T09:10:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0264d42dc750666e0f57a85d57f563bc8ea43536'/>
<id>0264d42dc750666e0f57a85d57f563bc8ea43536</id>
<content type='text'>
This PR extends the python bindings for CallSiteLoc, FileLineColRange,
FusedLoc, NameLoc with field accessors. It also adds the missing
`value.location` accessor.

I also did some "spring cleaning" here (`cast` -&gt; `dyn_cast`) after
running into some of my own illegal casts.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR extends the python bindings for CallSiteLoc, FileLineColRange,
FusedLoc, NameLoc with field accessors. It also adds the missing
`value.location` accessor.

I also did some "spring cleaning" here (`cast` -&gt; `dyn_cast`) after
running into some of my own illegal casts.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][py] Plumb OpPrintingFlags::printNameLocAsPrefix() through the C/Python APIs (#129607)</title>
<updated>2025-03-04T19:49:34+00:00</updated>
<author>
<name>Jacques Pienaar</name>
<email>jpienaar@google.com</email>
</author>
<published>2025-03-04T19:49:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=540d7ddb152164c9969aa05344caebe3cb129096'/>
<id>540d7ddb152164c9969aa05344caebe3cb129096</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Python: Parse ModuleOp from file path (#126572)</title>
<updated>2025-02-12T22:02:41+00:00</updated>
<author>
<name>Nikhil Kalra</name>
<email>nkalra@apple.com</email>
</author>
<published>2025-02-12T22:02:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=65ed4fa57e6293f8e059a368ac52e2a57b1f78e4'/>
<id>65ed4fa57e6293f8e059a368ac52e2a57b1f78e4</id>
<content type='text'>
For extremely large models, it may be inefficient to load the model into
memory in Python prior to passing it to the MLIR C APIs for
deserialization. This change adds an API to parse a ModuleOp directly
from a file path.

Re-lands
[4e14b8a](https://github.com/llvm/llvm-project/commit/4e14b8afb44af58ab7073bb8c0b52875599b0ae1).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For extremely large models, it may be inefficient to load the model into
memory in Python prior to passing it to the MLIR C APIs for
deserialization. This change adds an API to parse a ModuleOp directly
from a file path.

Re-lands
[4e14b8a](https://github.com/llvm/llvm-project/commit/4e14b8afb44af58ab7073bb8c0b52875599b0ae1).</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[mlir] Python: Parse ModuleOp from file path" (#126482)</title>
<updated>2025-02-10T08:09:58+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2025-02-10T08:09:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=67b7a2590f39ad9ff5413adb9af162220972833e'/>
<id>67b7a2590f39ad9ff5413adb9af162220972833e</id>
<content type='text'>
Reverts llvm/llvm-project#125736

The gcc7 Bot is broken at the moment.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#125736

The gcc7 Bot is broken at the moment.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Python: Parse ModuleOp from file path (#125736)</title>
<updated>2025-02-05T19:48:37+00:00</updated>
<author>
<name>Nikhil Kalra</name>
<email>nkalra@apple.com</email>
</author>
<published>2025-02-05T19:48:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4e14b8afb44af58ab7073bb8c0b52875599b0ae1'/>
<id>4e14b8afb44af58ab7073bb8c0b52875599b0ae1</id>
<content type='text'>
For extremely large models, it may be inefficient to load the model into
memory in Python prior to passing it to the MLIR C APIs for
deserialization. This change adds an API to parse a ModuleOp directly
from a file path.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For extremely large models, it may be inefficient to load the model into
memory in Python prior to passing it to the MLIR C APIs for
deserialization. This change adds an API to parse a ModuleOp directly
from a file path.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Add C and Python interface for file range (#123276)</title>
<updated>2025-01-22T22:33:19+00:00</updated>
<author>
<name>Jacques Pienaar</name>
<email>jpienaar@google.com</email>
</author>
<published>2025-01-22T22:33:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a77250fd782530f42a90f8562bcef0eb26abb010'/>
<id>a77250fd782530f42a90f8562bcef0eb26abb010</id>
<content type='text'>
Plumbs through creating file ranges to C and Python.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Plumbs through creating file ranges to C and Python.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir,python] Expose replaceAllUsesExcept to Python bindings (#115850)</title>
<updated>2024-11-20T00:00:57+00:00</updated>
<author>
<name>Perry Gibson</name>
<email>Wheest@users.noreply.github.com</email>
</author>
<published>2024-11-20T00:00:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=21df32511b558b2c1e24fe23f677fffaad4da333'/>
<id>21df32511b558b2c1e24fe23f677fffaad4da333</id>
<content type='text'>
Problem originally described in [the forums
here](https://discourse.llvm.org/t/mlir-python-expose-replaceallusesexcept/83068/1).

Using the MLIR Python bindings, the method
[`replaceAllUsesWith`](https://mlir.llvm.org/doxygen/classmlir_1_1Value.html#ac56b0fdb6246bcf7fa1805ba0eb71aa2)
for `Value` is exposed, e.g.,

```python
orig_value.replace_all_uses_with(
    new_value               
)
```

However, in my use-case I am separating a block into multiple blocks, so
thus want to exclude certain Operations from having their Values
replaced (since I want them to diverge).

Within Value, we have
[`replaceAllUsesExcept`](https://mlir.llvm.org/doxygen/classmlir_1_1Value.html#a9ec8d5c61f8a6aada4062f609372cce4),
where we can pass the Operations which should be skipped.

This is not currently exposed in the Python bindings: this PR fixes
this. Adds `replace_all_uses_except`, which works with individual
Operations, and lists of Operations.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem originally described in [the forums
here](https://discourse.llvm.org/t/mlir-python-expose-replaceallusesexcept/83068/1).

Using the MLIR Python bindings, the method
[`replaceAllUsesWith`](https://mlir.llvm.org/doxygen/classmlir_1_1Value.html#ac56b0fdb6246bcf7fa1805ba0eb71aa2)
for `Value` is exposed, e.g.,

```python
orig_value.replace_all_uses_with(
    new_value               
)
```

However, in my use-case I am separating a block into multiple blocks, so
thus want to exclude certain Operations from having their Values
replaced (since I want them to diverge).

Within Value, we have
[`replaceAllUsesExcept`](https://mlir.llvm.org/doxygen/classmlir_1_1Value.html#a9ec8d5c61f8a6aada4062f609372cce4),
where we can pass the Operations which should be skipped.

This is not currently exposed in the Python bindings: this PR fixes
this. Adds `replace_all_uses_except`, which works with individual
Operations, and lists of Operations.</pre>
</div>
</content>
</entry>
</feed>
