tracel-ai/burn · error
A minimum of one device.
Error message
A minimum of one device.
What it means
Configuration guard in the multi-device training strategy's `run_optim_main`: the devices list used for distributed training is empty, so no work can be distributed and execution panics; at least one device (the main device) is required.
Source
Thrown at crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:89
"Executing training step for epoch {} on devices {:?}",
epoch,
devices
);
let mut iterators = self
.dataloaders
.iter()
.map(|d| d.iter())
.collect::<Vec<_>>();
let mut iteration = 0;
let mut accumulator = GradientsAccumulator::new();
let mut accumulation_current = 0;
let accumulation = self.grad_accumulation.unwrap_or(1);
let step = MultiDevicesTrainStep::<M>::new(&devices);
// The main device is always the first in the list.
let device_main = devices.first().expect("A minimum of one device.").clone();
loop {
let (items, progress) = match step.step(iterators.as_mut_slice(), &learner.model()) {
Ok(result) => result,
Err(err) => {
interrupter.stop(Some(&format!("dataset error during training step: {err}")));
break;
}
};
if items.is_empty() {
break;
}
learner.lr_step();
let mut progress_items = Vec::with_capacity(items.len());
for item in items.into_iter() {
let grads = item.output.grads.to_device(&device_main, &learner.model());View on GitHub (pinned to d16f7ba2ed)
Solutions
- Pass at least one device to the multi-device learner configuration
- Verify device enumeration returned a non-empty list
- Fall back to the single-device strategy if only CPU/one device is available
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:89 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of tracel-ai/burn@d16f7ba2ed (2026-09-05).
Data as JSON: /api/errors/c4a162c823acc914.
Report an issue: GitHub.