commit | 247de366d03d7a4dc0eb7a960e089abaa48a496d | [log] [tgz] |
---|---|---|
author | maxbartel <bartel@roofline.ai> | Tue Jun 25 17:25:30 2024 +0200 |
committer | GitHub <noreply@github.com> | Tue Jun 25 17:25:30 2024 +0200 |
tree | 8405e79fcdc0d5cf8f0693d25b2f21ab52b0bc21 | |
parent | 1f69b857fffb2367682b436684cd9868329cd109 [diff] |
[Python API] Fix python api for bytecode (#17343) This fixes an issue seen in https://github.com/iree-org/iree/pull/17278. MLIR bytecode can have a zero as the last byte depending on the IR. If this happens by accident parsing will fail. This PR checks if a buffer begins with the _magic number_ from https://mlir.llvm.org/docs/BytecodeFormat/#magic-number and sets zero-termination to false if it does. However I could not generate MLIR bytecode that ends with a zero other than the one in the PR. Even if I save the IR used in textual format and parse it again, some additional bytes are appended and it is not zero terminated anymore. I think this is because of some behavior in TF. Still after reading a bit through https://mlir.llvm.org/docs/BytecodeFormat I think the check implemented in this PR is the correct behavior for bytecode. --------- Signed-off-by: Maximilian Bartel <bartel@roofline.ai>
IREE (Intermediate Representation Execution Environment, pronounced as “eerie”) is an MLIR-based end-to-end compiler and runtime that lowers Machine Learning (ML) models to a unified IR that scales up to meet the needs of the datacenter and down to satisfy the constraints and special considerations of mobile and edge deployments.
See our website for project details, user guides, and instructions on building from source.
IREE is still in its early phase. We have settled down on the overarching infrastructure and are actively improving various software components as well as project logistics. It is still quite far from ready for everyday use and is made available without any support at the moment. With that said, we welcome any kind of feedback on any communication channels!
See our website for more information.
Community meeting recordings: IREE YouTube channel
IREE is licensed under the terms of the Apache 2.0 License with LLVM Exceptions. See LICENSE for more information.