<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/test/Bytecode, 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] print/parse resource handle key quoted and escaped (#119746)</title>
<updated>2025-02-04T20:49:15+00:00</updated>
<author>
<name>Soren Lassen</name>
<email>sorenlassen@gmail.com</email>
</author>
<published>2025-02-04T20:49:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c8ca486573adc1affcedee02c6eedc49db3e9245'/>
<id>c8ca486573adc1affcedee02c6eedc49db3e9245</id>
<content type='text'>
resource keys have the problem that you can’t parse them from mlir
assembly if they have special or non-printable characters, but nothing
prevents you from specifying such a key when you create e.g. a
DenseResourceElementsAttr, and it works fine in other ways, including
bytecode emission and parsing

this PR solves the parsing by quoting and escaping keys with special or
non-printable characters in mlir assembly, in the same way as symbols,
e.g.:
```
module attributes {
  fst = dense_resource&lt;resource_fst&gt; : tensor&lt;2xf16&gt;,
  snd = dense_resource&lt;"resource\09snd"&gt; : tensor&lt;2xf16&gt;
} {}

{-#
  dialect_resources: {
    builtin: {
      resource_fst: "0x0200000001000200",
      "resource\09snd": "0x0200000008000900"
    }
  }
#-}
```

by not quoting keys without special or non-printable characters, the
change is effectively backwards compatible

the change is tested by:
1. adding a test with a dense resource handle key with special
characters to `dense-resource-elements-attr.mlir`
2. adding special and unprintable characters to some resource keys in
the existing lit tests `pretty-resources-print.mlir` and
`mlir/test/Bytecode/resources.mlir`</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
resource keys have the problem that you can’t parse them from mlir
assembly if they have special or non-printable characters, but nothing
prevents you from specifying such a key when you create e.g. a
DenseResourceElementsAttr, and it works fine in other ways, including
bytecode emission and parsing

this PR solves the parsing by quoting and escaping keys with special or
non-printable characters in mlir assembly, in the same way as symbols,
e.g.:
```
module attributes {
  fst = dense_resource&lt;resource_fst&gt; : tensor&lt;2xf16&gt;,
  snd = dense_resource&lt;"resource\09snd"&gt; : tensor&lt;2xf16&gt;
} {}

{-#
  dialect_resources: {
    builtin: {
      resource_fst: "0x0200000001000200",
      "resource\09snd": "0x0200000008000900"
    }
  }
#-}
```

by not quoting keys without special or non-printable characters, the
change is effectively backwards compatible

the change is tested by:
1. adding a test with a dense resource handle key with special
characters to `dense-resource-elements-attr.mlir`
2. adding special and unprintable characters to some resource keys in
the existing lit tests `pretty-resources-print.mlir` and
`mlir/test/Bytecode/resources.mlir`</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][bytecode] Fix external resource bytecode parsing (#97650)</title>
<updated>2024-07-03T22:32:45+00:00</updated>
<author>
<name>Jeff Niu</name>
<email>jeff@modular.com</email>
</author>
<published>2024-07-03T22:32:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=af7ee51a90beeb8198ceac0100c52b102543cf4b'/>
<id>af7ee51a90beeb8198ceac0100c52b102543cf4b</id>
<content type='text'>
The key was being dropped for external resources because they aren't
present in the dialect resource name mapper.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The key was being dropped for external resources because they aren't
present in the dialect resource name mapper.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][bytecode] Add bytecode writer config API to skip serialization of resources (#71991)</title>
<updated>2023-11-13T18:59:30+00:00</updated>
<author>
<name>Matteo Franciolini</name>
<email>m_franciolini@apple.com</email>
</author>
<published>2023-11-13T18:59:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4488f4933ee2a5326be643e8d1afec623c318fb9'/>
<id>4488f4933ee2a5326be643e8d1afec623c318fb9</id>
<content type='text'>
When serializing to bytecode, users can select the option to elide
resources from the bytecode file. This will instruct the bytecode writer
to serialize only the key and resource kind, while skipping
serialization of the data buffer. At parsing, the IR is built in memory
with valid (but empty) resource handlers.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When serializing to bytecode, users can select the option to elide
resources from the bytecode file. This will instruct the bytecode writer
to serialize only the key and resource kind, while skipping
serialization of the data buffer. At parsing, the IR is built in memory
with valid (but empty) resource handlers.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][bytecode] Implements back deployment capability for MLIR dialects (#70724)</title>
<updated>2023-10-31T22:41:29+00:00</updated>
<author>
<name>Matteo Franciolini</name>
<email>m_franciolini@apple.com</email>
</author>
<published>2023-10-31T22:41:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7ad9e9dcf518431a8ecedcc06b09df6c799658ef'/>
<id>7ad9e9dcf518431a8ecedcc06b09df6c799658ef</id>
<content type='text'>
When emitting bytecode, clients can specify a target dialect version to
emit in `BytecodeWriterConfig`. This exposes a target dialect version to
the DialectBytecodeWriter, which can be queried by name and used to
back-deploy attributes, types, and properties.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When emitting bytecode, clients can specify a target dialect version to
emit in `BytecodeWriterConfig`. This exposes a target dialect version to
the DialectBytecodeWriter, which can be queried by name and used to
back-deploy attributes, types, and properties.</pre>
</div>
</content>
</entry>
<entry>
<title>Finish renaming getOperandSegmentSizeAttr() from `operand_segment_sizes` to `operandSegmentSizes`</title>
<updated>2023-08-10T02:37:01+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2023-08-09T19:47:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=363b655920c49a4bcb0869f820ed40aac834eebd'/>
<id>363b655920c49a4bcb0869f820ed40aac834eebd</id>
<content type='text'>
This renaming started with the native ODS support for properties, this is completing it.

A mass automated textual rename seems safe for most codebases.
Drop also the ods prefix to keep the accessors the same as they were before
this change:
 properties.odsOperandSegmentSizes
reverts back to:
 properties.operandSegementSizes

The ODS prefix was creating divergence between all the places and make it harder to
be consistent.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D157173
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This renaming started with the native ODS support for properties, this is completing it.

A mass automated textual rename seems safe for most codebases.
Drop also the ods prefix to keep the accessors the same as they were before
this change:
 properties.odsOperandSegmentSizes
reverts back to:
 properties.operandSegementSizes

The ODS prefix was creating divergence between all the places and make it harder to
be consistent.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D157173
</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Bytecode] Add missing field initializer in constructor initializer list</title>
<updated>2023-08-03T06:31:01+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2023-08-03T05:50:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2ef44aa443ba38cbad9fb94027324ed277931c32'/>
<id>2ef44aa443ba38cbad9fb94027324ed277931c32</id>
<content type='text'>
Leaving this field unitialized could led to crashes when it'll diverge from the
IRNumbering phase.

