Best for
- Use when: 3DGS training crashes or produces poor results, loss is NaN/Inf, VRAM exhaustion, Gaussians explode or vanish, densification not working, convergence stalls, 训练调试/显存溢出/训练发散/浮点
jaccen/Awesome-Gaussian-Skills/skills/3dgs-training-debugger/SKILL.md
Use it for design and operations tasks; the detail page covers purpose, installation, and practical steps.
Decision brief
You are a senior 3DGS engineer who has trained hundreds of Gaussian Splatting models across vanilla 3DGS, deformable GS, feed-forward GS, SLAM-GS, and physics-based GS pipelines. Diagnose and fix training-time failures systematically.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/jaccen/Awesome-Gaussian-Skills --skill "skills/3dgs-training-debugger"Inspect the Agent Skill "3dgs-training-debugger" from https://github.com/jaccen/Awesome-Gaussian-Skills/blob/8b0f40d4378e2152936765ec6d7873119e69ed42/skills/3dgs-training-debugger/SKILL.md at commit 8b0f40d4378e2152936765ec6d7873119e69ed42. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
[ ] All GPUs have same CUDA capability and driver version
[ ] The reported symptom is specific (e.g., "NaN at iter 500" not "training broke")
If any SC check fails: Do NOT present the diagnosis. Re-examine the failed check and re-run from SC-1.
Diagnose training crashes (OOM, NaN/Inf loss, CUDA errors) with root-cause analysis
This skill covers the runtime training phase — what happens AFTER code is written and BEFORE evaluation. It complements:
Permission review
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 95/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 144 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
You are a senior 3DGS engineer who has trained hundreds of Gaussian Splatting models across vanilla 3DGS, deformable GS, feed-forward GS, SLAM-GS, and physics-based GS pipelines. Diagnose and fix training-time failures systematically.
This skill covers the runtime training phase — what happens AFTER code is written and BEFORE evaluation. It complements:
| Metric | Expected Behavior | Alert Threshold | Log Frequency |
|---|---|---|---|
| L1 loss | Decreasing, minor oscillation | Increase > 20% over 500 iters | Every 50 iters |
| SSIM loss | Decreasing smoothly | Stagnant for 1000+ iters | Every 100 iters |
| Total loss | Decreasing, plateau ~70-80% of training | NaN, Inf, or sudden spike | Every 50 iters |
| PSNR (eval) | Increasing, plateau near end | Drop > 2dB between evals | Every 1000 iters |
| Gaussian count | Growth phase (0-15k), then stable | Explosive growth (>10x) or vanishing | Every 500 iters |
| VRAM usage | Stable with minor fluctuation during ADC | > 90% of total VRAM | Every 100 iters |
| Gradient norms | Stable, < 1.0 typically | > 10.0 or exactly 0.0 | Every 100 iters |
| Learning rate | Following schedule (warmup → cosine decay) | Unexpected reset or spike | Every 500 iters |
| Active Gaussians | Growth then pruning equilibrium | All pruned (count → 0) | Every ADC cycle |
| ADC trigger count | Periodic (every ~100 iters) | Never triggers or triggers every iter | Every ADC cycle |
Reference trajectory for vanilla 3DGS on a typical Mip-NeRF 360 scene:
Iter Loss PSNR Gaussians VRAM Notes
0 0.45 16.2 1(x SfM) 4.2 GB Init from SfM points
500 0.22 20.1 12,000 5.1 GB First ADC cycle
1000 0.15 23.5 45,000 7.8 GB Rapid growth phase
2000 0.09 26.8 180,000 12.4 GB Growth slowing
5000 0.05 29.2 350,000 14.2 GB Near convergence
7000 0.04 30.1 380,000 14.5 GB Fine-tuning
10000 0.03 30.4 390,000 14.6 GB Final (shutting densif)
15000 0.03 30.5 395,000 14.6 GB Densif frozen, opacity fine-tune
30000 0.025 30.6 395,000 14.6 GB Final model
Key signals: Gaussian count should plateau around iter 10k-15k (when densification freezes), PSNR should still improve slightly afterward via opacity/SH refinement.
See references/convergence-trajectories.md for expected trajectories across datasets, scene types, and method variants.
Start from the observed symptom and follow the branches.
SYMPTOM: Training crashed or NaN
│
├── NaN/Inf in loss?
│ ├── Check gradient norms → extremely large?
│ │ └── Possible: learning rate too high, gradient explosion
│ │ → Reduce lr to 1/10, add gradient clipping (max_norm=1.0)
│ ├── Check after ADC cycle → NaN appears right after densification?
│ │ └── Possible: NaN from clone/split, new Gaussian has bad scale/opacity
│ │ → Check scale clamping, opacity init values
│ ├── NaN from iteration 0?
│ │ └── Possible: bad initialization (zero covariance, SfM failure)
│ │ → Check point cloud, add covariance regularization
│ └── NaN in novel method (deformable/MoE)?
│ └── See Section 9: Novel Method Stability
│
├── CUDA OOM?
│ ├── During training (non-ADC)?
│ │ ├── Gaussian count reasonable but still OOM?
│ │ │ └── Possible: image resolution too high, batch size, SH degree
│ │ │ → Reduce image res by 2x, reduce SH to degree 1
│ │ └── Gaussian count exploding?
│ │ └── Possible: densification over-triggering
│ │ → See Section 3: OOM & Memory Management
│ └── During ADC (densification)?
│ └── Possible: temporary spike from clone/split
│ → Reduce ADC batch size, or move ADC to CPU
│
├── Training runs but quality is poor (low PSNR)?
│ ├── Gaussian count too low?
│ │ └── Possible: densification thresholds too strict, pruning too aggressive
│ │ → Lower grad_threshold, raise prune_threshold
│ ├── Gaussian count normal but artifacts?
│ │ └── See Section 4: Artifact Diagnosis
│ ├── Convergence stalled early?
│ │ └── See Section 6: Convergence Analysis
│ └── Specific views are bad?
│ └── Possible: training/test view selection issue, SfM sparse in that area
│
├── Training runs but visual artifacts?
│ ├── Floaters (small isolated Gaussians)?
│ │ └── See Pattern FP-01 in references
│ ├── Blur / over-smoothing?
│ │ └── See Pattern FP-02
│ ├── Ghosting / duplicate geometry?
│ │ └── See Pattern FP-03
│ ├── Holes / missing regions?
│ │ └── See Pattern FP-04
│ └── Color bleeding / SH artifacts?
│ └── See Pattern FP-05
│
└── Checkpoint resume gives different results?
└── See Section 8: Checkpoint & Resume
Approximate peak VRAM during training:
VRAM_peak ≈ Model_VRAM + Optimizer_VRAM + Raster_VRAM + Gradient_VRAM + ADC_spike
Where:
Model_VRAM = N_gaussians × bytes_per_gaussian
Optimizer_VRAM = 2 × Model_VRAM (Adam: momentum + variance)
Raster_VRAM = H × W × n_channels × num_images_in_batch × 4 bytes
Gradient_VRAM = Model_VRAM (gradients for all params)
ADC_spike = 1.5 × Model_VRAM (temporary allocation during clone/split)
bytes_per_gaussian ≈ 59 × 4 = 236 bytes
(3 position + 3 scale + 4 rotation + 1 opacity + 48 SH (degree 3) = 59 floats)
See references/vram-gpu-table.md for precomputed VRAM requirements across Gaussian counts, SH degrees, and GPU types.
| Priority | Strategy | VRAM Savings | Quality Impact | Implementation |
|---|---|---|---|---|
| 1 | Reduce image resolution (2x downsample) | 50-75% raster VRAM | Minor PSNR drop (~0.5-1dB) | --data_factor 2 |
| 2 | Lower SH degree (3→1) | ~40% model VRAM | Slight view-dependent color loss | --sh_degree 1 |
| 3 | Gradient checkpointing on rasterizer | 30-40% gradient VRAM | ~10% slower training | Custom backward pass |
| 4 | Reduce ADC frequency (100→200 iters) | Reduces ADC spike frequency | Slower densification | --densify_interval 200 |
| 5 | CPU-offload optimizer states | 40% total VRAM | ~30% slower (PCIe transfer) | FSDP/DeepSpeed |
| 6 | Mixed precision (FP16/BF16) training | 30-50% total VRAM | Risk of numerical instability | torch.cuda.amp |
| 7 | Streaming image loading (not all in VRAM) | Major for large datasets | No quality impact | Custom data loader |
| 8 | Prune far-away Gaussians aggressively | Reduces model VRAM | May lose background detail | Custom prune criterion |
| Scenario | Typical Cause | Fix |
|---|---|---|
| OOM at iter ~500 (first ADC) | Sudden Gaussian count jump | Pre-allocate buffer for 5x initial count |
| OOM only on specific scenes | High-detail scenes grow more Gaussians | Scene-adaptive resolution reduction |
| OOM after checkpoint resume | Optimizer state not saved/loaded | Save full optimizer state in checkpoint |
| OOM on multi-GPU | All-reduce buffer too large | Gradient bucketing, overlap comm/compute |
| OOM with novel method | Extra params (deformation, MLP) | Profile each component separately |
| Artifact | Visual Symptom | Most Likely Training Cause | Diagnostic Action |
|---|---|---|---|
| Floaters | Small bright/dark blobs floating in space | Insufficient opacity pruning; ADC cloning noise | Check prune_opacity threshold; check if ADC ran after iter 15k |
| Blur | Overall soft, lacks high-freq detail | SH degree too low; low-resolution training images | Increase SH to 3; check --data_factor |
| Over-smoothing | PSNR OK but LPIPS bad, looks "flat" | L1+SSIM loss too weighted to L1; insufficient iterations | Increase SSIM weight (λ_dssim > 0.2) |
| Ghosting | Duplicate/semi-transparent geometry | Clone in wrong direction; scale gradient sign error | Check ADC clone position offset; verify gradient direction |
| Holes | Black/empty regions in reconstruction | Over-aggressive pruning; SfM sparse in that region | Raise prune threshold; add points in sparse areas |
| Color bleeding | Color from one surface leaks to another | SH coefficient overflow; insufficient view coverage | Clamp SH values; check training camera distribution |
| Stretching | Elongated Gaussian streaks | Scale not clamped; bad covariance projection | Verify scale_activation clamping (max 0.1-10.0) |
| Popping | View-dependent flickering between views | SH degree too high with sparse views; opacity reset | Reduce SH degree; increase opacity reset iterations |
| Z-fighting | Flickering on overlapping surfaces | Near-duplicate Gaussians at same depth | Add uniqueness in clone; increase prune threshold |
| Dark scene | Overall too dark / underexposed | Background color set to black; insufficient training | Set background to white or random; train longer |
Knowing WHEN the artifact was introduced narrows the cause:
Artifact present from iter 0 → Initialization issue (SfM points, scale init)
Artifact appears after first ADC → Densification bug (clone/split logic)
Artifact appears after 50% train → Pruning removed important Gaussians
Artifact appears near end → Opacity reset or SH overfitting
Artifact only in eval (not train) → Overfitting / view-dependent overfit
| Parameter | Default | Range | Effect of Increase | Effect of Decrease |
|---|---|---|---|---|
position_lr | 0.00016 | 1e-5 to 1e-2 | Faster convergence, risk of explosion | Slower, more stable |
feature_lr | 0.0025 | 1e-4 to 1e-1 | Faster SH convergence | Slower color |
opacity_lr | 0.05 | 1e-3 to 0.2 | Faster opacity adaptation | Slower prune response |
scaling_lr | 0.005 | 1e-4 to 0.05 | Faster scale adaptation | More rigid geometry |
rotation_lr | 0.001 | 1e-5 to 0.01 | Faster rotation adaptation | More rigid orientation |
densify_grad_threshold | 0.0002 | 1e-5 to 1e-2 | More Gaussians (sensitive) | Fewer Gaussians |
densify_interval | 100 | 50-500 | Less frequent densification | More frequent |
densify_until_iter | 15000 | 5000-30000 | Longer growth phase | Earlier freeze |
prune_opacity_threshold | 0.005 | 0.001-0.05 | More aggressive pruning (fewer floaters) | More Gaussians (risk floaters) |
opacity_reset_interval | 3000 | 1000-10000 | More frequent resets (less view-dep overfit) | More stable opacities |
sh_degree | 3 | 0-4 | Better view-dependent color | Less VRAM |
lambda_dssim | 0.2 | 0-1 | More structural similarity | More pixel-level accuracy |
| Problem | First Adjustment | Second Adjustment | Last Resort |
|---|---|---|---|
| Low PSNR | Lower densify_grad_threshold (more Gaussians) | Increase training iterations | Lower image resolution |
| OOM | Lower sh_degree | Reduce image resolution | Decrease densify_until_iter |
| Floaters | Raise prune_opacity_threshold | Increase opacity_reset_interval | Post-train prune |
| Blur | Increase sh_degree | Increase lambda_dssim | Higher resolution images |
| Slow convergence | Increase position_lr | Increase densify_interval | Fewer total iters (accept lower quality) |
| Divergence | Decrease all LRs by 10x | Add gradient clipping | Reduce batch complexity |
| Too many Gaussians | Raise densify_grad_threshold | Lower densify_until_iter | Aggressive pruning |
Phase 1: Rapid Growth (iter 0 - 2,000)
- Loss drops fast, PSNR jumps from ~16 to ~24
- Gaussian count grows from SfM initial to ~50k-100k
- Risk: ADC over-triggering → OOM
Phase 2: Refinement (iter 2,000 - 15,000)
- Loss decreases more slowly, PSNR 24 → 28
- Gaussian growth slows, pruning starts balancing
- Risk: Premature densification freeze
Phase 3: Fine-tuning (iter 15,000 - 30,000)
- Loss near plateau, PSNR 28 → 30+
- Densification frozen, opacity and SH refine
- Risk: Overfitting to training views
Phase 4: Final Polish (iter 30,000+)
- Minimal change, diminishing returns
- Risk: Continued training may degrade test views
| Failure Mode | Symptom | Root Cause | Fix |
|---|---|---|---|
| Premature plateau | PSNR stops improving by iter 5,000 | Densification frozen too early; lr too low | Increase densify_until_iter; raise lr |
| Never converges | Loss oscillates, PSNR ~20 at iter 30k | Learning rate too high; bad initialization | Reduce lr 10x; check SfM point cloud |
| Train-good/test-bad | High train PSNR, low test PSNR | Overfitting; insufficient camera coverage | More cameras; early stopping; regularization |
| Sudden regression | PSNR drops dramatically mid-training | Gradient explosion; bad ADC clone; data corruption | Check gradient norms; add clipping; verify data |
| Asymmetric convergence | Some views perfect, others terrible | SfM sparse in some regions; uneven camera distribution | Add cameras; increase densification in sparse areas |
| Late-stage degradation | PSNR peaks then declines | Overfitting SH; opacity over-adaptation | Early stopping at peak; reduce opacity_lr |
See references/convergence-trajectories.md for method-specific expected trajectories (deformable, feed-forward, SLAM, etc.).
| Strategy | Description | When to Use | Pitfalls |
|---|---|---|---|
| Data Parallel (DDP) | Each GPU trains full model on different image batch | Standard for large datasets | All-reduce bottleneck with high Gaussian count; requires gradient sync |
| Model Parallel | Split Gaussians across GPUs | When single GPU VRAM insufficient | Load imbalance; complex rasterization coordination |
| Pipeline Parallel | Split training stages across GPUs | Rare for 3DGS | Not well-supported by rasterization kernels |
| FSDP | Shard optimizer states + gradients | Very large Gaussian counts | Overhead for moderate counts; CPU offload needed |
| Bug ID | Symptom | Cause | Fix |
|---|---|---|---|
| DT-01 | Loss diverges on rank 0 only | Gradient sync issue; non-deterministic ADC | Use torch.distributed.barrier() before ADC |
| DT-02 | Different Gaussians on different ranks | Densification not synchronized | Broadcast Gaussian count/positions after ADC |
| DT-03 | Dead worker (hangs at all-reduce) | One GPU OOM; NCCL timeout | Monitor per-GPU VRAM; add NCCL timeout config |
| DT-04 | Slower than single-GPU | All-reduce dominates compute | Use gradient bucketing; overlap comm/compute |
| DT-05 | Checkpoint loads on 1 GPU, fails on multi | State dict has single-device tensors | Use map_location + DDP-aware state dict unwrap |
| DT-06 | Non-reproducible results across runs | Non-deterministic cuDNL; random ADC ordering | Set seeds; use torch.use_deterministic_algorithms(True) |
checkpoint = {
# Model state
'gaussian_params': {
'_xyz': gaussians._xyz.data, # [N, 3]
'_features': gaussians._features.data, # [N, sh_dim]
'_opacity': gaussians._opacity.data, # [N, 1]
'_scaling': gaussians._scaling.data, # [N, 3]
'_rotation': gaussians._rotation.data, # [N, 4]
},
# Optimizer state (CRITICAL — without this, resume will diverge)
'optimizer_state_dict': optimizer.state_dict(),
# Training state
'iteration': current_iteration,
'gaussians_count': gaussians._xyz.shape[0],
# ADC state
'densify_until_iter': densify_until_iter,
'densify_interval': densify_interval,
'size_threshold': size_threshold,
# Hyperparameters at this point (for reproducibility)
'hyperparameters': {
'lr': optimizer.param_groups[0]['lr'],
'sh_degree': active_sh_degree,
'opacity_reset_interval': opacity_reset_interval,
},
# For novel methods: extra state (deformable MLP, etc.)
'extra_state': extra_module.state_dict() if extra_module else None,
}
| Issue | Symptom | Cause | Fix |
|---|---|---|---|
| Resume diverges | Loss jumps or NaN after resume | Optimizer state not saved/loaded | Always save + restore optimizer state_dict |
| Wrong Gaussian count | Gaussians mismatch on resume | ADC ran between save and resume | Save AFTER ADC cycle, not during |
| Shape mismatch | Tensor size error on load | Pruning changed Gaussian count | Save count explicitly; handle add/remove |
| SH degree mismatch | Feature dim error | SH degree auto-incremented during training | Save active_sh_degree; restore it |
| Scale/rotation mismatch | Bad rendering after resume | Activation functions applied during save | Save pre-activation values (_scaling, _rotation) |
| Novel method state lost | Deformation MLP reset on resume | Extra module state not in checkpoint | Include all module state_dicts in checkpoint |
| Method Family | Common Stability Issue | Root Cause | Mitigation |
|---|---|---|---|
| Deformable GS (4DGS, Deformable-3DGS) | Deformation MLP outputs NaN | Unconstrained MLP output; large gradients through time | Add tanh activation on output; gradient clip; warmup with frozen base |
| Feed-forward GS (pixelSplat, LRM-based) | Instability with few training images | Model predicts Gaussians from sparse views | More training iterations; 2D feature regularization |
| MoE-GS | Expert collapse (all routing to 1 expert) | Router imbalance; load balancing loss weight too low | Increase load-balancing loss; add router z-loss |
| Physics-based GS (PhysGaussian, Springs) | Physics simulation diverges | Large time step; unstable integrator | Reduce dt; use semi-implicit Euler; add damping |
| SLAM-GS | Drift accumulation over time | Incremental map update without global optimization | Periodic global BA; keyframe-based adjustment |
| Compression GS | Quality collapse after pruning | Pruned critical Gaussians | Importance-aware pruning; fine-tune after prune |
| GaussianGrasper / Embodied | Grasp success drops during training | Sim-to-real gap amplifies | Domain randomization; curriculum learning |
| PBR / Material GS | Material decomposition unstable | Joint optimization of geometry + material under-determined | Stage training: geometry first, then material |
| City-scale / Large-scene | OOM or spatial discontinuity | Too many Gaussians in one scene | Block-wise training; LOD hierarchy |
| GaussTrace / Provenance | Provenance tags mismatch after ADC | Clone/split not propagating tags | Custom ADC that preserves provenance metadata |
torch.autograd.gradcheck or manual gradient norm logging for the novel module.This skill detects 50+ runtime failure patterns (as opposed to the code-reviewer's 108+ static code bugs). These are failures that manifest DURING training execution, not visible from static code analysis alone.
| Category | Count | Examples |
|---|---|---|
| Initialization failures (IF) | 6 | SfM sparse init, zero covariance, scale explosion |
| Densification failures (DF) | 8 | Over/under-triggering, clone direction error, split scale error |
| Optimization failures (OF) | 7 | LR explosion, gradient vanishing, loss masking error |
| Memory failures (MF) | 6 | OOM at ADC, VRAM fragmentation, optimizer state bloat |
| Convergence failures (CF) | 7 | Premature plateau, oscillation, test regression, asymmetry |
| Artisanal artifacts (AF) | 8 | Floaters, blur, ghosting, holes, color bleed |
| Multi-GPU failures (MF2) | 6 | Gradient sync, dead worker, desync ADC, NCCL timeout |
| Novel method failures (NF) | 12+ | Deformable NaN, MoE collapse, physics divergence, SLAM drift |
| Total | 60+ | See references/runtime-bug-patterns.md |
For the full pattern database with symptoms, root causes, diagnostics, and fixes, see references/runtime-bug-patterns.md.
Before presenting any diagnosis, verify:
If any SC check fails: Do NOT present the diagnosis. Re-examine the failed check and re-run from SC-1.
The following are categorical prohibitions. Violating any of these invalidates the output:
Do NOT try to apply the logic, bug patterns, convergence data, or technical details described in this skill from memory. Always read the SKILL.md and referenced files from disk before producing any output. The knowledge base is updated frequently; stale memory may produce outdated, inaccurate, or fabricated results.
If you cannot find a pattern, data point, or fix in the loaded files, say so explicitly. Never invent VRAM numbers, convergence trajectories, or runtime bug patterns not present in the source data.
If you like it, please star this repo https://github.com/jaccen/Awesome-Gaussian-Skills
Frequently asked questions
You are a senior 3DGS engineer who has trained hundreds of Gaussian Splatting models across vanilla 3DGS, deformable GS, feed-forward GS, SLAM-GS, and physics-based GS pipelines. Diagnose and fix training-time failures systematically.
The source record exposes this install command: npx skills add https://github.com/jaccen/Awesome-Gaussian-Skills --skill "skills/3dgs-training-debugger". Inspect the command and pinned source before running it.
Alternatives
prowler-cloud/prowler
PostgreSQL indexing best practices for Prowler: index design, partial indexes, partitioned table indexing, EXPLAIN ANALYZE validation, concurrent operations, monitoring, and maintenance. Trigger: When creating or modifying PostgreSQL indexes, analyzing query performance with EXPLAIN, debugging slow queries, reviewing index usage statistics, reindexing, dropping indexes, or working with partitioned table indexes. Also trigger when discussing index strategies, partial indexes, or index maintenance
brucesongs/kali-claw
Insecure Design (OWASP A06:2025) focuses on security flaws in system architecture and design phases, rather than code implementation-level bugs.
NintendaDev/unikit-ai
Generate and maintain the project's TECHNICAL documentation from its codebase — scans the project structure, tech stack, and module boundaries, then writes a lean README landing page plus detailed topic pages (architecture, modules, setup, build, APIs), only the docs that are relevant. Use whenever the user wants to create, update, or validate documentation of the CODE or the project itself, e.g. "generate documentation", "create docs", "write the README", "update the project docs", "document th
Aperivue/medsci-skills
Generate publication-ready figures and visual abstracts for medical research papers. Supports ROC curves, forest plots, CONSORT/STARD/PRISMA flow diagrams, calibration plots, Kaplan-Meier curves, Bland-Altman plots, confusion matrices, pipeline diagrams, and journal-specific visual/graphical abstracts (python-pptx template-based).