[package] name = "ml-explainability" version.workspace = true edition.workspace = true rust-version.workspace = true authors.workspace = true license.workspace = true repository.workspace = true homepage.workspace = true documentation.workspace = true publish.workspace = true keywords.workspace = true categories.workspace = true description = "Model explainability (integrated gradients) for Foxhunt ML" [features] default = ["cuda"] cuda = ["ml-core/cuda", "cudarc"] # Standalone diagnostic binary. Gated with an optional Cargo feature so the # library target stays minimal; enabling `ig-diag-cli` pulls in ml-dqn + # argument parsing + JSON serialization for the `ig_diag` bin target. ig-diag-cli = [ "cuda", "dep:ml-dqn", "dep:clap", "dep:serde_json", "dep:anyhow", "dep:tracing", "dep:tracing-subscriber", ] [dependencies] ml-core = { path = "../ml-core", default-features = false } cudarc = { version = "0.19", optional = true, default-features = false, features = ["driver", "dynamic-linking", "std", "cuda-version-from-build-system"] } # ig_diag binary deps (optional — only compiled with `--features ig-diag-cli`). # NOTE: Cannot depend on `ml` here — it would create a cyclic dependency # (ml already depends on ml-explainability). The CLI reads fxcache files # directly (header parsing is trivial, see src/bin/ig_diag.rs). ml-dqn = { path = "../ml-dqn", optional = true } clap = { workspace = true, optional = true } serde_json = { workspace = true, optional = true } anyhow = { workspace = true, optional = true } tracing = { workspace = true, optional = true } tracing-subscriber = { workspace = true, optional = true } [dev-dependencies] tempfile = "3" # The ig_diag CLI integration test drives the binary end-to-end: it needs # ml-dqn + safetensors + serde_json to build a checkpoint and parse the # report. These are only used by tests (no library impact). ml-dqn = { path = "../ml-dqn" } safetensors = "0.7" serde_json = { workspace = true } [[bin]] name = "ig_diag" path = "src/bin/ig_diag.rs" required-features = ["ig-diag-cli"] [lints] workspace = true