swactor/Cargo.toml
zacheryasc 5c3f742ce8 feat: data parallel mnist example (#26)
Add a data-parallel MNIST training example where swactor actors coordinate gradient averaging across workers.

- crates/swactor-dp-mnist/worker.py: add `MnistNet` MLP and `MnistWorker` actor handling `train_batch`/`update`/`evaluate`/`save_model` over a sharded MNIST split with SGD
- crates/swactor-dp-mnist/aggregator.py: add `Aggregator` actor that buffers per-worker gradients, averages them, fans out updates, then logs/evaluates on completion
- crates/swactor-dp-mnist/run_training.py: spawn the Aggregator plus two MnistWorkers (identical initial weights, disjoint shards), run 750 rounds, and poll the inbox for `log`/`done`
- crates/swactor-dp-mnist/pyproject.toml: declare torch/torchvision/numpy deps, an editable local `swactor` source, and the PyTorch CPU index
- Cargo.toml: add a `[profile.bench]` retaining debug symbols (`debug = true`, `strip = false`) for profiling

Signed-off-by: Zachery Aaron Shores-Chmielewski <zacheryasc@gmail.com>
2026-02-09 14:42:25 +00:00

45 lines
1,006 B
TOML

[workspace]
members = [".", "crates/swactor-python", "crates/swactor-wasm", "crates/swactor-gossip", "crates/gossip-dashboard", "crates/runtime-dashboard"]
exclude = ["tools/depgraph"]
[package]
name = "swactor"
version = "0.1.0"
edition = "2024"
autobenches = false
[profile.bench]
debug = true
strip = false
[lib]
crate-type = ["rlib"]
[features]
default = ["getrandom"]
getrandom = ["dep:getrandom"]
serde = ["dep:serde"]
tracing = ["dep:tracing"]
no_random = [] # compile without access to a source of randomness
[dependencies]
getrandom = { version = "0.2", optional = true }
serde = { version = "1", features = ["derive"], optional = true }
tracing = { version = "0.1", optional = true }
crossbeam-queue = "0.3.12"
crossbeam-utils = "0.8.21"
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
[[bench]]
name = "runtime_benchmarks"
harness = false
[[bench]]
name = "worker_benchmarks"
harness = false
[[bench]]
name = "mt_benchmarks"
harness = false