Skip to content
Open
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
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ members = [
"crates/luminal_cpu",
"crates/luminal_nn",
"crates/luminal_training",
"crates/luminal_onnx",
"docs/company",
]
exclude = [
Expand All @@ -47,3 +48,4 @@ exclude = [
"crates/luminal_2",
"demos/flash_attention",
]

19 changes: 19 additions & 0 deletions crates/luminal_onnx/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "luminal_onnx"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "ONNX import for Luminal"

[dependencies]
luminal = { path = "../.." }
prost = { version = "0.12", default-features = false, features = ["prost-derive"] }
prost-types = { version = "0.12", default-features = false }
thiserror = "1"

[build-dependencies]
prost-build = { version = "0.12" }
protoc-bin-vendored = "3"

[dev-dependencies]
tempfile = "3"
11 changes: 11 additions & 0 deletions crates/luminal_onnx/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Ensure protoc is available without a system install.
let protoc = protoc_bin_vendored::protoc_bin_path()?;
std::env::set_var("PROTOC", protoc);

let mut config = prost_build::Config::new();
// Use BTreeMap for determinism where prost would generate HashMaps.
config.btree_map(["."]);
prost_build::compile_protos(&["src/onnx/proto/onnx.proto"], &["src/onnx/proto/"])?;
Ok(())
}
5 changes: 5 additions & 0 deletions crates/luminal_onnx/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pub mod onnx;

mod load;

pub use load::{import_onnx, OnnxImportError, OnnxImportResult};
Loading