Add analysis plots for training progress (metrics.csv) #75
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Nothing currently plots training metrics.
giant/training/metrics.py'sMetricsCollectorwrites one row per epoch to
<run_dir>/metrics.csv(opened in__init__,write_epoch()called from
giant/training/loop.py), with columns declared per-stage viaMetricSpecingiant/training/trainers.py. Full column set observed:<stage>/train/loss,<stage>/val/loss, plus constituentsloss_gen,loss_nsec,loss_stop,loss_type, and (routed stages)loss_balance,loss_proc,loss_entropy.nsec_acc,stop_acc,type_acc(train + val).WGANStageTrainer):d_loss,g_loss,wasserstein,gp_loss,grad_norm_d,grad_norm_g, and (onehot particle-type target)grad_norm_type_slice,grad_norm_cont_slice. No val loss for this stage (supports_val_loss = False).<stage>/router/entropy,util_min,util_max,util_std.<stage>/lr(andcritic_lrfor WGAN).val/loss,val/marginal_kl,grad_norm,gpu_mem_mb,samples_per_sec,is_best,epoch_time_s;epochis always column 0.Because the exact column set varies by run (flow/ddpm vs wgan, routed vs not), the plotting
code should read the CSV header dynamically rather than hardcoding column names.
Proposed plots, one run dir in:
<stage>/lr(+critic_lr) vs epoch.nsec_acc/stop_acc/type_acc, train vs val, vs epoch.grad_norm(+ WGANgrad_norm_d/grad_norm_g/slice norms)vs epoch, for spotting instability.
to diagnosing the MoE expert-collapse issue described in the CLAUDE.md roadmap
(
lambda_balance=0run).d_loss/g_loss/wasserstein/gp_lossvs epoch.samples_per_sec,gpu_mem_mb,epoch_time_svs epoch,with
is_bestepochs marked.Suggested entry point: a new CLI command reading
<run_dir>/metrics.csvdirectly (it's tiny —no need for the reduce/chunk/condor machinery
giant analyzeuses for rollout data) andrendering with the same
plotstyle/matplotlib conventions asgiant/analysis/render.py, forvisual consistency with the rollout-vs-reference plots.
As a natural follow-on (not in scope here, flag for later): plotting multiple runs'
metrics.csvtogether to compare hyperparameter choices — same "N series, one plot" shape asthe multi-rollout refactor issue.