-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCargo.toml
More file actions
71 lines (60 loc) · 2.29 KB
/
Cargo.toml
File metadata and controls
71 lines (60 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
[package]
name = "rust_tensor_lib"
version = "0.1.0"
edition = "2021"
[dependencies]
# Default backend uses matrixmultiply via ndarray's default features
# Specific BLAS backends are enabled via features below.
ndarray = { version = "0.16", default-features = true, features = ["serde"] } # Enable serde feature for ndarray
rand = "0.9.0" # Random number generation
rand_distr = "0.5.1" # Distributions for Kaiming init
thiserror = "2.0.12" # Custom error types
# For CSV loading (Phase 3)
serde = { version = "1.0", features = ["derive"], optional = true }
csv = { version = "1.2", optional = true }
serde_json = { version = "1.0", optional = true }
# For CUDA (Phase 5) - Using cust + cublas-sys
cust = { version = "0.3", optional = true } # Low-level CUDA bindings
cublas-sys = { version = "0.1.0", optional = true } # Low-level cuBLAS bindings
lazy_static = "1.4" # Needed for global context
# Optional BLAS provider for ndarray on CPU
openblas-src = { version = "0.10", optional = true, default-features = false, features = ["system"] } # Use system-installed OpenBLAS
# BLAS interface for ndarray
cblas-sys = { version = "0.1.4", optional = true }
[dev-dependencies]
tempfile = "3.10.1"
approx = "0.5"
serial_test = "3.1.1"
criterion = "0.3.5"
[[bench]]
name = "tensor_ops_bench"
harness = false
[build-dependencies]
which = "7.0.3"
[features]
default = ["mnist"]
# --- CPU Backend Features ---
# Optional: Enable OpenBLAS for potentially faster CPU matmul. Requires libopenblas-dev (or equivalent) installed.
cpu_openblas = ["dep:openblas-src", "dep:cblas-sys", "ndarray/blas"]
# --- Other Features ---
mnist = ["dep:serde", "csv"] # Feature for MNIST-specific tasks
cuda = ["cust", "cublas-sys"] # Use cust and cublas-sys for CUDA GPU support
debug_logs = [] # Feature flag for debug logging
serialization = ["dep:serde", "dep:serde_json", "ndarray/serde"] # Feature for tensor serialization
[profile.release]
lto = true
codegen-units = 1
opt-level = 3
panic = 'abort'
[[example]]
name = "train_mnist_gpu"
required-features = ["cuda"]
[[example]]
name = "train_mnist_cnn_gpu"
required-features = ["cuda"]
[[example]]
name = "tensor_serialization"
required-features = ["serialization"]
[[example]]
name = "cuda_serialization"
required-features = ["cuda", "serialization"]