<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/test/python/dialects/sparse_tensor, 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] Port in-tree dialects to nanobind. (#119924)</title>
<updated>2024-12-21T04:32:32+00:00</updated>
<author>
<name>Peter Hawkins</name>
<email>phawkins@google.com</email>
</author>
<published>2024-12-21T04:32:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5cd427477218d8bdb659c6c53a7758f741c3990a'/>
<id>5cd427477218d8bdb659c6c53a7758f741c3990a</id>
<content type='text'>
This is a companion to #118583, although it can be landed independently
because since #117922 dialects do not have to use the same Python
binding framework as the Python core code.

This PR ports all of the in-tree dialect and pass extensions to
nanobind, with the exception of those that remain for testing pybind11
support.

This PR also:
* removes CollectDiagnosticsToStringScope from NanobindAdaptors.h. This
was overlooked in a previous PR and it is duplicated in Diagnostics.h.

---------

Co-authored-by: Jacques Pienaar &lt;jpienaar@google.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a companion to #118583, although it can be landed independently
because since #117922 dialects do not have to use the same Python
binding framework as the Python core code.

This PR ports all of the in-tree dialect and pass extensions to
nanobind, with the exception of those that remain for testing pybind11
support.

This PR also:
* removes CollectDiagnosticsToStringScope from NanobindAdaptors.h. This
was overlooked in a previous PR and it is duplicated in Diagnostics.h.

---------

Co-authored-by: Jacques Pienaar &lt;jpienaar@google.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Python] Add `encoding` argument to `tensor.empty` Python function (#110656)</title>
<updated>2024-10-01T20:48:00+00:00</updated>
<author>
<name>Mateusz Sokół</name>
<email>8431159+mtsokol@users.noreply.github.com</email>
</author>
<published>2024-10-01T20:48:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a9746675a505bc891c97dfcd1dbb480cf93116d5'/>
<id>a9746675a505bc891c97dfcd1dbb480cf93116d5</id>
<content type='text'>
Hi @xurui1995 @makslevental,

I think in https://github.com/llvm/llvm-project/pull/103087 there's
unintended regression where user can no longer create sparse tensors
with `tensor.empty`.

Previously I could pass:
```python
out = tensor.empty(tensor_type, [])
```
where `tensor_type` contained `shape`, `dtype`, and `encoding`.

With the latest 
```python
tensor.empty(sizes: Sequence[Union[int, Value]], element_type: Type, *, loc=None, ip=None)
```
it's no longer possible.

I propose to add `encoding` argument which is passed to
`RankedTensorType.get(static_sizes, element_type, encoding)` (I updated
one of the tests to check it).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Hi @xurui1995 @makslevental,

I think in https://github.com/llvm/llvm-project/pull/103087 there's
unintended regression where user can no longer create sparse tensors
with `tensor.empty`.

Previously I could pass:
```python
out = tensor.empty(tensor_type, [])
```
where `tensor_type` contained `shape`, `dtype`, and `encoding`.

With the latest 
```python
tensor.empty(sizes: Sequence[Union[int, Value]], element_type: Type, *, loc=None, ip=None)
```
it's no longer possible.

I propose to add `encoding` argument which is passed to
`RankedTensorType.get(static_sizes, element_type, encoding)` (I updated
one of the tests to check it).</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][sparse] Enable explicit and implicit value in sparse encoding (#88975)</title>
<updated>2024-04-24T23:20:25+00:00</updated>
<author>
<name>Yinying Li</name>
<email>yinyingli@google.com</email>
</author>
<published>2024-04-24T23:20:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a10d67f9fb559d0c35a12b2d26974636bbf642c0'/>
<id>a10d67f9fb559d0c35a12b2d26974636bbf642c0</id>
<content type='text'>
1. Explicit value means the non-zero value in a sparse tensor. If
explicitVal is set, then all the non-zero values in the tensor have the
same explicit value. The default value Attribute() indicates that it is
not set.

2. Implicit value means the "zero" value in a sparse tensor. If
implicitVal is set, then the "zero" value in the tensor is equal to the
implicit value. For now, we only support `0` as the implicit value but
it could be extended in the future. The default value Attribute()
indicates that the implicit value is `0` (same type as the tensor
element type).

Example:

```
#CSR = #sparse_tensor.encoding&lt;{
  map = (d0, d1) -&gt; (d0 : dense, d1 : compressed),
  posWidth = 64,
  crdWidth = 64,
  explicitVal = 1 : i64,
  implicitVal = 0 : i64
}&gt;
```

Note: this PR tests that implicitVal could be set to other values as
well. The following PR will add verifier and reject any value that's not
zero for implicitVal.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. Explicit value means the non-zero value in a sparse tensor. If
explicitVal is set, then all the non-zero values in the tensor have the
same explicit value. The default value Attribute() indicates that it is
not set.

2. Implicit value means the "zero" value in a sparse tensor. If
implicitVal is set, then the "zero" value in the tensor is equal to the
implicit value. For now, we only support `0` as the implicit value but
it could be extended in the future. The default value Attribute()
indicates that the implicit value is `0` (same type as the tensor
element type).

Example:

```
#CSR = #sparse_tensor.encoding&lt;{
  map = (d0, d1) -&gt; (d0 : dense, d1 : compressed),
  posWidth = 64,
  crdWidth = 64,
  explicitVal = 1 : i64,
  implicitVal = 0 : i64
}&gt;
```

Note: this PR tests that implicitVal could be set to other values as
well. The following PR will add verifier and reject any value that's not
zero for implicitVal.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][sparse] Introduce batch level format. (#83082)</title>
<updated>2024-02-27T00:08:28+00:00</updated>
<author>
<name>Peiming Liu</name>
<email>36770114+PeimingLiu@users.noreply.github.com</email>
</author>
<published>2024-02-27T00:08:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=56d58295dd492b8e8a011fa60798d9be4f36ec3c'/>
<id>56d58295dd492b8e8a011fa60798d9be4f36ec3c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][sparse][pybind][CAPI] remove LevelType enum from CAPI, constru… (#81682)</title>
<updated>2024-02-14T00:45:22+00:00</updated>
<author>
<name>Peiming Liu</name>
<email>36770114+PeimingLiu@users.noreply.github.com</email>
</author>
<published>2024-02-14T00:45:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=429919e32823ad735a19ab385f37e313512cedde'/>
<id>429919e32823ad735a19ab385f37e313512cedde</id>
<content type='text'>
…ct LevelType from LevelFormat and properties instead.

**Rationale**
We used to explicitly declare every possible combination between
`LevelFormat` and `LevelProperties`, and it now becomes difficult to
scale as more properties/level formats are going to be introduced.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
…ct LevelType from LevelFormat and properties instead.

**Rationale**
We used to explicitly declare every possible combination between
`LevelFormat` and `LevelProperties`, and it now becomes difficult to
scale as more properties/level formats are going to be introduced.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][sparse] Add more tests and verification for n:m (#81186)</title>
<updated>2024-02-09T19:34:36+00:00</updated>
<author>
<name>Yinying Li</name>
<email>107574043+yinying-lisa-li@users.noreply.github.com</email>
</author>
<published>2024-02-09T19:34:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2a6b521b36fb538a49564323ecd457d7b08b1325'/>
<id>2a6b521b36fb538a49564323ecd457d7b08b1325</id>
<content type='text'>
1. Add python test for n out of m
2. Add more methods for python binding
3. Add verification for n:m and invalid encoding tests
4. Add e2e test for n:m

Previous PRs for n:m #80501 #79935</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. Add python test for n out of m
2. Add more methods for python binding
3. Add verification for n:m and invalid encoding tests
4. Add e2e test for n:m

Previous PRs for n:m #80501 #79935</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][sparse] Implement parsing n out of m (#79935)</title>
<updated>2024-02-08T19:38:42+00:00</updated>
<author>
<name>Yinying Li</name>
<email>107574043+yinying-lisa-li@users.noreply.github.com</email>
</author>
<published>2024-02-08T19:38:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e5924d64991abb4da111317ff5e8d9147265354a'/>
<id>e5924d64991abb4da111317ff5e8d9147265354a</id>
<content type='text'>
1. Add parsing methods for block[n, m].
2. Encode n and m with the newly extended 64-bit LevelType enum.
3. Update 2:4 methods names/comments to n:m.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. Add parsing methods for block[n, m].
2. Encode n and m with the newly extended 64-bit LevelType enum.
3. Update 2:4 methods names/comments to n:m.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][sparse] Change LevelType enum to 64 bit (#80501)</title>
<updated>2024-02-05T22:00:52+00:00</updated>
<author>
<name>Yinying Li</name>
<email>107574043+yinying-lisa-li@users.noreply.github.com</email>
</author>
<published>2024-02-05T22:00:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cd481fa827b76953cd12dae9319face96670c0b3'/>
<id>cd481fa827b76953cd12dae9319face96670c0b3</id>
<content type='text'>
1. C++ enum is set through enum class LevelType : uint_64.
2. C enum is set through typedef uint_64 level_type. It is due to the
limitations in Windows build: setting enum width to ui64 is not
supported in C.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. C++ enum is set through enum class LevelType : uint_64.
2. C enum is set through typedef uint_64 level_type. It is due to the
limitations in Windows build: setting enum width to ui64 is not
supported in C.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][sparse] rename DimLevelType to LevelType (#73561)</title>
<updated>2023-11-27T22:27:52+00:00</updated>
<author>
<name>Aart Bik</name>
<email>39774503+aartbik@users.noreply.github.com</email>
</author>
<published>2023-11-27T22:27:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1944c4f76b47c0b86c91845987baca24fd4775f8'/>
<id>1944c4f76b47c0b86c91845987baca24fd4775f8</id>
<content type='text'>
The "Dim" prefix is a legacy left-over that no longer makes sense, since
we have a very strict "Dimension" vs. "Level" definition for sparse
tensor types and their storage.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The "Dim" prefix is a legacy left-over that no longer makes sense, since
we have a very strict "Dimension" vs. "Level" definition for sparse
tensor types and their storage.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][sparse] Return actual identity map instead of null map (#70365)</title>
<updated>2023-10-26T22:30:34+00:00</updated>
<author>
<name>Yinying Li</name>
<email>107574043+yinying-lisa-li@users.noreply.github.com</email>
</author>
<published>2023-10-26T22:30:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b165650aee851b15c4f87f0d510b37cb1bf6b814'/>
<id>b165650aee851b15c4f87f0d510b37cb1bf6b814</id>
<content type='text'>
Changes:

1. For both dimToLvl and lvlToDim, always returns the actual map instead
of AffineMap() for identity map.
2. Updated custom builder for encoding to have default values.
3. Non-inferable lvlToDim will still return AffineMap() during
inference, so it will be caught by verifier.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Changes:

1. For both dimToLvl and lvlToDim, always returns the actual map instead
of AffineMap() for identity map.
2. Updated custom builder for encoding to have default values.
3. Non-inferable lvlToDim will still return AffineMap() during
inference, so it will be caught by verifier.</pre>
</div>
</content>
</entry>
</feed>
