gpu-and-resource-operations
Detect and select local NVIDIA GPUs, report their resource status, and explain the explicitly opt-in GPU keep-alive without hiding hardware or CUDA limitations.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- gpu-and-resource-operations
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Detect and select local NVIDIA GPUs, report their resource status, and explain the explicitly opt-in GPU keep-alive without hiding hardware or CUDA limitations.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/gpu-status.md4.1 KB
- 参考文档references/keeper.md3.8 KB
- 参考文档references/troubleshooting.md3.7 KB
- 脚本scripts/gpu_status.py7.9 KB
03 SKILL.md 正文
GPU and resource operations
Use this skill for local, read-only GPU inspection and selection before an
experiment. It covers NVIDIA visibility, memory-based availability, the
reserve_last policy, and the optional keep-alive's safety contract. It does
not launch training, reserve a device through a scheduler, or start a keeper
implicitly.
Safety contract
- Begin with the bundled
scripts/gpu_status.py; it only invokesnvidia-smiqueries and never allocates CUDA memory. - Treat an absent, timed-out, or failed
nvidia-smiquery as no usable GPU. Never infer free devices from configuration, PyTorch importability, or a missing status result. - “Free” means reported
memory_used_mb < 1000by default, not that a device is exclusively reserved. Confirm ownership before launching work. reserve_last=trueis a selection policy for a keep-alive slot, not a lock. With one detected GPU it remains usable; with two or more, the highest listed index is excluded from experiment candidates.- Do not run the keep-alive during inspection. It allocates a CUDA tensor and performs repeated operations, so it is an explicit side effect requiring user approval.
Operating flow
- Run
python scripts/gpu_status.py --helpif the interface is unfamiliar; help must not probe hardware. - Run
python scripts/gpu_status.py(or add--jsonfor machine-readable output). Record the status reason when no GPU is reported. - Select only from
usable_gpusand then filter tofree_gpus. Keep the reserved device out of training when the default policy excludes it. - If the user explicitly chooses a device, report its
gpu_id, name, memory, utilization, and temperature before passing its ID to the experiment launcher. Local launchers express this asCUDA_VISIBLE_DEVICES. - Before CUDA work, verify both a working NVIDIA driver (
nvidia-smi) and a PyTorch build for whichtorch.cuda.is_available()is true. A Python package alone is not proof of CUDA support. - For SSH/Slurm status, scheduler allocation, or transport details, route to
execution-and-monitoring. For loop launch and experiment lifecycle, route toautonomous-experiments. For installing external skills, route toskills-and-installation.
Bundled references
- GPU status and selection — exact detector signatures, output shapes, query fields, thresholds, and edge cases.
- Keep-alive contract — explicit side effects, PyTorch/CUDA prerequisites, interval, signals, cleanup, and invocation rules.
- Troubleshooting — predictable driver, CUDA, parsing, selection, and keeper failures.
Output contract
A normal report should include:
detected: whether a complete local NVIDIA status was obtained;- one row per GPU with ID, name, used/total memory in MB, utilization percent, and temperature in °C;
usable_gpusafterreserve_lastpolicy;free_gpusafter the strict 1000-MB default threshold (or the stated override);- an explicit
reasonwhen detection/status is unavailable; and - whether a last device was excluded, without claiming a reservation lock.
When detected is false, both usable and free lists must be empty. Do not
silently substitute Slurm queue occupancy or a remote host's status for local
NVIDIA measurements.
If a report is used to choose a launch mask, preserve the host GPU IDs and the selection policy in the handoff. Re-run the read-only probe immediately before a long launch because memory and utilization are live observations, not a reservation. Never claim that a keeper is active unless its explicit process and stop/cleanup outcome have been checked.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).