Skip to content

Commit 986ac6c

Browse files
committed
wip: copy burn-backend + burn-std + burn-ir into ndarray (Cargo.toml rewrite pending)
Copied 3 upstream burn crates (~23K lines) to eliminate external deps. burn/Cargo.toml now points to local path deps instead of git. All 4 burn crates excluded from workspace (edition 2024). PENDING: Rewrite Cargo.toml for burn-backend, burn-std, burn-ir to resolve workspace = true refs. These crates depend on cubecl, cubecl-common, cubecl-zspace which are GPU compute abstractions — need to determine which are actually needed for CPU-only operation and which can be stubbed. This is work-in-progress. The workspace (ndarray core) is unaffected: 1,269 tests pass. The burn crate compiles separately when pointed at upstream git deps. https://claude.ai/code/session_01Y69Vnw751w75iVSBRws7o7
1 parent c4f221c commit 986ac6c

67 files changed

Lines changed: 23798 additions & 7 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,12 @@ members = [
106106
"crates/*",
107107
]
108108
exclude = [
109-
# burn crate requires edition 2024 (Rust 1.85+) and git deps.
110-
# Built separately: cargo check -p burn --manifest-path crates/burn/Cargo.toml
109+
# burn crates require edition 2024 (Rust 1.85+).
110+
# Built separately: cargo check --manifest-path crates/burn/Cargo.toml
111111
"crates/burn",
112+
"crates/burn-backend",
113+
"crates/burn-std",
114+
"crates/burn-ir",
112115
]
113116
default-members = [
114117
".",

crates/burn-backend/Cargo.toml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[package]
2+
authors = ["nathanielsimard <nathaniel.simard.42@gmail.com>"]
3+
categories = ["science", "no-std", "embedded", "wasm"]
4+
description = "Core backend interfaces and data structures for executing tensor operations in Burn."
5+
documentation = "https://docs.rs/burn-backend"
6+
edition.workspace = true
7+
keywords = ["deep-learning", "machine-learning", "tensor", "pytorch", "ndarray"]
8+
license.workspace = true
9+
name = "burn-backend"
10+
readme.workspace = true
11+
repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-backend"
12+
version.workspace = true
13+
14+
[lints]
15+
workspace = true
16+
17+
[features]
18+
default = ["std"]
19+
doc = ["default"]
20+
std = ["rand/std", "num-traits/std", "burn-std/std", "cubecl?/std"]
21+
22+
tracing = ["burn-std/tracing", "cubecl/tracing"]
23+
24+
# For DTypeUsage de/serialization
25+
serde = ["enumset/serde"]
26+
27+
cubecl = ["dep:cubecl", "burn-std/cubecl"]
28+
cubecl-cuda = ["cubecl", "cubecl/cuda"]
29+
cubecl-hip = ["cubecl", "cubecl/hip"]
30+
cubecl-wgpu = ["cubecl", "cubecl/wgpu"]
31+
cubecl-cpu = ["cubecl", "cubecl/cpu"]
32+
33+
[dependencies]
34+
burn-std = { path = "../burn-std", version = "=0.21.0-pre.2", default-features = false }
35+
cubecl = { workspace = true, optional = true, default-features = false }
36+
37+
bytemuck = { workspace = true, features = ["extern_crate_alloc"] }
38+
derive-new = { workspace = true }
39+
enumset = { workspace = true }
40+
hashbrown = { workspace = true }
41+
num-traits = { workspace = true }
42+
rand = { workspace = true, default-features = false }
43+
rand_distr = { workspace = true }
44+
serde = { workspace = true }
45+
thiserror = { workspace = true }
46+
spin = { workspace = true }
47+
48+
[target.'cfg(not(target_has_atomic = "ptr"))'.dependencies]
49+
portable-atomic-util = { workspace = true }
50+
51+
[dev-dependencies]
52+
rand = { workspace = true, features = ["thread_rng"] }
53+
paste = { workspace = true }
54+
serde_json = { workspace = true, features = ["alloc"]}
55+
serial_test = { workspace = true }

0 commit comments

Comments
 (0)