project-hami/hami/hami-vgpu-metrics-summary
Claude Code and agent skill by project-hami/hami
- community
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install project-hami/hami/hami-vgpu-metrics-summarySKILL.md
The same SKILL.md was published earlier as project-hami/hami/hami-vgpu-metrics-summary.
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:
π― 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 fromnvidia-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 thevgpu-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
B. Identify the HAMi scheduler namespace
C. Identify the scheduler pod and confirm the `vgpu-scheduler-extender` container
D. Discover the scheduler Service instead of hardcoding its name
E. Confirm the chart-backed metrics exposure
Repository-backed defaults and relationships:
- Deployment container:
vgpu-scheduler-extender - Scheduler metrics bind address default:
:9395 - Container metrics port name:
metrics - Service port name:
monitor - Default Service
monitorport:31993 - Default Service targetPort:
metrics(the named container port, which followsscheduler.metricsBindAddress) - Metrics path:
/metrics
F. Port-forward the scheduler Service and fetch metrics
G. Alternative: port-forward the scheduler pod directly
Prefer the scheduler endpoint above for allocation summaries. Do not default to vGPU monitor when the task is to summarize scheduler allocation state by device, pod, or namespace. The vGPU monitor exports runtime NVML/container usage metrics on a different component and default port (:9394), which are useful for real usage but not a replacement for scheduler allocation metrics.
Step 3: Identify Relevant Metric Families
HAMi currently has two important metric surfaces relevant to GPU analysis:
- Scheduler allocation metrics from
cmd/scheduler/metrics.go - vGPU monitor runtime metrics from
cmd/vGPUmonitor/metrics.go
For this skill, prefer scheduler allocation metrics.
A. Preferred scheduler metrics: current names
These are the primary metrics if --legacy-metrics=false:
Device-level allocation
hami_gpu_core_allocated_ratiohami_gpu_core_limit_ratiohami_gpu_memory_allocated_byteshami_gpu_memory_limit_byteshami_gpu_shared_counthami_node_gpu_memory_allocated_ratiohami_node_gpu_overviewhami_node_gpu_mig_instance_info
Pod-level allocation
hami_vgpu_core_allocated_ratiohami_vgpu_memory_allocated_bytes
Namespace/quota-level aggregation
hami_resource_quota_usedhami_resource_quota_limit
Scheduler state
hami_scheduler_is_leaderhami_scheduler_cache_syncedhami_scheduler_last_sync_success_timestamp_seconds
Scheduler allocation outcomes
hami_scheduler_allocations_totalhami_scheduler_allocation_failures_totalhami_scheduler_bind_rollbacks_totalhami_scheduler_allocation_duration_seconds
Build metadata
hami_build_info
All scheduler metrics are wrapped with a constant label:
zone="vGPU"
B. Backward-compatible legacy scheduler metrics
If the scheduler is started with --legacy-metrics=true, the same allocation state is also emitted under older names:
Device-level allocation
GPUDeviceCoreAllocatedGPUDeviceCoreLimitGPUDeviceMemoryAllocatedGPUDeviceMemoryLimitGPUDeviceSharedNumnodeGPUMemoryPercentagenodeGPUOverviewnodeGPUMigInstance
Pod-level allocation
vGPUCoreAllocatedvGPUMemoryAllocated
Namespace/quota-level aggregation
QuotaUsed
C. Runtime-only vGPU monitor metrics (current names)
These come from cmd/vGPUmonitor/metrics.go and should be treated separately:
Host device runtime metrics
hami_host_gpu_memory_used_bytesβ physical GPU memory usagehami_host_gpu_utilization_ratioβ physical GPU core utilization (0-100)hami_host_gpu_memory_controller_utilization_ratioβ GPU memory controller utilizationhami_host_gpu_unknown_process_countβ current count (Gauge) of distinct compute/graphics processes not matched to a container allocated that GPU by HAMi. Opt-in:HAMI_MONITOR_UNKNOWN_PROCESSES=trueanddevicePlugin.hostPID=true. Known MIG/MPS/remote modes are skipped; failed supported-device inventories omit the sample and sethami_vgpumonitor_collect_successto 0. Unknown does not imply unauthorized use.
Per-container vGPU runtime metrics
hami_vgpu_memory_used_bytesβ vGPU memory usage per containerhami_vgpu_memory_limit_bytesβ vGPU memory limit per containerhami_container_device_utilization_ratioβ container device SM utilizationhami_container_last_kernel_elapsed_secondsβ seconds since last kernel executionhami_vgpu_memory_context_bytesβ memory context sizehami_vgpu_memory_module_bytesβ memory module sizehami_vgpu_memory_buffer_bytesβ memory buffer size
MIG runtime identity
hami_mig_device_infoβ MIG runtime identity per container
Use them only as runtime complements. They do not replace scheduler allocation metrics for namespace/device allocation summaries.
D. Backward-compatible legacy vGPU monitor metrics
If the vGPU monitor is started with --legacy-metrics=true, the same runtime state is also emitted under older names:
Host device runtime metrics
HostGPUMemoryUsageβ physical GPU memory usageHostCoreUtilizationβ physical GPU core utilization
Per-container vGPU runtime metrics
vGPU_device_memory_usage_in_bytesβ vGPU memory usage per containervGPU_device_memory_limit_in_bytesβ vGPU memory limit per containerDevice_memory_desc_of_containerβ container device memory descriptionDevice_utilization_desc_of_containerβ container device utilizationDevice_last_kernel_of_containerβ last kernel execution time
MIG runtime identity
MigInfoβ MIG runtime identity per container
Ignore unrelated generic Prometheus metrics unless they help with context.
Step 4: Normalize Units and Semantics
The agent must normalize units before reporting.
A. Scheduler metrics are allocation-state, not live hardware telemetry
The scheduler collector reports values derived from the scheduler's cached node/device/pod/quota state:
- node/device data comes from scheduler node usage structures
- pod/container data comes from
PodManager.GetScheduledPods() - quota data comes from
QuotaManager.GetResourceQuota()
These values answer what HAMi believes is allocated, not what the GPU is physically consuming right now.
B. GPU core semantics
gpucoresbehaves like a share scale, normally with full device =100- Despite metric names ending in
_ratio, scheduler core metrics expose raw share-style values such as0,30,50,100 - Interpret these as allocation units on a 0-100 scale unless the deployment has custom device semantics
Example:
100= full GPU core share50= half GPU core share30= 30% share
Use this calculation for normalized reporting:
$$ \text{Core Allocation Percentage} = \frac{\text{allocated cores}}{\text{core limit}} \times 100 $$
C. GPU memory semantics
Be careful: different metric families use different units.
Scheduler device/container memory metrics
hami_gpu_memory_allocated_byteshami_gpu_memory_limit_byteshami_vgpu_memory_allocated_bytes- legacy
GPUDeviceMemoryAllocated - legacy
GPUDeviceMemoryLimit - legacy
vGPUMemoryAllocated
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskill/hami-vgpu-metrics-summary/SKILL.md
Popularity
- Repository stars
- 3,995
- Repository forks
- 625
- 7-day trend score
- 41
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/project-hami/hami/hami-vgpu-metrics-summary)