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

Fix/web examples #2691

Merged
merged 4 commits into from
Jan 13, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix conflicting feature flags w/ default-features = false
burn-tensor
- Move rayon to default flags (but not enabled by std for now)

burn-jit
- Does not require burn-tensor default features
- Enable burn-tensor/std w/ std flag

burn-import
- Split burn-tensor (only std flag) w/ and burn-ndarray
  - Use of burn-tensor w/ std and ndarray would enable rayon (for build dependency)

burn-wgpu
- Does not require burn-tensor default features
laggui committed Jan 13, 2025
commit 7b4ec8c61e54dbd7bd5606b2eaeb390ea2564151
3 changes: 2 additions & 1 deletion crates/burn-import/Cargo.toml
Original file line number Diff line number Diff line change
@@ -20,7 +20,8 @@ onnx = []
pytorch = ["burn/record-item-custom-serde", "thiserror", "zip"]

[dependencies]
burn = { path = "../burn", version = "0.16.0", features = ["ndarray"] }
burn = { path = "../burn", version = "0.16.0", default-features = false, features = ["std"]}
burn-ndarray = { path = "../burn-ndarray", version = "0.16.0", default-features = false }
onnx-ir = { path = "../onnx-ir", version = "0.16.0" }
candle-core = { workspace = true }
derive-new = { workspace = true }
2 changes: 1 addition & 1 deletion crates/burn-import/src/burn/graph.rs
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ pub struct BurnGraph<PS: PrecisionSettings> {
}

// The backend used for recording.
type Backend = burn::backend::ndarray::NdArray;
type Backend = burn_ndarray::NdArray;

impl<PS: PrecisionSettings> BurnGraph<PS> {
/// Register a new operation node into the graph.
3 changes: 1 addition & 2 deletions crates/burn-import/src/burn/node/base.rs
Original file line number Diff line number Diff line change
@@ -17,13 +17,12 @@ use super::{
unsqueeze::UnsqueezeNode,
};
use crate::burn::{BurnImports, Scope, Type};
use burn::backend::NdArray;
use burn::record::PrecisionSettings;
use proc_macro2::TokenStream;
use serde::Serialize;

/// Backend used for serialization.
pub type SerializationBackend = NdArray<f32>;
pub type SerializationBackend = burn_ndarray::NdArray<f32>;

/// Codegen trait that should be implemented by all [node](Node) entries.
pub trait NodeCodegen<PS: PrecisionSettings>: std::fmt::Debug {
4 changes: 2 additions & 2 deletions crates/burn-jit/Cargo.toml
Original file line number Diff line number Diff line change
@@ -25,13 +25,13 @@ export_tests = [
"paste",
]
fusion = ["burn-fusion"]
std = ["cubecl/std"]
std = ["cubecl/std", "burn-tensor/std"]
template = []

[dependencies]
burn-common = { path = "../burn-common", version = "0.16.0" }
burn-fusion = { path = "../burn-fusion", version = "0.16.0", optional = true }
burn-tensor = { path = "../burn-tensor", version = "0.16.0", features = [
burn-tensor = { path = "../burn-tensor", version = "0.16.0", default-features = false, features = [
"cubecl",
"repr",
] }
3 changes: 1 addition & 2 deletions crates/burn-tensor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ cubecl = ["dep:cubecl"]
cubecl-cuda = ["cubecl", "cubecl/cuda"]
cubecl-hip = ["cubecl", "cubecl/hip"]
cubecl-wgpu = ["cubecl", "cubecl/wgpu"]
default = ["std", "repr"]
default = ["std", "repr", "burn-common/rayon"]
doc = ["default"]
experimental-named-tensor = []
export_tests = ["burn-tensor-testgen", "cubecl"]
@@ -26,7 +26,6 @@ std = [
"half/std",
"num-traits/std",
"burn-common/std",
"burn-common/rayon",
"colored",
]

2 changes: 1 addition & 1 deletion crates/burn-wgpu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ cubecl = { workspace = true, features = ["wgpu"] }

burn-fusion = { path = "../burn-fusion", version = "0.16.0", optional = true }
burn-jit = { path = "../burn-jit", version = "0.16.0", default-features = false }
burn-tensor = { path = "../burn-tensor", version = "0.16.0", features = [
burn-tensor = { path = "../burn-tensor", version = "0.16.0", default-features = false, features = [
"cubecl-wgpu",
] }

2 changes: 1 addition & 1 deletion examples/image-classification-web/Cargo.toml
Original file line number Diff line number Diff line change
@@ -34,4 +34,4 @@ js-sys = "0.3"

[build-dependencies]
# Used to generate code from ONNX model
burn-import = { path = "../../crates/burn-import" }
burn-import = { path = "../../crates/burn-import", default-features = false, features = ["onnx"]}