spark-memory-thermal-ops

Plan unified memory headroom and monitor thermals for ML training on NVIDIA DGX Spark.

39.3k|4.2k|Updated Jul 24, 2025
One-click install
npx skills add https://github.com/wshobson/agents --skill spark-memory-thermal-ops
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spark-memory-thermal-ops
Source: https://github.com/wshobson/agents/tree/main/plugins/dgx-spark-ops/skills/spark-memory-thermal-ops
Command: npx skills add https://github.com/wshobson/agents --skill spark-memory-thermal-ops

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

NVIDIA DGX Spark's GB10 chip shares one 128GB unified memory pool between CPU and GPU, so nvidia-smi underreports memory pressure and jobs OOM unexpectedly, while sustained power limits cause mid-run slowdowns that look like configuration bugs. This Skill provides the planning math, OOM remediation order, and thermal monitoring workflow to run multi-hour training jobs reliably on that hardware.

Core Features & Use Cases

  • UMA Memory Planning: Budget against free -g instead of nvidia-smi, estimate weights, optimizer states, gradients, and activations with the uma-accounting worksheet, and sanity-check against known anchors like 70B QLoRA at ~40GB.
  • Ordered OOM Remediation: Work the OOM Ladder in sequence — flush page cache first, then reduce batch size or packing length, then downgrade method from QLoRA to bf16 LoRA — instead of guessing.
  • Thermal and Power Monitoring: Sample GPU temperature and power every 30-60 seconds with the thermal-sample.sh script and correlate CSV output with training logs to distinguish throttling from config bugs.
  • Use Case: Before launching a 70B QLoRA fine-tune, estimate the footprint against the 128GB pool, start the thermal sampler, and when the run OOMs mid-load, flush the buffer cache before touching batch size.

Quick Start

Ask the AI to plan memory headroom for a training run on DGX Spark and set up thermal monitoring before launch.

Frequently Asked Questions about spark-memory-thermal-ops

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I plan memory for a training run on NVIDIA DGX Spark?

Budget against the free -g output, not nvidia-smi, since the 128GB pool is shared between CPU and GPU. Estimate weights, optimizer states, gradients, and activations from parameter count and dtype, then compare against known anchors like 70B QLoRA at roughly 40GB.

How do I fix CUDA OOM errors on DGX Spark unified memory?

Work the OOM ladder in order: first flush the page cache with sync and drop_caches, then reduce batch size or packing length, then downgrade the method from QLoRA to bf16 LoRA. Reducing batch size is never the first step.

Why does nvidia-smi show free memory but my training job still OOMs?

nvidia-smi and cudaMemGetInfo only report CUDA-allocator-visible memory, not page cache and mmap'd pages consuming the same unified pool. Model loading also creates a transient peak where mmap'd weights and CUDA copies coexist, doubling the footprint briefly.

Can I run vLLM or Ollama alongside training on DGX Spark?

Uncapped trainers and inference servers compete for the same 128GB pool and silently evict each other's pages without logging errors. A small capped workload like a sub-4GB LoRA fine-tune can coexist with vLLM capped at gpu-memory-utilization 0.5 or below.

Why does training throughput drop mid-run on DGX Spark?

A sustained ~100W power draw is the platform cap, not a configuration bug, so multi-hour runs throttle under sustained load. Sample temperature and power every 30-60 seconds with nvidia-smi and correlate the CSV timestamps with training logs to confirm throttling.