← Back to reference

Diagnosis Engine Design

Modules

  • agents/denpex-control-plane/src/diagnosis/confidence.rs — rule-weight + source-reliability scoring.
  • agents/denpex-control-plane/src/diagnosis/gray_failure.rs — z-score, Welford, throttle counters, first-failed-rank tracker.
  • agents/denpex-control-plane/src/diagnosis/weight_anomaly.rs — per-layer weight L2/grad L2/NaN/checksum/optimizer asymmetry.
  • agents/denpex-control-plane/src/diagnosis/nccl_topology.rs — Ring/Tree/CollNet identification + rank-link-down localization.

Deterministic-First Principle

We never emit a DiagnosisEvent until we have at least one RuleHit. If the rule coverage is < 90 % on the labeled corpus the AI layer is the fallback for the human-readable summary only. The root cause is always the top-1 deterministic finding ranked by confidence.

Gray-Failure Engine

DetectorInputThreshold
NCCL collective latencyper-opz >= 3.0 vs. 24h rolling
GPU bandwidthper-gpu.uuidz >= 3.0
Thermal throttle countevents/h>= 1
PCIe replay countevents/h>= 1
Storage latency spikeOST p99 / 1m>= 4× baseline
Repeated first-failed rankper node / 7 d>= 2 within 24h window

All detectors are deterministic and unit-tested with synthesized time-series.

Per-Layer Anomaly Engine

Inputs come from denpex_sdk.instrument.LayerInstrument which records per step (sampled 1 in 10):

  • weight_l2, weight_linf
  • grad_l2, grad_linf
  • activation_l2
  • nan_count, inf_count
  • checksum (XXH3-128 of the layer's weight tensor)

Detectors:

  • WeightExplosion — abs deviation > 3σ OR abs_dev_ratio > 10 % vs. constant baseline.
  • GradientExplosion — same threshold.
  • NaNInfDetected — immediate (no history required).
  • ChecksumDrift — XXH3 changed between adjacent steps.
  • OptimizerAsymmetry — cross-rank m_mean range > threshold.

Synthetic Tests

  • Synthesized gray-failure scenarios injected into the feature store.
  • Weight anomaly tests with simulated layer-norm streams.
  • Optimizer asymmetry with two ranks diverging.