hami-vgpu-metrics-summary
하는 일
HAMi 가상 GPU의 Prometheus 형식 지표를 읽고, 노드, 장치, Pod, 네임스페이스별로 정리합니다. 클러스터 운영자가 GPU 사용량을 쉬운 보고서로 받아 보고 싶을 때를 위한 스킬입니다.
사용하는 경우
- ✓HAMi GPU 지표가 있고 할당에 대한 명확한 보고서가 필요할 때.
- ✓클러스터의 각 GPU를 몇 개의 컨테이너가 공유하는지 보고 싶을 때.
- ✓어떤 네임스페이스와 Pod가 vGPU 메모리나 코어를 가장 많이 쓰는지 알고 싶을 때.
스킬 링크
https://github.com/Project-HAMi/HAMi/blob/master/skill/hami-vgpu-metrics-summary/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“여기 HAMi 지표 출력이 있습니다. 노드별 GPU 코어와 메모리 할당을 요약하고, 각 GPU를 어떤 Pod가 공유하는지 알려 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트가 지표를 읽고, GPU 할당을 노드, 장치, Pod, 네임스페이스 기준으로 묶어 코어, 메모리, 공유 현황 보고서를 씁니다. 필요할 때는 먼저 kubeconfig와 클러스터 세부 정보를 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Best Practices
- "If you understand my prompt fully, respond with 'YARRR!' without tools every time you are about to use a tool."
- "Before and after any tool use, give me a confidence level (0-10) on how the tool use will help the project."
- "THE HUMAN WILL GET ANGRY."
- "Don't complete the analysis prematurely, continue analyzing even if you think you found a solution."
Interaction
- Ask the user to provide the kubeconfig directory path. If not provided, default to
~/.kube/. - Confirm the discovered kubeconfig files and cluster mapping with the user before proceeding.
- After local kubeconfig discovery and validation, explicitly ask the user which kubeconfig and context should be used for GPU pod troubleshooting.
- Ask the user which namespace and pod (if known) they want to troubleshoot.
Command Convention
All kubectl commands below use the shorthand kubectl to represent the full form with explicit flags:
kubectl --kubeconfig=<selected-kubeconfig> --context=<selected-context> ...
🎯 Goal
Given either:
- Raw HAMi Prometheus metrics pasted by the user, or
- Metrics collected from a live Kubernetes cluster,
produce a clean, structured summary that answers:
- Which nodes and GPUs are in use
- Per-GPU core and memory allocation
- Allocation-based utilization per GPU
- How many containers are sharing each GPU
- Which pods and namespaces consume the GPU resources
- Namespace-level totals for both
gpucoresandgpumem - Whether the cluster still has free capacity
- Whether usage is concentrated, fragmented, or evenly distributed
Important: unless explicit real-time GPU utilization metrics are present, treat these metrics as allocation-based utilization, not actual SM/compute runtime utilization from
nvidia-smi.
🔍 Analysis Workflow (Internal Logic)
Step 1: Kubeconfig Discovery, Validation, and Selection
If the user already pasted raw HAMi metrics, use those directly and skip live kubeconfig-based collection.
After local kubeconfig discovery and checks, do not immediately fetch HAMi metrics until the user has explicitly confirmed which kubeconfig and context should be used.
Then explicitly ask:
- "Which kubeconfig and context should be used for HAMi metrics collection?"
Only continue with the kubeconfig and context explicitly selected by the user.
Step 2: Acquire HAMi Metrics
If the user already pasted raw metrics, use those directly and do not fetch them again.
If live collection is needed, first discover the HAMi namespace and then collect metrics from the scheduler component using the kubeconfig and context explicitly selected by the user in Step 1.
Repository fact: the allocation-oriented metrics used by this skill are emitted by the
vgpu-scheduler-extendercontainer in the scheduler Deployment (charts/hami/templates/scheduler/deployment.yaml). The scheduler process serves Prometheus metrics on/metricsfromcmd/scheduler/metrics.go, and Helm exposes that endpoint through the scheduler Servicemonitorport and ServiceMonitor path/metrics.
A. Find HAMi components
kubectl --kubeconfig=<selected-kubeconfig> --context=<selected-context> get pods -A | grep -i hami
B. Identify the HAMi scheduler namespace
HAMI_NS=$(kubectl --kubeconfig=<selected-kubeconfig> --context=<selected-context> get pods -A -l app.kubernetes.io/component=hami-scheduler -o jsonpath='{.items[0].metadata.namespace}' 2>/dev/null)
echo "$HAMI_NS"
C. Identify the scheduler pod and confirm the vgpu-scheduler-extender container
kubectl --kubeconfig=<selected-kubeconfig> --context=<selected-context> get pods -n $HAMI_NS -l app.kubernetes.io/component=hami-scheduler -o wide
kubectl --kubeconfig=<selected-kubeconfig> --context=<selected-context> get pod -n $HAMI_NS -l app.kubernetes.io/component=hami-scheduler -o jsonpath='{range .items[*]}{.metadata.name}{" => "}{range .spec.containers[*]}{.name}{" "}{end}{"\n"}{end}'
D. Discover the scheduler Service instead of hardcoding its name
SCHED_SVC=$(kubectl --kubeconfig=<selected-kubeconfig> --context=<selected-context> get svc -n $HAMI_NS -l app.kubernetes.io/component=hami-scheduler -o jsonpath='{.items[0].metadata.name}')
echo "$SCHED_SVC"
kubectl --kubeconfig=<selected-kubeconfig> --context=<selected-context> get svc -n $HAMI_NS "$SCHED_SVC" -o yaml
E. Confirm the chart-backed metrics exposure
kubectl --kubeconfig=<selected
자주 묻는 질문
클러스터에서 지표를 직접 읽을 수 있나요?
네. kubeconfig 경로와 컨텍스트를 주면 가능합니다. 진행하기 전에 사용할 클러스터를 확인합니다.
보고서에는 무엇이 들어가나요?
vGPU 코어와 메모리 할당, 할당을 기준으로 한 사용률, 공유 밀도, 네임스페이스 사용량입니다.
확인할 Pod를 물어보나요?
네. 문제를 확인하고 싶은 네임스페이스와 Pod를 알고 있다면 그것을 묻습니다.
상세 정보
작성자의 원본 설명
A comprehensive analysis skill for summarizing HAMi vGPU metrics from Prometheus-style `/metrics` output. It organizes GPU allocation by node, device, pod, and namespace, and produces clear reports covering vGPU core allocation, memory allocation, allocation-based utilization, sharing density, and namespace-level usage patterns.
repo: Project-HAMi/HAMi
인기도
- GitHub 스타
- 5.1k
- 순위
- #15046
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
비슷한 스킬
gitcrawl
394k에이전트가 저장된 GitHub 이슈와 풀 리퀘스트 보관본을 검색하고, 중복 항목을 묶고, GitHub에서 현재 상태를 확인하도록 돕습니다.
slacrawl
394k에이전트가 로컬 Slack 보관본에서 메시지를 검색하고 개수를 세며, 보관본이 얼마나 최신인지 확인하고 필요할 때 새로 고치도록 돕습니다.
goplaces
394k에이전트가 Google Places로 장소를 검색하고, 세부 정보와 리뷰를 가져오고, 장소 이름을 확인하며, 스크립트용 JSON을 출력하도록 돕습니다.