---
name: gpu-aware-execution
description: Read x_hw_snapshot from capabilities_summary before GPU/memory-heavy work.
always: true
---
# GPU-aware execution planning
Read `x_hw_snapshot` from `capabilities_summary()` **before** planning any GPU-heavy or memory-heavy work. Key fields: `gpu_summary.count`, `gpu_summary.min_vram_bytes`, `gpu_summary.homogeneous`, `detection_backend`.
If `x_hw_snapshot` is absent, fall back to `torch.cuda.is_available()` and tell the user.
## Decision rules
**No GPU** (`count == 0`) -- do not plan CUDA/ROCm workflows. Suggest CPU-only alternatives (GGUF/llama.cpp) or a GPU-enabled provider.
**Single GPU** (`count == 1`) -- `min_vram_bytes` is your budget. Model memory ~ 2 bytes/param (fp16/bf16) or 4 bytes/param (fp32), plus optimizer states. If it does not fit: lower precision, quantize, gradient checkpointing. Do not silently split across CPU+GPU.
**Multi-GPU** (`count > 1`) -- if `homogeneous`, use data parallelism. If not, warn about load imbalance. Suggest tensor/pipeline parallelism only when the framework supports it.
**`detection_backend: none`** -- detection may have failed, not necessarily "no GPU". Suggest a runtime probe.
## Guardrails
- Never ignore `x_hw_snapshot` and launch a run that will OOM.
- Never silently downgrade the training objective to fit hardware -- use `load_skill_instructions` for `oom-recovery-playbook`.
- Never assume GPU presence when `count == 0` just because the user mentioned "GPU".
Summary
Proposing a new
always: trueskill (gpu-aware-execution) that teaches the agent to read thex_hw_snapshotextension fromcapabilities_summary()and use it to make hardware-aware decisions before launching GPU-heavy or memory-heavy work.This depends on the
hw_discoverymodule landing first (GPU/hardware auto-detection at startup).What the skill does
Instructs the agent to:
gpu_summary.count,min_vram_bytes,homogeneous, anddetection_backendfromx_hw_snapshot.count == 0: Don't plan CUDA/ROCm workflows; suggest CPU alternatives or GPU-enabled providers.count == 1: Usemin_vram_bytesas the memory budget, estimate model fit (~2 bytes/param fp16/bf16, ~4 bytes/param fp32), suggest mitigations if it doesn't fit.count > 1: Prefer data parallelism if homogeneous; warn about load imbalance if mixed GPUs.detection_backend: none: Detection may have failed -- suggest a runtime probe rather than assuming no GPU.oom-recovery-playbook), never assume GPU presence when hardware says otherwise.Proposed skill content
Design notes
always: trueskills (ml-execution-preflightis ~190 words).oom-recovery-playbook(reactive recovery) orml-execution-preflight(pre-launch checklist). This skill covers proactive hardware-aware planning only.hw_discoverymodule populatingx_hw_snapshotincapabilities_summary().docs/instructions/gpu-auto-discovery.mdQuestions for maintainers
always: trueskill, or should it bealways: falseand loaded on demand when the agent detects ML/GPU work?gpu_summary.min_vram_bytes) or stay more abstract to avoid coupling to the data model?