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

system-profile

하는 일

이 스킬은 프로그램이나 시스템의 CPU, 메모리, GPU, 네트워크 사용량 등 성능을 측정하고 병목을 보고합니다. 무엇이 느린지 이해하고 싶은 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓스크립트나 프로그램이 느려서 병목을 찾고 싶을 때.
  • ✓실행 중 GPU, 메모리, 상호 연결 사용량을 확인하고 싶을 때.
  • ✓느린 부분을 짚은 성능 요약이 필요할 때.

스킬 링크

https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/skills-codex/system-profile/SKILL.md

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

사용 방법

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

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

Use this skill to help me: https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/skills-codex/system-profile/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분.

작동 방식

에이전트는 Python 프로파일러나 GPU 모니터처럼 대상에 맞는 프로파일링 도구를 고르고, 필요하면 계측 코드를 추가합니다. 도구를 실행하고 결과를 분석한 뒤 요약을 작성합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

System Profile

Profile the specified target and summarize the results. Target: $ARGUMENTS

Instructions

You are a profiling assistant. Based on the user's target, choose appropriate profiling strategies, including writing instrumentation code when needed, then run profiling, analyze results, and produce a summary.

Step 1: Determine the profiling target

Parse $ARGUMENTS to understand what to profile. Examples:

  • A Python script or module
  • A running process (PID or service name)
  • A specific function or code block
  • An entire framework or system (e.g., "autogen", "vllm serving") — profile its end-to-end execution, identify bottlenecks across components
  • "gpu" / "interconnect" / "memory" for focused profiling

If $ARGUMENTS is empty or unclear, ask the user.

Step 2: Choose profiling methods

Select from external tools and/or code instrumentation as appropriate. Don't limit yourself to the examples below — use whatever makes sense for the target.

External tools (check availability first):

  • CPU: cProfile, py-spy, line_profiler, perf stat, /usr/bin/time -v
  • Memory: tracemalloc, memory_profiler, memray
  • GPU: nvidia-smi, nvidia-smi dmon, nvitop, torch.profiler, nsys
  • Interconnect: nvidia-smi topo -m, nvidia-smi nvlink, NCCL_DEBUG=INFO
  • System: strace -c, iostat, vmstat

Code instrumentation — when external tools are insufficient, write and insert profiling code into the target. Typical scenarios:

  • Timing specific code blocks (wall time vs CPU time)
  • Measuring CPU-GPU or GPU-GPU transfer size, frequency, and bandwidth
  • Tracking memory allocation across CPU and GPU to detect redundancy
  • Wrapping NCCL collectives to measure latency and throughput
  • Adding CUDA event timing around kernels

Design the instrumentation based on what you observe in the code — don't use a fixed template.

Step 3: Key dimensions to investigate

Depending on the target, focus on some or all of these:

CPU overhead

  • Context switching (voluntary / involuntary)
  • CPU utilization: ratio of CPU time to wall time
  • Per-function execution time hotspots

Memory overhead

  • CPU and GPU memory usage (allocated vs reserved vs peak)
  • Redundant replication: same data living on both CPU and GPU
  • Per-device allocation balance in multi-GPU setups

Interconnect & communication

  • CPU-GPU transfer: frequency, per-transfer size, total volume, bandwidth achieved
  • GPU-GPU transfer: P2P bandwidth, NVLink vs PCIe topology impact
  • NCCL collectives: operation type, message size distribution, latency
  • Communication-to-computation ratio

GPU compute

  • SM utilization, kernel launch overhead
  • Memory bandwidth utilization vs peak

Step 4: Instrumentation guidelines

When inserting code into the target:

  1. Read and understand the target code first
  2. Prefer wrapping (decorator, context manager, standalone runner) over inline edits
  3. If inline edits are necessary, mark them clearly (e.g., # [PROFILE] comments)
  4. Minimize observer effect — don't instrument tight inner loops; sample instead
  5. Collect results into a structured log, don't scatter print statements

Step 5: Run profiling

  1. Check available tools and hardware topology
  2. Run the chosen methods, capture all output
  3. Save artifacts (flamegraphs, traces, logs) to ./profile_output/

Step 6: Produce the report

Part A — Profiling results (structured tables by dimension, as applicable):

  • CPU overhead table
  • Memory overhead table (with redundancy column)
  • Interconnect table (transfer type / frequency / size / latency / bandwidth)
  • Hotspots / bottleneck identification
  • Actionable recommendations ranked by expected impact

Part B — Instrumentation changelog (MANDATORY): List every file that was modified or created for profiling purposes:

File Change type What was added/modified Line(s)
... modified ... ...
... created ... —

This allows the user to review and revert all instrumentation changes. Offer to clean up (remove all instrumentation) when the user is done.

자주 묻는 질문

무엇을 프로파일링할 수 있나요?

스크립트, 실행 중인 프로세스, 함수, GPU, 메모리, GPU 간 연결을 프로파일링할 수 있습니다.

제 코드를 바꾸나요?

프로그램의 일부를 측정하기 위해 계측 코드를 작성할 수 있습니다. 스킬 설명에는 주 로직을 다시 쓰는 내용이 없습니다.

대상이 불분명하면 어떻게 하나요?

스킬은 시작하기 전에 무엇을 프로파일링할지 확인하도록 요청합니다.

상세 정보

작성자의 원본 설명

Profile a target (script, process, GPU, memory, interconnect) for performance analysis. Use when user says \"profile\", \"benchmark\", \"bottleneck\", or wants performance analysis.

repo: wanshuiyin/Auto-claude-code-research-in-sleep

인기도

GitHub 스타
18k
순위
#10618
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