Skip to content

Use onnx_ir as a dependency #2324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- py311-torch-nightly
- py311-onnx-weekly
- py311-ort-nightly
- py311-onnx-ir-git
- py310
include:
- name: py312
Expand All @@ -51,6 +52,9 @@ jobs:
- name: py311-ort-nightly
python-version: "3.11"
nox-tag: test-ort-nightly
- name: py311-onnx-ir-git
python-version: "3.11"
nox-tag: test-onnx-ir-git
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
20 changes: 0 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ models using a subset of Python. ONNX Script is:

This repo also covers:

* **ONNX IR:** an in-memory IR that supports the full ONNX spec, designed
for graph construction, analysis and transformation.
* **ONNX Script Optimizer:** provides functionality to optimize an ONNX
model by performing optimizations and clean-ups such as constant folding,
dead code elimination, etc.
Expand Down Expand Up @@ -152,24 +150,6 @@ result = Hardmax(v)

More examples can be found in the [docs/examples](docs/examples) directory.

## ONNX IR

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.

## ONNX Script Tools

### ONNX Optimizer
Expand Down
386 changes: 0 additions & 386 deletions docs/ir/getting_started.ipynb

This file was deleted.

22 changes: 2 additions & 20 deletions docs/ir/index.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
# ONNX IR

An in-memory IR that supports the full ONNX spec, designed for graph construction, analysis and transformation.
ONNX IR is now an official ONNX project! Documentation has been migrated to [onnx.ai/ir-py/](https://onnx.ai/ir-py/).

## 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.

## Get started

```{toctree}
:maxdepth: 1

getting_started
tensors
ir_api/index
```
You may continue to use `onnxscript.ir` unchanged for compatibility with older (<0.3) versions of ONNX Script.
65 changes: 0 additions & 65 deletions docs/ir/ir_api/core.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/ir/ir_api/index.md

This file was deleted.

15 changes: 0 additions & 15 deletions docs/ir/ir_api/ir_convenience.md

This file was deleted.

20 changes: 0 additions & 20 deletions docs/ir/ir_api/ir_external_data.md

This file was deleted.

39 changes: 0 additions & 39 deletions docs/ir/ir_api/ir_passes.md

This file was deleted.

12 changes: 0 additions & 12 deletions docs/ir/ir_api/ir_passes_common.md

This file was deleted.

18 changes: 0 additions & 18 deletions docs/ir/ir_api/ir_tape.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/ir/ir_api/ir_traversal.md

This file was deleted.

Loading
Loading