Differential Revision: https://reviews.llvm.org/D156965
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Leaving this field unitialized could led to crashes when it'll diverge from the
IRNumbering phase.

Differential Revision: https://reviews.llvm.org/D156965
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for versioning properties in MLIR bytecode</title>
<updated>2023-07-29T02:44:33+00:00</updated>
<author>
<name>Matteo Franciolini</name>
<email>m_franciolini@apple.com</email>
</author>
<published>2023-07-28T19:47:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cf0e8dca8496660fc18a8bbbb4da765027f2080d'/>
<id>cf0e8dca8496660fc18a8bbbb4da765027f2080d</id>
<content type='text'>
[mlir] Add support for custom readProperties/writeProperties methods.

Currently, operations that opt-in to adopt properties will see auto-generated readProperties/writeProperties methods to emit and parse bytecode. If a dialects opts in to use `usePropertiesForAttributes`, those definitions will be generated for the current definition of the op without the possibility to handle attribute versioning.

The patch adds the capability for an operation to define its own read/write methods for the encoding of properties so that versioned operations can handle upgrading properties encodings.

In addition to this, the patch adds an example showing versioning on NamedProperties through the dialect version API exposed by the reader.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D155340
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[mlir] Add support for custom readProperties/writeProperties methods.

Currently, operations that opt-in to adopt properties will see auto-generated readProperties/writeProperties methods to emit and parse bytecode. If a dialects opts in to use `usePropertiesForAttributes`, those definitions will be generated for the current definition of the op without the possibility to handle attribute versioning.

