Skip to content
Docs
Profiling
Gradients

Gradients

Gradient capture is the backward-pass counterpart to activation capture - recording how loss actually flowed back through a specific tensor during a captured training step, using the same RuntimeProbe mechanism as everything else in runtime tracing.

What gets captured

A gradient capture point set on a tensor records its gradient - the derivative of loss with respect to that tensor - as computed during a captured backward pass. Because a captured gradient is just another tensor once recorded, it's addressable and inspectable the same way an activation or a static weight is: viewable in the Matrix and Heatmap view, summarized by the same tensor statistics, and readable scalar-by-scalar in the Scalar Inspector.

Why gradient capture matters

A few of the most common training pathologies are gradient-shaped, not weight-shaped, and are hard to catch any other way:

  • Vanishing gradients - a Layer Profile of gradient norm across layers makes a vanishing trend visible immediately, rather than requiring you to suspect it first.
  • Exploding gradients - an outlier flag on gradient magnitude, or a NaN breakpoint set on a gradient specifically, catches this at the moment it happens rather than only after weights are already corrupted.
  • Dead regions - a module whose gradient is consistently near-zero across many captured steps is a candidate for "not actually learning," distinct from a module that's simply converged.

Related resources

  • Runtime Traces - probe levels, breakpoints, and the capture mechanism gradient capture builds on.
  • Activations - the forward-pass counterpart.
  • Layer Profile - plotting a captured statistic like gradient norm across every layer at once.