Skip to content

Commit

Permalink
refactor: split crates into crates folder
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Feb 11, 2024
1 parent a9e0969 commit 2ebbfc8
Show file tree
Hide file tree
Showing 64 changed files with 112 additions and 118 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
open_collective: pyke-osai
custom: https://opencollective.com/pyke-osai/projects/ort
15 changes: 2 additions & 13 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,17 @@ on:
- 'main'
paths:
- '.github/workflows/code-quality.yml'
- 'src/**/*.rs'
- 'build.rs'
- 'crates/**/*'
- 'Cargo.toml'
- '.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'
- 'crates/**/*'
- '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 Down
10 changes: 2 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,15 @@ on:
- 'main'
paths:
- '.github/workflows/test.yml'
- 'src/**/*.rs'
- 'ort-sys/**/*.rs'
- 'build.rs'
- 'crates/**/*'
- 'Cargo.toml'
- '.cargo/**/*'
- 'tests/**/*'
pull_request:
paths:
- '.github/workflows/test.yml'
- 'src/**/*.rs'
- 'ort-sys/**/*.rs'
- 'build.rs'
- 'crates/**/*'
- 'Cargo.toml'
- '.cargo/**/*'
- 'tests/**/*'
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ WixTools/
# ONNX Runtime downloaded models
**/*.onnx
**/*.ort
!tests/data/*.onnx
!tests/data/*.ort
!crates/ort/tests/data/*.onnx
!crates/ort/tests/data/*.ort

# IDEA
.idea

# Glassbench results
/glassbench*.db
**/glassbench*.db
83 changes: 10 additions & 73 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
[workspace]
resolver = "2"
members = [
'ort-sys',
'crates/ort',
'crates/ort-sys',
'examples/custom-ops',
'examples/gpt2',
'examples/model-info',
'examples/yolov8',
'examples/modnet'
]
default-members = [
'.',
'crates/ort',
'crates/ort-sys',
'examples/custom-ops',
'examples/gpt2',
'examples/model-info',
'examples/yolov8',
'examples/modnet'
]

[package]
name = "ort"
description = "A safe Rust wrapper for ONNX Runtime 1.17 - Optimize and Accelerate Machine Learning Inferencing"
[workspace.package]
version = "2.0.0-rc.0"
edition = "2021"
rust-version = "1.70"
Expand All @@ -28,77 +29,13 @@ documentation = "https://ort.pyke.io/"
readme = "README.md"
keywords = [ "machine-learning", "ai", "ml" ]
categories = [ "algorithms", "mathematics", "science", "science" ]
authors = [
"pyke.io <[email protected]>",
"Nicolas Bigaouette <[email protected]>"
]
include = [ "src/", "benches/", "LICENSE-APACHE", "LICENSE-MIT", "README.md" ]
authors = [ "pyke.io <[email protected]>" ]

[workspace.dependencies]
ort-sys = { version = "2.0.0-rc.0", path = "crates/ort-sys" }

[profile.release]
opt-level = 3
lto = true
strip = true
codegen-units = 1

[package.metadata.docs.rs]
features = [ "ndarray", "half", "profiling", "custom-ops", "fetch-models", "copy-dylibs" ]
rustdoc-args = [ "--cfg", "docsrs" ]

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

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

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

cuda = [ "ort-sys/cuda" ]
tensorrt = [ "ort-sys/tensorrt" ]
openvino = [ "ort-sys/openvino" ]
onednn = [ "ort-sys/onednn" ]
directml = [ "ort-sys/directml" ]
nnapi = [ "ort-sys/nnapi" ]
coreml = [ "ort-sys/coreml" ]
xnnpack = [ "ort-sys/xnnpack" ]
rocm = [ "ort-sys/rocm" ]
acl = [ "ort-sys/acl" ]
armnn = [ "ort-sys/armnn" ]
tvm = [ "ort-sys/tvm" ]
migraphx = [ "ort-sys/migraphx" ]
rknpu = [ "ort-sys/rknpu" ]
vitis = [ "ort-sys/vitis" ]
cann = [ "ort-sys/cann" ]
qnn = [ "ort-sys/qnn" ]

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

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

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

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

[dev-dependencies]
anyhow = "1.0"
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" ] }
glassbench = "0.4"