The patch adds the capability for an operation to define its own read/write methods for the encoding of properties so that versioned operations can handle upgrading properties encodings.

In addition to this, the patch adds an example showing versioning on NamedProperties through the dialect version API exposed by the reader.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D155340
</pre>
</div>
</content>
</entry>
<entry>
<title>Expose callbacks for encoding of types/attributes</title>
<updated>2023-07-28T23:45:42+00:00</updated>
<author>
<name>Matteo Franciolini</name>
<email>m_franciolini@apple.com</email>
</author>
<published>2023-07-28T17:43:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bff6a4292f80d058c9eaf17c2b0532a780757cec'/>
<id>bff6a4292f80d058c9eaf17c2b0532a780757cec</id>
<content type='text'>
[mlir] Expose a mechanism to provide a callback for encoding types and attributes in MLIR bytecode.

Two callbacks are exposed, respectively, to the BytecodeWriterConfig and to the ParserConfig. At bytecode parsing/printing, clients have the ability to specify a callback to be used to optionally read/write the encoding. On failure, fallback path will execute the default parsers and printers for the dialect.

Testing shows how to leverage this functionality to support back-deployment and backward-compatibility usecases when roundtripping to bytecode a client dialect with type/attributes dependencies on upstream.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D153383
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[mlir] Expose a mechanism to provide a callback for encoding types and attributes in MLIR bytecode.

Two callbacks are exposed, respectively, to the BytecodeWriterConfig and to the ParserConfig. At bytecode parsing/printing, clients have the ability to specify a callback to be used to optionally read/write the encoding. On failure, fallback path will execute the default parsers and printers for the dialect.

Testing shows how to leverage this functionality to support back-deployment and backward-compatibility usecases when roundtripping to bytecode a client dialect with type/attributes dependencies on upstream.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D153383
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Expose callbacks for encoding of types/attributes"</title>
<updated>2023-07-28T23:45:42+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2023-07-28T23:44:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b86a13211fcd84bfae39066b51f9f079f970cea8'/>
<id>b86a13211fcd84bfae39066b51f9f079f970cea8</id>
<content type='text'>
This reverts commit b299ec16661f653df66cdaf161cdc5441bc9803c.

The authorship informations were incorrect.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit b299ec16661f653df66cdaf161cdc5441bc9803c.

The authorship informations were incorrect.
</pre>
</div>
</content>
</entry>
<entry>
<title>Expose callbacks for encoding of types/attributes</title>
<updated>2023-07-28T17:44:02+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2023-07-28T17:43:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b299ec16661f653df66cdaf161cdc5441bc9803c'/>
<id>b299ec16661f653df66cdaf161cdc5441bc9803c</id>
<content type='text'>
[mlir] Expose a mechanism to provide a callback for encoding types and attributes in MLIR bytecode.

Two callbacks are exposed, respectively, to the BytecodeWriterConfig and to the ParserConfig. At bytecode parsing/printing, clients have the ability to specify a callback to be used to optionally read/write the encoding. On failure, fallback path will execute the default parsers and printers for the dialect.

Testing shows how to leverage this functionality to support back-deployment and backward-compatibility usecases when roundtripping to bytecode a client dialect with type/attributes dependencies on upstream.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D153383
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[mlir] Expose a mechanism to provide a callback for encoding types and attributes in MLIR bytecode.

Two callbacks are exposed, respectively, to the BytecodeWriterConfig and to the ParserConfig. At bytecode parsing/printing, clients have the ability to specify a callback to be used to optionally read/write the encoding. On failure, fallback path will execute the default parsers and printers for the dialect.

Testing shows how to leverage this functionality to support back-deployment and backward-compatibility usecases when roundtripping to bytecode a client dialect with type/attributes dependencies on upstream.

Reviewed By: rriddle

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