feat: wire temporal pipeline + ISV signal update into training path
Temporal ops (mamba2, predictive coding, regime dropout, ISV temporal routing, risk budget) now run inside submit_forward_ops_main() as step 1c, captured in the cuBLAS training graph. Previously these only ran in monitoring via reduce_current_q_stats. Also adds submit_isv_signal_update wrapper for graph-capturable ISV signal updates. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2079,6 +2079,13 @@ impl GpuDqnTrainer {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// ISV signal update — safe to call inside graph capture.
|
||||
/// Reads pinned device-mapped scalars (loss, grad_norm, Q-mean)
|
||||
/// written by Adam, updates ISV signal vector [12] + history.
|
||||
pub(crate) fn submit_isv_signal_update(&self) -> Result<(), MLError> {
|
||||
self.update_isv_signals()
|
||||
}
|
||||
|
||||
/// ISV encoder MLP forward: temporal decay → MLP → branch gate + gamma mod.
|
||||
/// Reads ISV signals/history (pinned), ISV encoder weights from param buffer.
|
||||
/// Writes isv_embedding_buf [ISV_EMB_DIM=8], branch_gate_buf [4], gamma_mod_buf [1].
|
||||
@@ -7883,6 +7890,16 @@ impl GpuDqnTrainer {
|
||||
self.launch_trade_plan_forward(batch_size)?;
|
||||
}
|
||||
|
||||
// ── 1c. Temporal pipeline (enriches h_s2 before loss) ──
|
||||
{
|
||||
let batch_size = self.config.batch_size;
|
||||
self.mamba2_step(batch_size)?;
|
||||
self.compute_predictive_coding_loss(batch_size)?;
|
||||
self.apply_regime_dropout(batch_size, true)?;
|
||||
self.launch_isv_temporal_route()?;
|
||||
self.risk_budget_forward(batch_size)?;
|
||||
}
|
||||
|
||||
// ── 2+3. Loss + gradient (blended MSE + C51 via c51_alpha ramp) ─
|
||||
self.launch_curiosity_inference()?;
|
||||
|
||||
|
||||
@@ -950,11 +950,8 @@ impl FusedTrainingCtx {
|
||||
}
|
||||
|
||||
// ── Step 2b: Temporal pipeline ────
|
||||
// TODO: temporal ops (mamba2, regime_dropout, isv_temporal_route,
|
||||
// risk_budget, predictive_coding) corrupt graph_aux replay when run
|
||||
// ungraphed between graph_forward and graph_aux. Will be addressed
|
||||
// in the cuBLAS aux rewrite — either inside graph_temporal or
|
||||
// by eliminating graph_aux dependency.
|
||||
// Temporal ops now run inside submit_forward_ops_main() (step 1c),
|
||||
// captured in the cuBLAS training graph.
|
||||
|
||||
// ── Step 2c: HER donor computation (outside graph_aux) ───────────
|
||||
if let Some(ref mut her) = self.gpu_her {
|
||||
|
||||
Reference in New Issue
Block a user