ASD

Spark Training Gotchas

Preflight y diagnóstico de los diez fallos conocidos de entrenamiento ML en NVIDIA DGX Spark; úsala ante fallos de arranque, OOM bajo el límite de 128GB, caídas de throughput o antes de runs largos en GB10.

Estrellas
38.8k

en todo el repo

Actividad
56

0–100, la ruta de este skill

Actualizado
el mes pasado

último commit aquí

Commits
1

últimos 90 días

Contexto
2k tok

59 tok en reposo

Paquete
3 archivos

20 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add wshobson/agents --skill spark-training-gotchas --agent claude-code

Se instala solo en este repositorio.

Qué hace

  • Diagnostica los diez fallos recurrentes de entrenamiento ML en NVIDIA DGX Spark, numerados G1–G10
  • Da síntoma, causa, comprobación y fix para cada gotcha (ABI de CUDA, flash-attn, OOM de UMA, throttling térmico, etc.)
  • Incluye `assets/preflight.sh` que ejecuta G1, G3, G4, G7, G9 y reporta PASS/FAIL/WARN/SKIP/INFO por gotcha
  • Referencia comandos completos de diagnóstico en `references/gotcha-checks.md`

Úsalo cuando

  • Un entrenamiento en DGX Spark falla al arrancar con un error de import o segfault sin causa clara
  • Un run hace OOM aunque `nvidia-smi` muestre memoria libre bajo el límite de 128GB
  • El throughput baja a mitad de un run que empezó bien
  • Antes de cualquier job de entrenamiento largo en GB10, o al conectar dos Sparks o elegir entre FP8 y NVFP4

