Skip to main content

Efficient in-memory representation for ONNX

Project description

ONNX IR

PyPI - Version PyPI - Python Version Ruff codecov DeepWiki

An in-memory IR that supports the full ONNX spec, designed for graph construction, analysis and transformation.

Features ✨

  • Full ONNX spec support: all valid models representable by ONNX protobuf, and a subset of invalid models (so you can load and fix them).
  • Low memory footprint: mmap'ed external tensors; unified interface for ONNX TensorProto, Numpy arrays and PyTorch Tensors etc. No tensor size limitation. Zero copies.
  • Straightforward access patterns: Access value information and traverse the graph topology at ease.
  • Robust mutation: Create as many iterators as you like on the graph while mutating it.
  • Speed: Performant graph manipulation, serialization/deserialization to Protobuf.
  • Pythonic and familiar APIs: Classes define Pythonic apis and still map to ONNX protobuf concepts in an intuitive way.
  • No protobuf dependency: The IR does not require protobuf once the model is converted to the IR representation, decoupling from the serialization format.

Code Organization 🗺️

  • _protocols.py: Interfaces defined for all entities in the IR.
  • _core.py: Implementation of the core entities in the IR, including Model, Graph, Node, Value, and others.
  • _enums.py: Definition of the type enums that correspond to the DataType and AttributeType in onnx.proto.
  • _name_authority.py: The authority for giving names to entities in the graph, used internally.
  • _linked_list.py: The data structure as the node container in the graph that supports robust iteration and mutation. Internal.
  • _metadata.py: Metadata store for all entities in the IR.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onnx_ir-0.1.1.tar.gz (100.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onnx_ir-0.1.1-py3-none-any.whl (112.9 kB view details)

Uploaded Python 3

File details

Details for the file onnx_ir-0.1.1.tar.gz.

File metadata

  • Download URL: onnx_ir-0.1.1.tar.gz
  • Upload date:
  • Size: 100.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for onnx_ir-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d5e12e21c73bb5030b01512b3583d4bb9899fc40ecd460eed87481e35fa03d58
MD5 99dc267d4d861d85f605220fb751df54
BLAKE2b-256 266996cdb61a2a09ea113ceb9be0a873503ce4caaf5afc1ee9362882f6cc0977

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnx_ir-0.1.1.tar.gz:

Publisher: main.yml on onnx/ir-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onnx_ir-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: onnx_ir-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 112.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for onnx_ir-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e8567cb8922594717df2d7f794db99641c5ac09b985d5e866dda426e6b793d85
MD5 9cab30c8f0f9bb8585687fc64e8c8cc1
BLAKE2b-256 675415114e0d298f567822fc92d1a6c174fff9e4a1c76412cbfb82349291612d

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnx_ir-0.1.1-py3-none-any.whl:

Publisher: main.yml on onnx/ir-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page