/mlops-skills:gpu-accelerator-infrastructure-for-ml-trainingfrom mlops-skills
Guides standing up GPU accelerator infrastructure on Kubernetes for ML training and serving — installing NVIDIA GPU Operator, partitioning GPUs with MIG, designing GPU node pools, and bin-packing pods to reduce fragmentation and idle spend.
Ships in mlops-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
GPUs are the single most expensive line item in most ML platforms, and they
are also the resource most likely to sit idle or fragmented if the
underlying infrastructure isn't deliberately designed. This skill covers
building the Kubernetes-native GPU platform layer: installing the NVIDIA
GPU Operator so nodes expose nvidia.com/gpu as a schedulable resource,
partitioning large GPUs (A100/H100) into right-sized Multi-Instance GPU
(MIG) slices instead of handing a whole 80GB card to a job that needs 10GB,
and designing node pools and bin-packing/scheduling rules so training and
serving workloads share capacity efficiently instead of each landing on its
own mostly-idle node. Getting this layer wrong is expensive twice over: too
loose, and jobs fragment GPUs and burn budget on underutilized hardware;
too rigid, and legitimate training jobs queue for hours waiting on capacity
that technically exists but isn't schedulable in the shape they asked for.
This skill covers the infrastructure that must exist before a job can even
request a GPU correctly — validating that a specific job's request against
that infrastructure is covered by
gpu-accelerator-configuration-validation.
ClusterPolicy, NodeFeatureDiscovery) and to label/taint nodes.Install the NVIDIA GPU Operator via Helm, letting it manage the driver, container toolkit, device plugin, and DCGM exporter as a coordinated stack rather than installing each piece by hand:
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
helm repo update
helm install gpu-operator nvidia/gpu-operator \
--namespace gpu-operator --create-namespace \
--set driver.version="550.90.07" \
--set mig.strategy=mixed \
--set devicePlugin.config.name=mig-parted-config
mig.strategy=mixed allows nodes to run a combination of MIG-partitioned
and non-MIG GPUs in the cluster (vs. single, which requires a
cluster-wide uniform MIG layout). If nodes already have NVIDIA drivers
pre-installed (common on cloud GPU-optimized images), set
driver.enabled=false so the operator doesn't try to install a
conflicting driver.
Verify the device plugin is healthy and GPUs are schedulable before trusting the cluster to run anything on them:
kubectl get pods -n gpu-operator
kubectl get nodes -o json | jq '.items[].status.capacity | select(.["nvidia.com/gpu"])'
A node with a physically present GPU but no nvidia.com/gpu entry in
status.capacity means the device plugin isn't running correctly on
that node — a training job's pod will still schedule (onto CPU-only
scheduling) unless its resource request is validated, which is exactly
the silent-fallback failure mode covered in
gpu-accelerator-configuration-validation.
Partition large GPUs with MIG when workloads don't need a full card.
Define the MIG layout in a ConfigMap referenced by mig-parted-config,
then apply a profile per node via label:
apiVersion: v1
kind: ConfigMap
metadata:
name: mig-parted-config
namespace: gpu-operator
data:
config.yaml: |
version: v1
mig-configs:
all-3g.20gb:
- devices: all
mig-enabled: true
mig-devices:
"3g.20gb": 2 # 2x A100-80GB sliced into 3g.20gb instances
all-1g.10gb:
- devices: all
mig-enabled: true
mig-devices:
"1g.10gb": 7 # max 1g.10gb slices on an 80GB A100
kubectl label node gpu-node-a100-01 nvidia.com/mig.config=all-3g.20gb --overwrite
Larger profiles (7g.80gb, a whole card) suit large training jobs;
smaller profiles (1g.10gb, 2g.20gb) suit inference and notebooks.
Mixing profile sizes on one node is possible but adds scheduling
complexity — start with a uniform profile per node pool.
Design node pools around workload shape, not just GPU SKU. Separate pools for training (larger GPUs, full-card or large MIG slices, tolerant of longer scheduling latency) and serving (smaller MIG slices or time-sliced GPUs, low-latency autoscaling) prevent a long-running training job from starving a latency-sensitive serving deployment of capacity, and vice versa:
# Example node pool taint/label convention
# Training pool: full A100s, tainted so only training jobs land here
kubectl taint nodes gpu-node-a100-01 workload=training:NoSchedule
kubectl label nodes gpu-node-a100-01 gpu-pool=training gpu-sku=a100-80gb
# Serving pool: MIG-partitioned L4/A100 slices for inference
kubectl taint nodes gpu-node-l4-01 workload=serving:NoSchedule
kubectl label nodes gpu-node-l4-01 gpu-pool=serving gpu-sku=l4
Pods then carry matching tolerations and nodeSelector/nodeAffinity
— see the worked example below for the full pod spec.
Bin-pack deliberately rather than letting the default scheduler
spread pods across nodes. For MIG slices and fractional GPU workloads,
use a PriorityClass plus the Kubernetes scheduler's default bin-packing
behavior on nvidia.com/gpu requests, or adopt a batch scheduler (Kueue,
Volcano, or YuniKorn) for gang-scheduling and queueing when many small
jobs compete for a fixed pool:
apiVersion: v1
kind: Pod
metadata:
name: mig-inference-worker
spec:
nodeSelector:
gpu-pool: serving
tolerations:
- key: workload
operator: Equal
value: serving
effect: NoSchedule
containers:
- name: worker
image: registry.internal/inference:1.4.0
resources:
limits:
nvidia.com/mig-1g.10gb: 1
Without an explicit bin-packing policy, the default scheduler's least-requested-resources heuristic tends to spread pods across nodes to balance load — the opposite of what you want for GPU cost efficiency, where consolidating small jobs onto fewer fully-packed nodes (and letting the cluster autoscaler/Karpenter scale down empty nodes) is usually cheaper. See karpenter-cluster-autoscaling for consolidation-aware node autoscaling that complements this.
Enable time-slicing or MPS for workloads that tolerate GPU sharing without hard MIG isolation (e.g. many low-traffic inference replicas):
apiVersion: v1
kind: ConfigMap
metadata:
name: time-slicing-config
namespace: gpu-operator
data:
any: |
version: v1
flags:
migStrategy: none
sharing:
timeSlicing:
resources:
- name: nvidia.com/gpu
replicas: 4
Time-slicing gives no memory or fault isolation between the 4 sharing pods (unlike MIG) — use it only for workloads where one noisy neighbor degrading another is an acceptable tradeoff for higher utilization, never for multi-tenant workloads with different trust boundaries.
Monitor GPU utilization, not just allocation, using the DCGM exporter the GPU Operator installs, scraped by Prometheus:
avg by (node) (DCGM_FI_DEV_GPU_UTIL)
A node pool where nvidia.com/gpu is 100% allocated (every slice
claimed by a pod) but DCGM_FI_DEV_GPU_UTIL sits at 5% means jobs are
holding GPU resources without using them — a capacity-planning problem
worth catching before provisioning more nodes.
ClusterPolicy rather than tracking "latest," and roll out driver
upgrades to a canary node pool first — a driver bump that breaks a
specific CUDA version used by training images is a cluster-wide outage
if rolled out everywhere at once.gpu-sku=a100-80gb, mig-profile=3g.20gb) so scheduling decisions and
cost attribution are visible from kubectl get nodes --show-labels
rather than tribal knowledge.Symptom: A training job that requests no GPU resource (or a
malformed resource key) schedules successfully onto a CPU-only node,
runs to completion at a fraction of expected speed, and nobody is
alerted — the job "succeeds" with a garbage checkpoint or simply takes
10x longer with no error.
Warning: This is a genuinely dangerous silent-failure mode, not just
a slow job — a multi-hour or multi-day training run silently falling
back to CPU wastes the entire compute budget for that run and can delay
a release with no signal until someone notices the wall-clock time.
Fix: Never rely on "the job didn't error" as a signal it used a GPU.
Enforce GPU scheduling correctness before the job runs — see
gpu-accelerator-configuration-validation
for admission-time validation and in-job fail-fast checks — and alert on
DCGM_FI_DEV_GPU_UTIL being near-zero for a pod that has a GPU resource
request, which independently catches drivers/toolkit mismatches that let
a pod schedule onto a GPU node but silently execute CPU-only kernels.
Symptom: Installing the NVIDIA GPU Operator on a managed Kubernetes
cluster (EKS/AKS/GKE) that already ships its own GPU device plugin or
pre-installed driver results in two device plugins registering the same
nvidia.com/gpu resource, causing pods to schedule but fail at
container-create time with driver/library version mismatches.
Fix: Check whether the managed cluster's GPU-optimized node image
already installs a driver and device plugin before installing the GPU
Operator; if so, either use the cloud provider's native tooling instead
of the GPU Operator, or explicitly disable the operator's driver and
devicePlugin components (driver.enabled=false,
devicePlugin.enabled=false if the cloud plugin is kept) so exactly one
device plugin manages the resource.
Symptom: A MIG profile change (e.g. switching a node from
all-1g.10gb to all-3g.20gb) is applied while pods are still running
on that node's existing MIG instances, and those pods are evicted
mid-training with no checkpoint saved.
Fix: Cordon and drain the node before changing its MIG profile label
(kubectl cordon then kubectl drain --ignore-daemonsets) — the GPU
Operator's MIG manager reconfigures the physical GPU when the label
changes, which requires resetting any GPU currently in use, destroying
the state of anything running on it.
Symptom: GPU nodes show low average utilization (10-20%) despite
nvidia.com/gpu capacity being fully allocated across the pool, and the
team concludes they need to buy more GPU nodes.
Fix: This is usually a bin-packing/right-sizing problem, not a
capacity problem — check whether small jobs are each claiming a full GPU
or an oversized MIG slice instead of the smallest profile that fits, and
whether jobs are actually GPU-bound at all (a data-loading-bottlenecked
training job can hold a GPU near-idle while waiting on I/O). Fix the
workload's resource request and data pipeline before provisioning more
hardware.
Symptom: After enabling GPU time-slicing to increase inference throughput, one tenant's memory-heavy request causes CUDA out-of-memory errors in an unrelated tenant's replica sharing the same physical GPU. Fix: Time-slicing shares GPU memory with no isolation between replicas — this is expected behavior, not a bug. Move workloads that need memory isolation to MIG partitioning instead, which enforces a hard memory boundary per instance, and reserve time-slicing for workloads from a single trust boundary with well-understood memory footprints.
Scenario: A platform team has four A100-80GB nodes and needs to support both large fine-tuning jobs (need most of a GPU) and a fleet of small inference services (each needs ~10GB). They partition two nodes for training (full-card) and two for serving (MIG-sliced), with monitoring to catch idle capacity.
Training node pool (full A100, no MIG):
kubectl label nodes gpu-node-a100-01 gpu-node-a100-02 \
gpu-pool=training gpu-sku=a100-80gb
kubectl taint nodes gpu-node-a100-01 gpu-node-a100-02 \
workload=training:NoSchedule
Serving node pool (MIG 1g.10gb x7 per card):
apiVersion: v1
kind: ConfigMap
metadata:
name: mig-parted-config
namespace: gpu-operator
data:
config.yaml: |
version: v1
mig-configs:
all-1g.10gb:
- devices: all
mig-enabled: true
mig-devices:
"1g.10gb": 7
kubectl label nodes gpu-node-a100-03 gpu-node-a100-04 \
gpu-pool=serving nvidia.com/mig.config=all-1g.10gb --overwrite
kubectl taint nodes gpu-node-a100-03 gpu-node-a100-04 \
workload=serving:NoSchedule
Training job pod spec (targets the training pool, requests a full GPU):
apiVersion: batch/v1
kind: Job
metadata:
name: finetune-llm-run-214
spec:
template:
spec:
nodeSelector:
gpu-pool: training
tolerations:
- {key: workload, operator: Equal, value: training, effect: NoSchedule}
containers:
- name: trainer
image: registry.internal/finetune:2.3.0
resources:
limits:
nvidia.com/gpu: 1
restartPolicy: Never
Inference deployment (targets the serving pool, requests one MIG slice per replica, 14 replicas fit across the two serving nodes):
apiVersion: apps/v1
kind: Deployment
metadata:
name: fraud-scorer-inference
spec:
replicas: 14
template:
spec:
nodeSelector:
gpu-pool: serving
tolerations:
- {key: workload, operator: Equal, value: serving, effect: NoSchedule}
containers:
- name: server
image: registry.internal/fraud-scorer-server:8
resources:
limits:
nvidia.com/mig-1g.10gb: 1
DCGM_FI_DEV_GPU_UTIL dashboards per pool then show whether the training
pool is actually compute-bound during runs and whether the 14 serving
replicas are bin-packed at the expected 7-per-node density rather than
spread thin across more nodes than needed.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
22 skills in this plugin
/complete-mlops-platform-deployment-on-aws-from-scratchSequences a complete, end-to-end MLOps platform deployment on AWS from a bare AWS Organization to a production-ready platform serving a first retrained model — AWS landing zone, the SageMaker-vs-EKS+Kubeflow platform decision (EKS+Kubeflow is the worked path here), GPU node pools via the NVIDIA GPU Operator, MLflow experiment tracking on S3, a Kubeflow Pipelines retraining DAG, model registry/packaging with gated promotion, KServe canary/shadow serving, and drift monitoring. This is an integration/orchestration skill that sequences several existing tool-specific skills in the correct order and flags the handoff points between them — it does not restate their internals. Use when a user asks to "stand up an MLOps platform on AWS from scratch," "build the full ML training-to-serving pipeline on EKS/SageMaker," "give me the end-to-end sequence from AWS account to a retrained, monitored production model," or "decide between SageMaker and EKS+Kubeflow for our ML platform."
/complete-mlops-platform-deployment-on-azure-from-scratchSequences a complete, end-to-end MLOps platform deployment on Azure from a bare tenant to a production-ready platform serving a first retrained model — Azure landing zone, the Azure-ML-vs-AKS+Kubeflow platform decision (Azure ML is the worked path), GPU compute clusters/quota, MLflow-compatible experiment tracking, an Azure ML pipeline retraining DAG, Model Registry with gated promotion, managed online endpoints with traffic-split canary rollout, and data-drift monitoring. An integration/ orchestration skill that sequences existing tool-specific skills in the right order and flags handoff points — it does not restate their internals. Use when a user asks to "stand up an MLOps platform on Azure from scratch," "build the full ML training-to-serving pipeline on Azure ML/AKS," "give me the end-to-end sequence from Azure tenant to a retrained, monitored production model," or "decide between Azure ML and AKS+Kubeflow for our ML platform."
/complete-mlops-platform-deployment-on-gcp-from-scratchSequences a complete, end-to-end MLOps platform deployment on GCP from a bare Google Cloud Organization to a production-ready platform serving a first retrained model — GCP landing zone, the Vertex-AI-vs-GKE+Kubeflow platform decision (Vertex AI is the worked path), GPU quota and accelerator-backed custom training, Vertex AI Experiments tracking, a Vertex AI Pipelines retraining DAG, Model Registry with gated promotion, endpoints with traffic-split canary rollout, and Vertex AI Model Monitoring for drift. An integration/orchestration skill that sequences existing tool-specific skills in the right order and flags handoff points — it does not restate their internals. Use when a user asks to "stand up an MLOps platform on GCP from scratch," "build the full ML training-to-serving pipeline on Vertex AI/GKE," "give me the end-to-end sequence from GCP org to a retrained, monitored production model," or "decide between Vertex AI and GKE+Kubeflow for our ML platform."
/complete-mlops-platform-deployment-self-hosted-k8s-from-scratchSequences a complete, end-to-end, self-hosted and cloud-agnostic MLOps platform on any Kubernetes cluster — no managed ML service from any vendor — from a bare cluster to production: GPU node pools via the NVIDIA GPU Operator, a Kubeflow-vs-Ray orchestration choice, self-hosted MLflow-style tracking and registry on self-operated object storage and Postgres, on-cluster serving, and self-hosted drift monitoring. An integration/orchestration skill sequencing existing tool-specific skills in the right order, explicit about the added operational burden of self-hosting every layer versus a managed-cloud MLOps platform. Use when a user asks to "build a self-hosted MLOps platform on Kubernetes," "stand up MLflow and Kubeflow ourselves with no managed cloud ML service," "design a vendor-agnostic ML platform we can run on any cluster," or "give me the full sequence for a fully self-managed ML platform from bare cluster to production."
/data-and-model-lineageGuides tracking end-to-end lineage from raw data sources through feature computation, training runs, and model versions, to enable root-cause tracing, impact analysis, and compliance/audit answers. Use when the user asks to "trace where a feature/model came from", set up data/model lineage tracking, do impact analysis before changing an upstream table, answer an audit/compliance question about a model's training data, or debug a bad prediction back to its source.
/data-catalog-and-lineage-governance-datahub-amundsenGuides deploying and operating enterprise data catalog and governance tooling — DataHub or Amundsen — for discovering, tagging, classifying, and owning datasets, features, and models across an organization, including deprecation workflows that must check downstream consumers before deletion. Use when the user asks to "set up a data catalog", "make datasets/models searchable and discoverable", "tag PII/sensitive data", assign data ownership, install or configure DataHub or Amundsen, write an ingestion recipe, or safely deprecate/delete an old dataset or model artifact without breaking a consumer.
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin mlops-skillsOther plugins' skills for the same job