No lo uses cuando

    Qué lo activa

    Di cualquiera de estas frases y el agente debería cargar este skill.

    • Mi entrenamiento en DGX Spark falla con undefined symbol al llamar .cuda()
    • Me hace OOM en Spark aunque nvidia-smi dice que hay memoria libre
    • Voy a lanzar un entrenamiento de varias horas en GB10, revisa antes
    • Configuré tensor parallelism entre dos Sparks y se cuelga

    SKILL.md

    En inglés

    Spark Training Gotchas

    DGX Spark's GB10 chip (Grace Blackwell, SM121, 128GB unified memory, aarch64) has ten recurring failure modes across launch, memory, thermals, bandwidth, and precision. Each is named G1–G10 so it can be checked by number — the numbering is load-bearing for tooling that runs these checks. Read this before a long run, not after hour six.

    When to Use This Skill

    • A training run fails to start, with an import error or a segfault that doesn't point at the real cause.
    • A run OOMs while nvidia-smi still shows headroom.
    • Throughput degrades partway through a run that started fine.
    • Before any multi-hour or multi-epoch job on GB10.
    • Wiring two Sparks together, before picking a parallelism strategy.
    • Choosing between FP8 and NVFP4 for a Spark-hosted run.

    Common Issues Quick Reference

    # Symptom Fix
    G1 undefined symbol / segfault cu130 wheel or container
    G2 flash-attn wrong backend used skip pip build; monkeypatch on NGC
    G3 OOM despite headroom drop page cache
    G4 throughput drop / reboot expect ~100W sustained cap
    G5 memory-bound step slow budget 180–192 GB/s
    G6 cache evicted mid-run one GPU server at a time
    G7 NVFP4 slower than FP8 stay FP8 unless sm_121a
    G8 playbook fails outright check upstream issues
    G9 env breaks after install use a container
    G10 2-Spark TP hangs DDP/FSDP only, never TP

    The Ten Gotchas

    G1: CUDA 12/13 ABI Mismatch

    • SYMPTOM: ImportError: undefined symbol naming a CUDA function, or a segfault on the first .cuda() call.
    • CAUSE: most PyPI wheels link libcudart.so.12; Spark ships CUDA 13. pip never checks CUDA ABI, so it surfaces only at import or first kernel launch.
    • CHECK: references/gotcha-checks.md G1 — the wheel's CUDA build tag.
    • FIX: reinstall from download.pytorch.org/whl/cu130 or use a matched container.

    G2: flash-attn — Skip the pip Build, Watch Unsloth's Auto-Detect

    • SYMPTOM: pip install flash-attn still fails/hangs. Unsloth may also silently train flash-attn over an explicitly requested SDPA.
    • CAUSE: no aarch64/sm_121 wheel for bare pip — but NGC containers ship a working SM121 flash-attn, and Unsloth auto-prefers it, dropping attn_implementation="sdpa".
    • CHECK: references/gotcha-checks.md G2 — is flash-attn already present and working.
    • FIX: bare pip — skip flash-attn, use SDPA (unchanged). On NGC — the only reliable override is the monkeypatch in references/gotcha-checks.md G2.

    G3: UMA OOM Below 128GB

    • SYMPTOM: OOM during model load/training while nvidia-smi still reports free memory under the 128GB cap — or, on some setups, [N/A] outright instead of a number.
    • CAUSE: mmap and the CUDA allocator double-count pages during safetensors load; QLoRA can OOM earlier than bf16 since dequantization adds transient allocs.
    • CHECK: references/gotcha-checks.md G3 — read free -g and /proc/meminfo, not nvidia-smi.
    • FIX: drop the page cache with sync; echo 3 > /proc/sys/vm/drop_caches — needs root, a between-run reset, not a mid-training step.

    G4: Thermal Throttling

    • SYMPTOM: throughput drops partway through a multi-hour run, or the box spontaneously reboots under sustained load.
    • CAUSE: sustained power draw caps around 100W versus the 240W rated figure; long runs push into that ceiling and throttle or, sometimes, reboot.
    • CHECK: references/gotcha-checks.md G4 — sample nvidia-smi --query-gpu=temperature.gpu,power.draw.
    • FIX: if power plateaus under 240W while temperature climbs, treat throttling as the cause; improve cooling or cap run length.

    G5: Bandwidth Ceiling

    • SYMPTOM: memory-bound workloads, decode-heavy RL loops especially, plateau well below expected throughput.
    • CAUSE: 273 GB/s is a spec ceiling, not sustained; measured bandwidth runs 180–192 GB/s.
    • CHECK: references/gotcha-checks.md G5 — observed step time vs. the measured range, not spec.
    • FIX: budget throughput from 180–192 GB/s; revise a plan built on the 273 GB/s figure.

    G6: Global UMA Resource Contention

    • SYMPTOM: a process's KV cache/weights get evicted mid-run silently, no OOM in its own logs.
    • CAUSE: unified memory is one global pool; an uncapped or near-capacity process competes with anything else and can evict it. A small, bounded workload doesn't — a <4GB LoRA coexists fine alongside vLLM capped at gpu-memory-utilization<=0.5.
    • CHECK: references/gotcha-checks.md G6 — other GPU-resident processes and whether capped.
    • FIX: the one-heavy-job rule applies to uncapped or near-capacity workloads — cap or stop unrelated servers first. A small, capped workload need not stop.

    G7: NVFP4 Slower Than FP8 on SM121

    • SYMPTOM: switching an inference workload from FP8 to NVFP4 on Spark makes it slower, not faster.
    • CAUSE: SM121 lacks cvt.e2m1x2 unless kernels target sm_121a; NVFP4 runs ~32% slower without it.
    • CHECK: references/gotcha-checks.md G7 — capability reports (12, 1); does the build target sm_121a?
    • FIX: stay on FP8 unless the build targets sm_121a.

    G8: Stale Official Playbooks

    • SYMPTOM: following an official DGX Spark playbook still fails, with no local misconfiguration explaining it.
    • CAUSE: official playbooks have shipped broken before; the stack moves faster than the docs.
    • CHECK: references/gotcha-checks.md G8 — the playbook repo's recent issues.
    • FIX: check github.com/NVIDIA/dgx-spark-playbooks issues before trusting a recipe for an expensive run.

    G9: Container-First, Not Bare Pip

    • SYMPTOM: a bare-pip environment that worked yesterday breaks after an unrelated pip install, or two "identical" environments behave differently.
    • CAUSE: bare pip lets Triton, xformers, and transformers drift independently; nothing pins them to GB10's SM121 target.
    • CHECK: references/gotcha-checks.md G9 — container or bare pip?
    • FIX: prefer an NGC container (see spark-environment-setup for tag guidance) or Unsloth's container. If bare pip is unavoidable, follow the NVIDIA install order, including --no-deps on Unsloth.

    G10: Dual-Spark Is DDP/FSDP Only

    • SYMPTOM: a tensor-parallel launch across two Sparks hangs, runs far slower than single-Spark, or errors out.
    • CAUSE: ConnectX-7 is fast enough for gradient/parameter sync (DDP, FSDP) but too thin for TP's fine-grained traffic.
    • CHECK: references/gotcha-checks.md G10 — the configured parallelism strategy.
    • FIX: on a two-Spark setup, choose DDP or FSDP, never tensor parallelism — TP is single-node only here.

    Fast Triage

    The cheapest checks to run before anything else:

    python3 -c "import torch; print(torch.version.cuda)"  # expect 13.x (G1); NGC builds have no +cu130 tag — that's not a failure
    
    import torch; print(torch.cuda.get_device_capability())  # expect (12, 1) (G7)
    
    { [ -f /.dockerenv -o -f /run/.containerenv ] || grep -qE 'docker|containerd' /proc/1/cgroup; } 2>/dev/null && echo container || echo unknown  # G9
    

    assets/preflight.sh runs G1, G3, G4, G7, G9 and produces one output line per gotcha in a fixed format: G-number first, then PASS/FAIL/WARN where automatable, SKIP when unavailable, or INFO: for a raw reading (G3, G4). Full commands: references/gotcha-checks.md. See also spark-environment-setup for the environment assumed working.

    Reproducido de wshobson/agents bajo licencia MIT. Leer esta página en markdown.

    Archivos

    3 archivos en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

    Antes de instalar

    Asume un entorno DGX Spark (GB10, SM121, aarch64) y complementa la skill spark-environment-setup.

    Necesita en el PATH:python3

    Detalles

    Creador
    wshobson
    Licencia
    MIT
    Recursos incluidos
    referencias
    Repositorio
    wshobson/agents
    Código fuente
    Ver SKILL.md

    Etiquetas

    Más de wshobson/agents

    Este repo incluye 180 skills. Si instalas uno, normalmente ya tienes los demás.

    Úsalo al seleccionar y colocar iconos, imágenes, SVGs, diagramas o infografías de apoyo aprobados en un PPTX editable.

    Costo de contexto al activarse
    344 tok
    Tamaño del paquete
    2 archivos
    Última actualización
    hace 26 días
    documentos

    Úsalo cuando pidan optimizar un prompt, mejorar su rendimiento, diseñar una plantilla, aplicar chain-of-thought, few-shot prompting o técnicas avanzadas de prompt engineering para producción.

    Costo de contexto al activarse
    1.3k tok
    Tamaño del paquete
    10 archivos
    Última actualización
    el mes pasado
    herramientas desarrollo

    Úsalo al redactar o reparar una especificación JSON con coordenadas explícitas para un PPTX editable.

    Costo de contexto al activarse
    489 tok
    Tamaño del paquete
    2 archivos
    Última actualización
    hace 26 días
    documentos

    Úsalo para validar o reparar un PPTX editable en cuanto a geometría, accesibilidad, editabilidad nativa, linaje de fuente e integridad del paquete OOXML.

    Costo de contexto al activarse
    409 tok
    Tamaño del paquete
    2 archivos
    Última actualización
    hace 26 días
    documentos

    Úsalo para analizar un PPTX de referencia en modo solo lectura: estructura, tema, tipografía, ritmo de layout, diagnósticos, catálogos de plantillas derivados o inspección segura del paquete OOXML.

    Costo de contexto al activarse
    689 tok
    Tamaño del paquete
    8 archivos
    Última actualización
    hace 26 días
    documentos

    Úsalo al preparar la narrativa, las fuentes y el contexto de diseño para un nuevo deck PPTX editable.

    Costo de contexto al activarse
    415 tok
    Tamaño del paquete
    2 archivos
    Última actualización
    hace 26 días
    documentos

    Skills relacionados

    Configura Turborepo para builds de monorepo eficientes con caché local y remota. Útil al configurar Turborepo, optimizar pipelines de build o implementar caching distribuido.

    Costo de contexto al activarse
    2k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 5 meses
    devops infraestructura

    Implementa observabilidad integral para service meshes, incluyendo tracing distribuido, métricas y visualización. Útil para monitoreo de mesh, depuración de latencia y SLOs.

    Costo de contexto al activarse
    708 tok
    Tamaño del paquete
    2 archivos
    Última actualización
    hace 2 meses
    devops infraestructura

    Define e implementa Indicadores (SLI) y Objetivos (SLO) de nivel de servicio con error budgets y alertas, para establecer metas de fiabilidad y prácticas SRE.

    Costo de contexto al activarse
    1.8k tok
    Tamaño del paquete
    2 archivos
    Última actualización
    hace 2 meses
    devops infraestructura