Skip to content

Commit 450462c

Browse files
authored
1 parent 7c3ad9e commit 450462c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

mlir/docs/BytecodeFormat.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
# MLIR Bytecode Format
22

33
This documents describes the MLIR bytecode format and its encoding.
4+
This format is versioned and stable: we don't plan to ever break
5+
compatibility, that is a dialect should be able to deserialize and
6+
older bytecode. Similarly, we support back-deployment we an older
7+
version of the format can be targetted.
8+
9+
That said, it is important to realize that the promises of the
10+
bytecode format are made assuming immutable dialects: the format
11+
allows backward and forward compatibility, but only when nothing
12+
in a dialect changes (operations, types, attributes definitions).
13+
14+
A dialect can opt-in to handle its own versioning through the
15+
`BytecodeDialectInterface`. Some hooks are exposed to the dialect
16+
to allow managing a version encoded into the bytecode file. The
17+
version is loaded lazily and allows to retrieve the version
18+
information while decoding the input IR, and gives an opportunity
19+
to each dialect for which a version is present to perform IR
20+
upgrades post-parsing through the `upgradeFromVersion` method.
21+
There is no restriction on what kind of information a dialect
22+
is allowed to encode to model its versioning
423

524
[TOC]
625

0 commit comments

Comments
 (0)