Skip to content
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

v2.0 #78

Merged
merged 57 commits into from
Nov 21, 2023
Merged

v2.0 #78

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
d54b5ec
v2.0.0 alpha1
decahedron1 Aug 16, 2023
64de7ec
Merge branch 'main' into v2
decahedron1 Aug 16, 2023
2cf47df
fix: only provide key to EP register if option was set, fix #67
decahedron1 Aug 20, 2023
e8d72af
fix: clippy warnings
decahedron1 Aug 26, 2023
4956737
test smallvec; fix: C-owned Value lives for session
decahedron1 Aug 26, 2023
c1cfe87
fix: disable raqote text feature to fix ci
decahedron1 Aug 26, 2023
fc96e08
Merge branch 'main' into v2
decahedron1 Aug 27, 2023
cbf2e8c
Merge branch 'main' into v2
decahedron1 Aug 27, 2023
05eba28
fix upsample test
decahedron1 Aug 27, 2023
8787202
fix: export TVM EP structs
decahedron1 Aug 27, 2023
c2a6068
fix: impl DerefMut for session outputs
decahedron1 Aug 31, 2023
f71247e
Merge branch 'main' into v2
decahedron1 Oct 3, 2023
3f52715
refactor: use ArcArray to remove copy (#89)
bharrisau Oct 3, 2023
9a631f1
simplify, fix leaks & bad error messages
decahedron1 Oct 3, 2023
de7b70c
feat: not only TensorType for Input-Output params (#102)
ikrivosheev Oct 18, 2023
1517c3c
feat: add `with_enable_ort_custom_ops` to use builtin extensions (#103)
ruihe774 Oct 18, 2023
35f2613
feat: split sys into separate crate (#104)
ikrivosheev Oct 18, 2023
98fd656
refactor: less cows and less `IxDyn`s
decahedron1 Oct 22, 2023
b849ae2
fix ci?
decahedron1 Oct 22, 2023
eabeb6e
refactor: split out examples into crates
decahedron1 Oct 22, 2023
7b791f8
Merge branch 'main' into v2
decahedron1 Oct 22, 2023
86a31f6
fix: change field order to drop Environment last (#105)
acrrd Oct 23, 2023
965712d
Merge branch 'main' into v2
decahedron1 Oct 23, 2023
5ba1c50
chore: update to onnx runtime 1.16
decahedron1 Nov 1, 2023
cd172a4
docs: create docs website
decahedron1 Nov 1, 2023
93c6563
docs: fix site name
decahedron1 Nov 1, 2023
c1839a2
docs: update readme
decahedron1 Nov 2, 2023
a802cf4
refactor: cleanup type names, make custom ops optional
decahedron1 Nov 2, 2023
9653ae8
fix(sys): remove default features
decahedron1 Nov 2, 2023
a008fb5
fix: aarch64 build
decahedron1 Nov 2, 2023
84add5f
chore(sys): remove compile strategy
decahedron1 Nov 2, 2023
53904f5
fix: registration of `ExecutionProvider::CPU`
decahedron1 Nov 6, 2023
87a124e
fix(io-binding): take output values by (mut) reference
decahedron1 Nov 6, 2023
a79cc4f
chore: cleanup unused cmake toolchains
decahedron1 Nov 6, 2023
02ac039
chore: cleanup manifests, split license file
decahedron1 Nov 7, 2023
34f8161
whole bunch of changes
decahedron1 Nov 11, 2023
f13da64
fix aarch64 build
decahedron1 Nov 11, 2023
5c3b423
chore(sys): cleanup cargo manifest
decahedron1 Nov 12, 2023
5943276
fix: drop output names
decahedron1 Nov 12, 2023
b5bf80d
refactor: cleanup and check for null ptr on string array creation
decahedron1 Nov 12, 2023
fecc1ac
docs: update crate docs
decahedron1 Nov 12, 2023
98b0a0f
chore(examples): remove code from testing
decahedron1 Nov 12, 2023
073513b
feat: allow `with_model_downloaded` on url string
decahedron1 Nov 13, 2023
e5d8b6d
refactor: move example data to respective folders
decahedron1 Nov 13, 2023
4778871
docs(examples): add notes to gpt-2 example
JewishLewish Nov 13, 2023
c7af2c8
refactor(sys): cleanup out_dir search (#111)
JewishLewish Nov 13, 2023
e694ebc
feat: symlink dylibs to examples & test dirs
decahedron1 Nov 13, 2023
4af2b45
chore: update to onnxruntime 1.16.2
decahedron1 Nov 15, 2023
584a6e3
fix: mark session outputs as send
decahedron1 Nov 16, 2023
3838303
style(gpt2): convert doc comments to regular comments
decahedron1 Nov 20, 2023
ceeff0d
feat: download static libraries from pyke parcel
decahedron1 Nov 20, 2023
f4fc0c7
fix: fallback to copy if symlink fails on windows (ref #116)
decahedron1 Nov 20, 2023
0adf7f4
fix: link to static prerequisites with downloaded binaries
decahedron1 Nov 20, 2023
9b1bc6a
fix(sys): move stdc++ link after onnxruntime
decahedron1 Nov 21, 2023
c69064f
refactor: create environment in global OnceLock
decahedron1 Nov 21, 2023
d3aff34
ci(test): test macos + windows in main, run doctests
decahedron1 Nov 21, 2023
a4e731c
ci(test): fix cargo test
decahedron1 Nov 21, 2023
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
15 changes: 11 additions & 4 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,22 @@ on:
- '.cargo/**/*'
- 'tests/**/*'
- 'codecov.yml'
- 'ort-sys/build.rs'
- 'ort-sys/src/**/*.rs'
- 'ort-sys/wrapper.h'
- 'ort-sys/Cargo.toml'
pull_request:
paths:
- '.github/workflows/code-quality.yml'
- 'src/**/*.rs'
- 'build.rs'
- 'Cargo.toml'
- '.cargo/**/*'
- 'tests/**/*'
- 'codecov.yml'
- 'ort-sys/build.rs'
- 'ort-sys/src/**/*.rs'
- 'ort-sys/wrapper.h'
- 'ort-sys/Cargo.toml'
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
Expand All @@ -40,7 +47,7 @@ jobs:
- name: Check fmt
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-targets --features fetch-models
run: cargo clippy -p ort --all-targets --workspace --features fetch-models
coverage:
name: Code coverage
runs-on: ubuntu-latest
Expand All @@ -64,8 +71,8 @@ jobs:
run: cargo install cargo-tarpaulin
- name: Generate code coverage
run: |
cargo tarpaulin --features fetch-models --verbose --timeout 120 --out xml
cargo tarpaulin -p ort --features fetch-models --verbose --timeout 120 --out xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
fail_ci_if_error: false
23 changes: 11 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ env:
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-latest
- os: windows-latest
- os: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install stable Rust toolchain
Expand All @@ -35,25 +42,19 @@ jobs:
toolchain: stable
- uses: Swatinem/rust-cache@v1
- name: Run tests
# do not run doctests until rust-lang/cargo#10469 is merged
run: |
cargo test --verbose --lib --features fetch-models
cargo test -p ort --verbose --features fetch-models -- --test-threads 1
cross-compile:
name: Cross-platform compile
runs-on: ${{ matrix.platform.os }}
needs: [test]
strategy:
fail-fast: false
matrix:
platform:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
command: test
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
command: test
- target: x86_64-apple-darwin
os: macos-latest
command: test
steps:
- uses: actions/checkout@v4
- name: Fix ring dependency for Windows ARM64
Expand All @@ -73,6 +74,4 @@ jobs:
with:
command: ${{ matrix.platform.command }}
target: ${{ matrix.platform.target }}
args: "--features fetch-models"
env:
LC_ALL: C
args: "-p ort --features fetch-models"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,6 @@ WixTools/
**/*.ort
!tests/data/*.onnx
!tests/data/*.ort

# IDEA
.idea
75 changes: 34 additions & 41 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
[workspace]
members = [
'ort-sys',
'examples/gpt2',
'examples/yolov8'
]
default-members = [
'.',
'examples/gpt2',
'examples/yolov8'
]

[package]
name = "ort"
description = "A Rust wrapper for ONNX Runtime 1.15 - Optimize and Accelerate Machine Learning Inferencing"
version = "1.15.2"
description = "A safe Rust wrapper for ONNX Runtime 1.16 - Optimize and Accelerate Machine Learning Inferencing"
version = "2.0.0-alpha.0"
edition = "2021"
rust-version = "1.70"
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"
repository = "https://github.com/pykeio/ort"
documentation = "https://ort.pyke.io/"
readme = "README.md"
keywords = [ "machine-learning", "ai", "ml" ]
categories = [ "algorithms", "mathematics", "science" ]
categories = [ "algorithms", "mathematics", "science", "science" ]
authors = [
"pyke.io <[email protected]>",
"Nicolas Bigaouette <[email protected]>"
]
include = [ "src/", "examples/", "tests/", "toolchains/", "build.rs", "LICENSE", "README.md" ]
include = [ "src/", "examples/", "tests/", "LICENSE-APACHE", "LICENSE-MIT", "README.md" ]

[profile.release]
opt-level = 3
Expand All @@ -22,37 +35,29 @@ strip = true
codegen-units = 1

[package.metadata.docs.rs]
features = [ "half", "fetch-models", "copy-dylibs" ]

[[example]]
name = "gpt"
required-features = ["fetch-models"]
features = [ "ndarray", "half", "profiling", "custom-ops", "fetch-models", "copy-dylibs" ]
rustdoc-args = [ "--cfg", "docsrs" ]

[features]
default = [ "half", "download-binaries", "copy-dylibs" ]
default = [ "ndarray", "half", "download-binaries", "copy-dylibs" ]

profiling = [ "widestring" ]
custom-ops = [ "libc", "winapi" ]

fetch-models = [ "ureq" ]
download-binaries = [ "ureq", "zip" ]
load-dynamic = [ "libloading" ]
copy-dylibs = []

minimal-build = []
experimental = []
mimalloc = []
compile-static = []
download-binaries = [ "ort-sys/download-binaries" ]
load-dynamic = [ "libloading", "ort-sys/load-dynamic" ]
copy-dylibs = [ "ort-sys/copy-dylibs" ]

cuda = []
tensorrt = []
cuda = [ "ort-sys/cuda" ]
tensorrt = [ "ort-sys/tensorrt" ]
openvino = []
onednn = []
directml = []
snpe = []
nnapi = []
coreml = []
xnnpack = []
rocm = []
rocm = [ "ort-sys/rocm" ]
acl = []
armnn = []
tvm = []
Expand All @@ -63,20 +68,21 @@ cann = []
qnn = []

[dependencies]
ndarray = "0.15"
ndarray = { version = "0.15", optional = true }
thiserror = "1.0"
libloading = { version = "0.7", optional = true }
ort-sys = { version = "2.0.0-alpha.0", path = "ort-sys" }
libloading = { version = "0.8", optional = true }

ureq = { version = "2.1", optional = true, default-features = false, features = [ "tls" ] }
lazy_static = "1.4"
once_cell = "1.18"
tracing = "0.1"
half = { version = "2.1", optional = true }

[target.'cfg(unix)'.dependencies]
libc = "0.2"
libc = { version = "0.2", optional = true }

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = [ "std", "libloaderapi" ] }
winapi = { version = "0.3", optional = true, features = [ "std", "libloaderapi" ] }
widestring = { version = "1.0", optional = true }

[dev-dependencies]
Expand All @@ -85,16 +91,3 @@ ureq = "2.1"
image = "0.24"
test-log = { version = "0.2", default-features = false, features = [ "trace" ] }
tracing-subscriber = { version = "0.3", default-features = false, features = [ "env-filter", "fmt" ] }
tokenizers = { version = ">=0.13.4", default-features = false, features = [ "onig" ] }
rand = "0.8"

[build-dependencies]
ureq = { version = "2.1", optional = true, default-features = false, features = [ "tls" ] }
zip = { version = "0.6", optional = true, default-features = false, features = [ "deflate" ] }

[target.'cfg(not(target_os = "windows"))'.build-dependencies]
flate2 = "1.0"
tar = "0.4"

[target.'cfg(target_os = "windows")'.build-dependencies]
vswhom = "0.1"
File renamed without changes.
22 changes: 22 additions & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2023 pyke.io
2020 Nicolas Bigaouette

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading