본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)41k · #6686

spark-memory-thermal-ops

하는 일

이 도구는 긴 머신러닝 작업 중 강력한 컴퓨터(DGX Spark)의 메모리와 온도를 관리하도록 돕습니다. 메모리가 충분한지, 컴퓨터가 과열되지 않는지 확인합니다.

사용하는 경우

  • ✓긴 작업을 시작하기 전에 필요한 메모리 양을 알고 싶을 때.
  • ✓작업이 메모리 부족으로 실패한 경우.
  • ✓긴 작업 중 온도와 전력 소비를 모니터링할 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/wshobson/agents/blob/main/plugins/dgx-spark-ops/skills/spark-memory-thermal-ops/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“머신러닝 작업이 시작하기 전에 얼마나 많은 메모리를 쓸지 어떻게 알 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

그래픽 카드 메모리뿐 아니라 사용 가능한 전체 시스템 메모리를 확인합니다. 또한 온도와 전력을 모니터링해 컴퓨터가 느려지거나 멈추는 것을 막습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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

…

자주 묻는 질문

왜 `nvidia-smi`가 올바른 메모리를 보여 주지 않나요?

`nvidia-smi`는 프로그램이 직접 쓸 수 있는 메모리만 보여 줍니다. DGX Spark에서는 CPU와 GPU가 같은 메모리를 공유하며, 시스템의 다른 부분도 이 메모리를 쓰는데 `nvidia-smi`는 이를 보여 주지 않습니다.

작업이 'OOM'으로 실패했습니다. 어떻게 해야 하나요?

먼저 메모리 캐시를 비워 보세요. 그래도 안 되면 배치 크기나 시퀀스 길이를 줄이세요. 그래도 실패하면 더 간단한 학습 방법을 고려하세요.

긴 작업 중에 컴퓨터가 왜 느려지나요?

과열이나 전력 한도에 도달했기 때문일 수 있습니다. 이 도구는 이를 모니터링해 온도 문제인지 다른 원인인지 알 수 있게 합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
41k
순위
#6686
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