[[bench]]
name = "squeezenet"
harness = false
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ignore:
- "src/execution_providers"
- "crates/ort/src/execution_providers"
21 changes: 10 additions & 11 deletions ort-sys/Cargo.toml → crates/ort-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
[package]
name = "ort-sys"
description = "Unsafe Rust bindings for ONNX Runtime 1.17 - Optimize and Accelerate Machine Learning Inferencing"
version = "2.0.0-rc.0"
edition = "2021"
rust-version = "1.70"
license = "MIT OR Apache-2.0"
repository = "https://github.com/pykeio/ort"
documentation = "https://ort.pyke.io/"
keywords = [ "machine-learning", "ai", "ml" , "sys"]
categories = [ "algorithms", "mathematics", "science" ]
authors = [
"pyke.io <[email protected]>"
]
include = [ "src/", "build.rs", "LICENSE-APACHE", "LICENSE-MIT" ]
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
documentation.workspace = true
readme.workspace = true
keywords.workspace = true
categories.workspace = true
authors.workspace = true

[features]
default = []
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions ort-sys/LICENSE-MIT → crates/ort-sys/LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
MIT License

Copyright (c) 2023 pyke.io
2020 Nicolas Bigaouette
Copyright (c) 2023-2024 pyke.io

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
77 changes: 77 additions & 0 deletions crates/ort/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[package]
name = "ort"
description = "A safe Rust wrapper for ONNX Runtime 1.17 - Optimize and Accelerate Machine Learning Inferencing"
include = [ "src/", "benches/", "LICENSE-APACHE", "LICENSE-MIT", "README.md" ]
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
documentation.workspace = true
readme.workspace = true
keywords.workspace = true
categories.workspace = true
authors.workspace = true

[package.metadata.docs.rs]
features = [ "ndarray", "half", "profiling", "custom-ops", "fetch-models", "copy-dylibs" ]
rustdoc-args = [ "--cfg", "docsrs" ]

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

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

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

cuda = [ "ort-sys/cuda" ]
tensorrt = [ "ort-sys/tensorrt" ]
openvino = [ "ort-sys/openvino" ]
onednn = [ "ort-sys/onednn" ]
directml = [ "ort-sys/directml" ]
nnapi = [ "ort-sys/nnapi" ]
coreml = [ "ort-sys/coreml" ]
xnnpack = [ "ort-sys/xnnpack" ]
rocm = [ "ort-sys/rocm" ]
acl = [ "ort-sys/acl" ]
armnn = [ "ort-sys/armnn" ]
tvm = [ "ort-sys/tvm" ]
migraphx = [ "ort-sys/migraphx" ]
rknpu = [ "ort-sys/rknpu" ]
vitis = [ "ort-sys/vitis" ]
cann = [ "ort-sys/cann" ]
qnn = [ "ort-sys/qnn" ]

[dependencies]
ndarray = { version = "0.15", optional = true }
thiserror = "1.0"
ort-sys = { workspace = true }
libloading = { version = "0.8", optional = true }
compact_str = "0.7"

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

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

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

[dev-dependencies]
anyhow = "1.0"
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" ] }
glassbench = "0.4"

[[bench]]
name = "squeezenet"
harness = false
File renamed without changes.
2 changes: 1 addition & 1 deletion LICENSE-MIT → crates/ort/LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 pyke.io
Copyright (c) 2023-2024 pyke.io
2020 Nicolas Bigaouette

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/custom-ops/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version = "0.0.0"
edition = "2021"

[dependencies]
ort = { path = "../../", features = [ "fetch-models" ] }
ort = { path = "../../crates/ort", features = [ "fetch-models" ] }
ndarray = "0.15"
tokenizers = { version = ">=0.13.4", default-features = false, features = [ "onig" ] }
rand = "0.8"
Expand Down
2 changes: 1 addition & 1 deletion examples/gpt2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version = "0.0.0"
edition = "2021"

[dependencies]
ort = { path = "../../", features = [ "fetch-models" ] }
ort = { path = "../../crates/ort", features = [ "fetch-models" ] }
ndarray = "0.15"
tokenizers = { version = ">=0.13.4", default-features = false, features = [ "onig" ] }
rand = "0.8"
Expand Down
2 changes: 1 addition & 1 deletion examples/model-info/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version = "0.0.0"
edition = "2021"

[dependencies]
ort = { path = "../../" }
ort = { path = "../../crates/ort" }

[features]
load-dynamic = [ "ort/load-dynamic" ]
2 changes: 1 addition & 1 deletion examples/modnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version = "0.0.0"
edition = "2021"

[dependencies]
ort = { path = "../../" }
ort = { path = "../../crates/ort" }
ndarray = "0.15"
tracing-subscriber = { version = "0.3", default-features = false, features = [ "env-filter", "fmt" ] }
image = "0.24"
Expand Down
2 changes: 1 addition & 1 deletion examples/yolov8/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version = "0.0.0"
edition = "2021"

[dependencies]
ort = { path = "../../" }
ort = { path = "../../crates/ort" }
ndarray = "0.15"
tracing-subscriber = { version = "0.3", default-features = false, features = [ "env-filter", "fmt" ] }
image = "0.24"
Expand Down

0 comments on commit 2ebbfc8

Please sign in to comment.