pytorch-lightning
High-level PyTorch framework with Trainer class, automatic distributed training (DDP/FSDP/DeepSpeed), callbacks system, and minimal boilerplate.
Skill by Tommy-yw
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/tommy-yw-pytorch-lightning
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: ml
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
pytorch-lightning- Description
- High-level PyTorch framework with Trainer class, automatic distributed training (DDP/FSDP/DeepSpeed), callbacks system, and minimal boilerplate. Scales from laptop to supercomputer with same code. Use when you want clean training loops with built-in best practices.
- License
- MIT
- Instructions
- 338 lines in SKILL.md · view on GitHub
Files (4)
- SKILL.md
- callbacks.md · references/
- distributed.md · references/
- hyperparameter-tuning.md · references/
SKILL.md (first lines)
# PyTorch Lightning - High-Level Training Framework
## Quick start
PyTorch Lightning organizes PyTorch code to eliminate boilerplate while maintaining flexibility.
**Installation**:
```bash
pip install lightning
```
**Convert PyTorch to Lightning** (3 steps):
```python
import lightning as L
import torch
from torch import nn
from torch.utils.data import DataLoader, Dataset
# Step 1: Define LightningModule (organize your PyTorch code)
class LitModel(L.LightningModule):
def __init__(self, hidden_size=128):
super().__init__()
self.model = nn.Sequential(
nn.Linear(28 * 28, hidden_size),
nn.ReLU(),
nn.Linear(hidden_size, 10)
)
def training_step(self, batch, batch_idx):
x, y = batch
y_hat = self.model(x)
loss = nn.functional.cross_entropy(y_hat, y)
self.log('train_loss', loss) # Auto-logged to TensorBoard
return loss
def configure_optimizers(self):
return torch.optim.Adam(self.parameters(), lr=1e-3)
# Step 2: Create data
train_loader = DataLoader(train_dataset, batch_size=32)
# Step 3: Train with Trainer (handles everything else!)
trainer = L.Trainer(max_epochs=10, accelerator='gpu', devices=2)
model = LitModel()
trainer.fit(model, train_loader)
```
**That's it!** Trainer handles:
- GPU/TPU/CPU switching
- Distributed training (DDP, FSDP, DeepSpeed)
- Mixed precision (FP16, BF16)
- Gradient accumulation
- Checkpointing
- Logging
- Progress bars
## Common workflows
### Workflow 1: From PyTorch to Lightning
**Original PyTorch code**:
```python
model = MyModel()
optimizer = torch.optim.Adam(model.parameters())
model.to('cuda')
for epoch in range(max_epochs):
for batch in train_loader:
batch = batch.to('cuda')
optimizer.zero_grad()
loss = model(batch)
loss.backward()
optimizer.step()
```
**Lightning version**:
```python
class LitModel(L.LightningModule):
def __init__(self):
super().__init__()
self.model = MyModel()
def training_step(self, batch, batch_idx):
loss = self.model(batch) # No .to('cuda') needed!
return loss
def configure_optimizers(self):
return torch.optim.Adam(self.parameters())
# Train
trainer = L.Trainer(max_epochs=10, accelerator='gpu')
trainer.fit(LitModel(), train_loader)
```
**Benefits**: 40+ lines → 15 lines, no device management, automatic distributed
### Workflow 2: Validation and testing
```python
class LitModel(L.LightningModule):
def __init__(self):
super().__init__()
self.model = MyModel()
def training_step(self, batch, batch_idx):
x, y = batch
y_hat = self.model(x)
loss = nn.functional.cross_entropy(y_hat, y)
self.log('train_loss', loss)
return loss
def validation_step(self, batch, batch_idx):
x, y = batch
y_hat = self.model(x)
val_loss = nn.functional.cross_entropy(y_hat, y)
acc = (y_hat.argmax(dim=1) == y).float().mean()
self.log('val_loss', val_loss)
self.log('val_acc', acc)From Tommy-yw/RunbookHermes, MIT.
More from Tommy-yw/RunbookHermes
- 0.609score
fastmcp
Tommy-yw
Build, test, inspect, install, and deploy MCP servers with FastMCP in Python.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
ascii-video
Tommy-yw
Production pipeline for ASCII art video — any format.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
fitness-nutrition
Tommy-yw
Gym workout planner and nutrition tracker.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
neuroskill-bci
Tommy-yw
Connect to a running NeuroSkill instance and incorporate the user's real-time cognitive and emotional state (focus, relaxation, mood, cognitive load…
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
concept-diagrams
Tommy-yw
Generate flat, minimal light/dark-aware SVG diagrams as standalone HTML files, using a unified educational visual language with 9 semantic color ramps…
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
hermes-atropos-environments
Tommy-yw
Build, test, and debug Hermes Agent RL environments for Atropos training.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
baoyu-infographic
Tommy-yw
Generate professional infographics with 21 layout types and 21 visual styles.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
manim-video
Tommy-yw
Production pipeline for mathematical and technical animations using Manim Community Edition.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
drug-discovery
Tommy-yw
Pharmaceutical research assistant for drug discovery workflows.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
godmode
Tommy-yw
Jailbreak API-served LLMs using G0DM0D3 techniques — Parseltongue input obfuscation (33 techniques), GODMODE CLASSIC system prompt templates, ULTRAPLINIAN…
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
oss-forensics
Tommy-yw
Supply chain investigation, evidence recovery, and forensic analysis for GitHub repositories.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
baoyu-comic
Tommy-yw
Knowledge comic creator supporting multiple art styles and tones.
SkillCFreshness: C★ 510Claude Code +9
Signals
- Stars
- 510
- Forks
- 36
- Open issues
- 2
- Last commit (this folder)
- May 1, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/Tommy-yw/RunbookHermes
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.686score
pytorch-lightning
Orchestra-Research
High-level PyTorch framework with Trainer class, automatic distributed training (DDP/FSDP/DeepSpeed), callbacks system, and minimal boilerplate.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.331score
pytorch-lightning
Colin4k1024
High-level PyTorch framework with Trainer class, automatic distributed training (DDP/FSDP/DeepSpeed), callbacks system, and minimal boilerplate.
SkillCFreshness: C★ 14Claude Code +9
More from Tommy-yw
- 0.609score
godmode
Tommy-yw
Jailbreak API-served LLMs using G0DM0D3 techniques — Parseltongue input obfuscation (33 techniques), GODMODE CLASSIC system prompt templates, ULTRAPLINIAN…
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
manim-video
Tommy-yw
Production pipeline for mathematical and technical animations using Manim Community Edition.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
baoyu-infographic
Tommy-yw
Generate professional infographics with 21 layout types and 21 visual styles.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
drug-discovery
Tommy-yw
Pharmaceutical research assistant for drug discovery workflows.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
oss-forensics
Tommy-yw
Supply chain investigation, evidence recovery, and forensic analysis for GitHub repositories.
SkillCFreshness: C★ 510Claude Code +9 - 0.609score
concept-diagrams
Tommy-yw
Generate flat, minimal light/dark-aware SVG diagrams as standalone HTML files, using a unified educational visual language with 9 semantic color ramps…
SkillCFreshness: C★ 510Claude Code +9
Cite this page
pytorch-lightning skill. Agent Mart. https://agentmart.dev/skills/tommy-yw-pytorch-lightning (last updated 2026-10-24)