PyTorch ML Skill
Complete machine learning environment with PyTorch, CUDA, and the data science stack for deep learning research and production. Use it for building models, training loops, custom datasets, transfer learning, checkpointing, and mixed-precision GPU training.
When Not To Use
- Custom CUDA kernel development and GPU profiling — use the cuda skill instead
- Distributed neural network training in cloud sandboxes — use flow-nexus-neural instead
- AgentDB reinforcement learning plugins — use agentdb-advanced (RL Plugins section) instead
- Interactive data exploration in notebooks — use jupyter-notebooks instead
- AI image generation (Stable Diffusion, FLUX) — use comfyui instead
Quick start
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print(f"Using device: {device}, CUDA {torch.version.cuda}, {torch.cuda.device_count()} GPU(s)")
Always move both model and data to the same device, batch with a DataLoader, and
enable torch.backends.cudnn.benchmark = True for fixed-shape workloads.
References
Load the reference for the task at hand:
- references/cookbook.md — core code: environment check,
nn.Moduledefinition, training loop, customDataset/DataLoader, pretrained-model fine-tuning, and checkpoint save/load. - references/mixed-precision-and-cuda.md — AMP mixed-precision training with the current
torch.ampAPI, cache management, and GPU-properties introspection. - references/architectures.md — ready-made module definitions: image CNN and Transformer encoder.
- references/environment-and-best-practices.md — installed packages, best-practice checklist, CUDA/multi-GPU environment notes, capability list, and related skills.