distributed-training-pytorch-lightning — Claude Code skill
Refactors standard PyTorch loops into LightningModule structures and manages multi-GPU execution using DDP, FSDP, or DeepSpeed.
npx claude-code-templates@latest --skill ai-research/distributed-training-pytorch-lightningWhat distributed-training-pytorch-lightning does
This skill guides the assistant in converting repetitive training loops into modular LightningModule architectures. It organizes model logic, validation steps, and optimizers into dedicated methods, removing explicit .to('cuda') device calls.
Orchestration relies on the Trainer class. It manages multi-GPU and TPU execution using DDP, FSDP, or DeepSpeed strategies alongside FP16 or BF16 precision. Common operational setups include ModelCheckpoint, EarlyStopping, and schedulers like CosineAnnealingLR.
Running the resulting training scripts requires lightning, torch, and transformers in your Python environment.
What it helps with
- convert manual PyTorch training loops into LightningModule classes
- configure multi-GPU distributed execution with DDP, FSDP, or DeepSpeed
- integrate callbacks for early stopping and metric-based model checkpointing
- set up learning rate schedulers like CosineAnnealingLR with automatic logging
Example prompts for the agent
- Refactor this PyTorch training loop into a LightningModule with validation steps
- Configure a Trainer instance to run on 8 GPUs using DDP and 16-bit precision
- Add ModelCheckpoint and EarlyStopping callbacks monitoring val_loss to my training script
How to install distributed-training-pytorch-lightning
1claude-code-templates
npx claude-code-templates@latest --skill ai-research/distributed-training-pytorch-lightning2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill distributed-training-pytorch-lightning -a claude-code3Manually: put the files in place
~/.claude/skills/distributed-training-pytorch-lightning/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/distributed-training-pytorch-lightning/
Manually: put the files in place
.agents/skills/distributed-training-pytorch-lightning/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/distributed-training-pytorch-lightning/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates distributed-training-pytorch-lightning2Manually: put the files in place
.github/skills/distributed-training-pytorch-lightning/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/ai-research/distributed-training-pytorch-lightningManually: put the files in place
.devin/skills/distributed-training-pytorch-lightning/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about distributed-training-pytorch-lightning
How to install distributed-training-pytorch-lightning in Claude Code?
Run npx claude-code-templates@latest --skill ai-research/distributed-training-pytorch-lightning in your terminal.
What does distributed-training-pytorch-lightning do?
It provides patterns for organizing PyTorch models into Lightning modules and configuring the Trainer for distributed hardware.
What dependencies are required?
You need lightning, torch, and transformers installed in your active Python environment.