burn_p2p
burn_p2p turns a burn learner into a peer in a decentralized training network.
core shape:
- trainers download the current head and assigned data shard, run one train window, then publish a candidate head
- validators evaluate candidates and promote accepted updates
- the same network can include native peers, browser peers, viewers, and validators
install
[]
= { = "=0.21.0-pre.5", = ["burn"] }
happy path
use Learner;
use ;
use from_loaders;
let mut trainer = from_loaders
.trainer?
.with_network?
.with_storage
.with_bootstrap_peer
.spawn?;
let experiment = trainer.experiment;
let outcome = trainer.train_window_once?;
println!;
keep your existing burn model, optimizer, scheduler, and loaders.
burn_p2p handles:
- head sync
- window-by-window training publication
- checkpoint/artifact movement
- validator promotion flow
- assigned shard fetch for distributed runs
one validator/authority node must exist somewhere on the network to initialize and promote heads.
data
trainers fetch only their assigned shard:
with_sharded_dataset(...).
browser peers fetch assigned shards from an http dataset origin, not over the p2p overlay.
what the repo includes
burn_p2p: core runtimeburn_p2p_browser: browser runtimeburn_p2p_bootstrap: bootstrap/browser-edge http surfaceburn_p2p_app: reference dioxus ui
same experiment layout works across native and browser peers. browser-facing runtime and ui live in the companion crates above.
see it working
single-machine mixed-fleet mnist sanity run:
best follow-up docs:
non-burn runtime? implement P2pWorkload directly.