Langsung ke konten
Skillpedia
Deploy & cloud (DevOps)41k Β· #6686

spark-memory-thermal-ops

Fungsinya

Tool ini membantu mengelola memori dan suhu pada komputer bertenaga besar (DGX Spark) saat menjalankan tugas machine learning yang panjang. Tool ini memastikan memori Anda cukup dan komputer tidak overheat.

Kapan dipakai

  • βœ“Sebelum memulai tugas panjang, untuk mengetahui berapa banyak memori yang akan dibutuhkan.
  • βœ“Jika tugas gagal karena kekurangan memori.
  • βœ“Untuk memantau suhu dan konsumsi daya selama tugas panjang.

Link skill

https://github.com/wshobson/agents/blob/main/plugins/dgx-spark-ops/skills/spark-memory-thermal-ops/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/wshobson/agents/blob/main/plugins/dgx-spark-ops/skills/spark-memory-thermal-ops/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBagaimana cara mengetahui berapa banyak memori yang akan dipakai tugas machine learning saya sebelum mulai?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Tool ini memeriksa total memori sistem yang tersedia, bukan hanya memori kartu grafis. Tool ini juga memantau suhu dan daya agar komputer tidak melambat atau berhenti bekerja.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Spark Memory & Thermal Ops

DGX Spark's GB10 chip has one 128GB unified memory (UMA) pool shared by CPU and GPU, and a sustained power ceiling well below its rated figure. Both break discrete-GPU assumptions: headroom isn't what nvidia-smi reports, and a run that starts fast will slow down mid-job with nothing misconfigured. This skill covers planning memory headroom, working an actual OOM, and watching thermals across a long job. For launch-time failure modes (ABI mismatches, flash-attn, playbook breakage), see spark-training-gotchas β€” this skill assumes the job starts.

Common Issues Quick Reference

Situation Do this
Planning headroom before launch Budget against free -g, not nvidia-smi β€” see UMA Memory Model
Job OOMs on unified memory Work the OOM Ladder in order: flush, then batch/pack, then method downgrade
Throughput drops mid-run Check the power/temp log before assuming a config bug β€” see Thermal Monitoring
Trainer + inference server both wanted Run one at a time β€” see Concurrent Workloads

When to Use This Skill

  • Sizing a training run against the 128GB pool before launch β€” will this model, method, and batch/pack combination fit.
  • A run OOMs mid-load or mid-step and the remediation order matters β€” what to try first, second, third.
  • Watching temperature and power during a multi-hour job, deciding whether a slowdown is thermal throttling or something else.
  • Planning to run a trainer alongside an inference server (vLLM, Ollama) on the same box.

UMA Memory Model

Spark has no separate GPU VRAM β€” the GPU and CPU share one 128GB pool. Two consequences:

  • nvidia-smi and cudaMemGetInfo underreport pressure β€” or report nothing at all. Both report CUDA-allocator-visible memory, not the pool's actual state β€” a box can show headroom in nvidia-smi and still OOM, because page-cache and mmap'd pages the allocator doesn't see consume the same pool. On some driver/setups, the memory query returns [N/A], [N/A] outright instead of a number β€” a script grepping for a numeric value there gets nothing, not a misleading undercount (see spark-training-gotchas gotcha G3).

  • Model load is a transient peak, not the steady state. Loading safetensors weights mmaps the file, then copies into CUDA tensors β€” for a window during load, both the mmap'd pages and the CUDA copy count against the pool at once. A model that fits while training can still OOM during load if headroom was sized for the post-load footprint instead of this doubled transient.

Plan and diagnose with free -g, not nvidia-smi:

free -g | awk 'NR==2 {print "free:", $4, "GB"}'

Rule of thumb: take that free figure, subtract a few GB for OS/driver overhead, and budget against the result β€” not the 128GB spec number. The worksheet in references/uma-accounting.md accepts parameter count, dtype, and method as input, and returns a memory estimate to compare against known anchors.

Planning Sequence

Before launch, work through these in order:

  1. Read free -g; subtract OS/driver overhead for the budget.
  2. Estimate weights + optimizer + gradients + activations from references/uma-accounting.md.
  3. Compare against the closest anchor (70B QLoRA, 27B LoRA, 9B full FT), not the estimate alone.
  4. If the estimate is close to the budget, start with shorter packing or a smaller batch β€” cheaper than hitting the OOM Ladder mid-run.

Example: Sizing a 70B QLoRA Run

A sanity check of the worksheet formula against the β‰ˆ40GB anchor:

params = 70e9
weights_gb = params * 0.5 / 1e9      # NF4, step 1
adapter_gb = 0.5                     # step 5, negligible
total_gb = weights_gb + adapter_gb   # + activations
print(f"{total_gb:.0f}GB before activations")

Weights alone land near the β‰ˆ40GB anchor β€” a plan estimating far above that for the same model class is a signal to recheck dtype and method.

The OOM Ladder

When a job OOMs on unified memory, work this ladder in order. Each step is more disruptive than the last β€” don't skip ahead: reducing batch size is never step 1.

  1. Flush the buffer cache. Page cache from a previous run or a large dataset read often accounts for GB of the "missing" headroom. This costs nothing but a rerun and doesn't touch the job's configuration:

    sync; echo 3 > /proc/sys/vm/drop_caches
    

    Needs root; a between-run reset, not a

…

Pertanyaan umum

Mengapa `nvidia-smi` tidak menampilkan memori yang benar?

`nvidia-smi` hanya menampilkan memori yang bisa langsung dipakai program. Di DGX Spark, CPU dan GPU memakai memori yang sama, dan bagian sistem lain juga memakai memori ini, yang tidak ditampilkan oleh `nvidia-smi`.

Tugas saya gagal dengan 'OOM'. Apa yang harus dilakukan?

Pertama, coba bersihkan cache memori. Jika belum berhasil, kurangi batch size atau sequence length. Jika masih gagal, pertimbangkan metode training yang lebih sederhana.

Mengapa komputer saya melambat saat menjalankan tugas panjang?

Hal ini bisa disebabkan oleh overheating atau komputer mencapai batas dayanya. Tool ini membantu memantaunya sehingga Anda tahu apakah masalahnya ada pada suhu atau penyebab lain.

Detail

Deskripsi asli dari pembuat

Manage unified memory and thermals during long-running ML jobs on NVIDIA DGX Spark. Use when planning memory headroom for a training run on GB10, when a job OOMs on unified memory, or when monitoring temperature and power during multi-hour training.

repo: wshobson/agents

Popularitas

Bintang GitHub
41k
Peringkat
#6686
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa