[package]
authors = ["nathanielsimard <nathaniel.simard.42@gmail.com>"]
categories = ["science"]
description = "Training crate for the Burn framework"
edition.workspace = true
keywords = ["deep-learning", "machine-learning", "tensor", "pytorch", "ndarray"]
license.workspace = true
name = "burn-train"
readme.workspace = true
repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-train"
documentation = "https://docs.rs/burn-train"
version.workspace = true

[lints]
workspace = true

[features]
default = ["sys-metrics", "tui"]
doc = ["default"]
tracing = [
    "burn-core/tracing",
    "burn-optim/tracing",
    "burn-collective?/tracing",
]


sys-metrics = ["nvml-wrapper", "sysinfo", "systemstat"]
tui = ["ratatui"]
# Distributed Data Parallel
ddp = ["burn-collective", "burn-optim/collective"]

[dependencies]
burn-core = { path = "../burn-core", version = "=0.21.0", features = [
    "dataset",
    "std",
], default-features = false }
burn-optim = { path = "../burn-optim", version = "=0.21.0", features = [
    "std",
], default-features = false }
burn-collective = { path = "../burn-collective", version = "=0.21.0", optional = true }

log = { workspace = true }
tracing-subscriber = { workspace = true }
tracing-appender = { workspace = true }
tracing-core = { workspace = true }

# System Metrics
nvml-wrapper = { workspace = true, optional = true }
sysinfo = { workspace = true, optional = true }
systemstat = { workspace = true, optional = true }

# Text UI
ratatui = { workspace = true, optional = true, features = [
    "all-widgets",
    "crossterm",
] }

# Utilities
derive-new = { workspace = true }
serde = { workspace = true, features = ["std", "derive"] }
async-channel = { workspace = true }
burn-ndarray = { path = "../burn-ndarray", version = "=0.21.0" }
rstest.workspace = true
thiserror.workspace = true

[dev-dependencies]
burn-ndarray = { path = "../burn-ndarray", version = "=0.21.0" }

[package.metadata.docs.rs]
features = ["doc"]
rustdoc-args = ["--cfg", "docsrs"]
