Synthèse automatique
Ce skill configure un environnement ML isolé avec PyTorch, en détectant automatiquement le matériel (GPU NVIDIA/AMD ou CPU) et en installant les builds adaptés.
Points forts
- Détection et configuration automatiques du matériel GPU ou CPU
- Support des GPU NVIDIA (y compris Blackwell), AMD RDNA et Strix Halo
- Installation reproductible via scripts bash et gestion de version de PyTorch
Limites
- Ne gère pas la configuration manuelle de mémoire GTT pour Strix Halo
- Version de PyTorch figée (2.10.0), peut nécessiter des mises à jour
- Dépend de la présence de drivers GPU correctement installés
Utilisez ce skill pour lancer rapidement un nouveau projet ML ou pour résoudre les problèmes d'environnement PyTorch liés au GPU.
Évitez ce skill si vous avez besoin d'une configuration personnalisée avancée (autres frameworks, dépendances spécifiques) ou si vous travaillez dans un environnement déjà configuré avec des outils de gestion de paquets comme Anaconda.
Analyse de sécurité
PrudenceThe skill uses Bash to execute setup scripts that require elevated privileges (sudo usermod) and download/install packages, which could modify the system. No destructive or exfiltration commands are present, but the scripts' sources aren't transparent to the auditor, making the risk moderate.
- •Running bash scripts from user's skills directory without user review, which could perform arbitrary system modifications (installing packages, modifying user groups).
Exemples
Set up a new ML project called 'my-ml-project' with PyTorch in ~/projects. Auto-detect my hardware and install the right version of PyTorch.I'm trying to use PyTorch but it doesn't see my GPU. Can you detect my hardware and install the correct PyTorch build for my NVIDIA RTX 4090?Set up a PyTorch environment for my AMD Strix Halo (gfx1151) system. Use ROCm 7 and remember to add me to render/video groups.name: ml-env description: Set up ML environments with PyTorch and auto-detect hardware. Use this when creating new ML projects, setting up PyTorch, or troubleshooting GPU/environment issues. Guides you through creating isolated project environments with hardware-specific PyTorch builds (NVIDIA/AMD/CPU). allowed-tools: Read, Bash, WebFetch activation-precedence: high
ML Environment Setup & Troubleshooting
This skill helps you create and manage isolated ML environments with PyTorch. It auto-detects your hardware (NVIDIA GPU, AMD GPU, or CPU) and installs the appropriate PyTorch build.
Creating a New ML Project
I can help you set up a complete ML project with PyTorch in seconds. Here's what I'll do:
- Create your project directory
- Create a
.gitignorefor ML files - Run hardware detection
- Install PyTorch with the right backend
- Install ML libraries
- Validate everything works
To get started, tell me:
- Project name/path where you want it created
- I'll handle the rest!
Interactive Setup Process
When you ask me to set up a new ML project, I will:
# 1. Create the project directory
mkdir -p ~/projects/my-ml-project
# 2. Create .gitignore
# (ignores ml-env/, data/, models/, logs/, etc.)
# 3. Run the setup script
bash ~/.claude/skills/ml-env/scripts/setup-universal.sh
# 4. Show you the results
The setup script will:
- Detect your GPU (NVIDIA with nvidia-smi, AMD with rocminfo, or fallback to CPU)
- Ask questions for special hardware (Blackwell GPUs, Strix Halo, etc.)
- Install Python 3.13 virtual environment with uv
- Install PyTorch 2.10.0 with correct backend
- Install ML libraries: numpy, pandas, scikit-learn, jupyter, accelerate, etc.
- Create
ml-env/directory in your project - Optionally initialize git
After Setup: Using Your Environment
Once created, activating is simple:
cd ~/projects/my-ml-project
source ml-env/bin/activate # Regular environments
# OR
source ml-env/activate-safe.sh # If you use conda (ignores conda settings)
Check it works:
python -c "import torch; print(f'PyTorch: {torch.__version__}'); print(f'CUDA: {torch.cuda.is_available()}')"
Hardware-Specific Guidance
NVIDIA GPUs
- Supported: RTX 3090, 4090, 5090, and most Ampere/Ada/Blackwell
- Installation: CUDA 12.8 (stable) or CUDA 13.0 (for RTX 5090)
- Driver requirement: 520+ for CUDA 12.8, 550+ for CUDA 13.0
- WSL2 users: Use Windows NVIDIA driver only (do NOT install Linux driver)
AMD RDNA (RX 6000/7000 series)
- Installation: ROCm 6.2
- Requirements: User in
renderandvideogroups - Setup:
sudo usermod -aG render,video $USER && newgrp render
AMD Strix Halo (gfx1151)
⚠️ This requires special handling - official PyTorch wheels do NOT work!
- GPU: Ryzen AI MAX+ 395 with gfx1151
- Critical issue: Official PyTorch wheels fail with "HIP error: invalid device function"
- Solution: Use AMD gfx1151-specific builds
- ROCm 7 (Recommended):
https://repo.amd.com/rocm/whl/gfx1151/- ~31 TFLOPS BF16 - ROCm 6.4.4+ (Fallback):
https://rocm.nightlies.amd.com/v2/gfx1151/- ~12 TFLOPS BF16 - Memory limits: Default ~33GB; configure GTT for larger models (30B+)
- Setup requires: User in
renderandvideogroups, Linux kernel 6.14+ (6.16.9+ recommended for automatic UMA/GTT behavior)
Reference project: See ~/Projects/amdtest for a working gfx1151 setup example.
See TROUBLESHOOTING.md for complete Strix Halo setup and GTT memory configuration.
CPU-Only Systems
- Works everywhere
- Good for development/testing
- Use for learning before scaling to GPU
Current Versions (2026)
- PyTorch: 2.10.0
- Python: 3.13 (or 3.12 if needed)
- CUDA: 12.8 (main), 13.0 (Blackwell experimental)
- ROCm: 6.2 (RDNA), 7.x preferred for Strix Halo (6.4.4+ as fallback)
- Key ML libs: numpy, pandas, matplotlib, scikit-learn, jupyter, accelerate, tensorboard
Validating an Existing Environment
If you already have a project and want to verify it works:
cd ~/your-ml-project
bash ~/.claude/skills/ml-env/scripts/validate.sh
This will check:
- Python and PyTorch versions
- GPU/CPU backend detection
- GPU memory and specifications
- Computation tests
Troubleshooting
GPU Not Detected
NVIDIA:
nvidia-smi # Check driver is installed
python -c "import torch; print(torch.cuda.is_available())"
AMD:
rocm-smi # Check ROCm installation
rocminfo | grep gfx # Check GPU architecture
CUDA Out of Memory
- Reduce batch size
- Enable mixed precision training
- Use
torch.cuda.empty_cache()between batches - Try gradient accumulation
PyTorch Not Finding GPU After Install
- Activate the environment:
source ml-env/bin/activate - Check driver version
- Reinstall PyTorch with correct index URL:
uv pip install --upgrade torch --index-url https://download.pytorch.org/whl/cu128
Strix Halo Specific Issues
See TROUBLESHOOTING.md for detailed Strix Halo troubleshooting, GTT memory setup, and performance optimization.
Best Practices
- Always activate first: Before running any Python/ML code
- Use virtual environments: Never install to system Python
- Move models to device: Explicitly move tensors to GPU
- Monitor memory: Keep an eye on GPU memory usage
- Test on CPU first: Develop with small data on CPU, scale to GPU
- Save checkpoints: Don't train for hours without saving progress
Common Workflows
Training a Model
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = YourModel().to(device)
for batch in dataloader:
x, y = batch
x, y = x.to(device), y.to(device)
loss = model(x, y)
loss.backward()
Mixed Precision Training (Faster, Less Memory)
from torch.cuda.amp import autocast, GradScaler
scaler = GradScaler()
for batch in dataloader:
with autocast():
loss = model(x, y)
scaler.scale(loss).backward()
scaler.step(optimizer)
scaler.update()
Checking GPU Memory
import torch
if torch.cuda.is_available():
print(f"Allocated: {torch.cuda.memory_allocated()/1e9:.2f}GB")
print(f"Reserved: {torch.cuda.memory_reserved()/1e9:.2f}GB")
print(f"Total: {torch.cuda.get_device_properties(0).total_memory/1e9:.2f}GB")
Reference Documentation
- TROUBLESHOOTING.md - Common issues, hardware-specific setup (especially Strix Halo)
- UPDATE.md - Updating PyTorch and dependencies
Scripts in This Skill
All scripts are in ~/.claude/skills/ml-env/scripts/:
- setup-universal.sh - Hardware detection and PyTorch installation (used during initial setup)
- validate.sh - Validate an existing environment and test GPU/CPU
When to Use This Skill
Use me when you:
- Want to create a new ML project
- Need to set up PyTorch with GPU support
- Are troubleshooting GPU/CUDA/ROCm issues
- Want to update or maintain your ML environment
- Have hardware-specific questions (NVIDIA, AMD, Strix Halo)
- Need guidance on ML best practices
Questions?
Ask me anything about:
- Creating new ML projects
- Hardware setup and troubleshooting
- PyTorch installation
- GPU/CPU configuration
- ML best practices
- Updating packages
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/ml-environment-setup-with-pytorch-mmh8qqfo/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/ml-environment-setup-with-pytorch-mmh8qqfo' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/ml-environment-setup-with-pytorch-mmh8qqfo/download' --output '.skill-downloads/ml-environment-setup-with-pytorch-mmh8qqfo/SKILL.md.part' && mv '.skill-downloads/ml-environment-setup-with-pytorch-mmh8qqfo/SKILL.md.part' '.skill-downloads/ml-environment-setup-with-pytorch-mmh8qqfo/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Outils déclarés par l’auteur (à vérifier dans votre agent) : Read, Bash, WebFetch
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/ml-environment-setup-with-pytorch-mmh8qqfo/SKILL.md' && test -s '.skill-downloads/ml-environment-setup-with-pytorch-mmh8qqfo/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/ml-env' && cp -R '.skill-downloads/ml-environment-setup-with-pytorch-mmh8qqfo' '.claude/skills/ml-env'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/ml-environment-setup-with-pytorch-mmh8qqfo'openskills read 'ml-environment-setup-with-pytorch-mmh8qqfo'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/ml-environment-setup-with-pytorch-mmh8qqfo/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Bonnes pratiques React Hook Form
Developpement
Maîtrisez React Hook Form : évitez les anti-patterns, gérez les abonnements, et traitez correctement reset, dirty state et entrées contrôlées.
Migration Emotion vers Mantine
Developpement
Migrer les styled-components Emotion vers des composants Mantine avec style props et modules CSS. Pour convertir .styled.tsx ou supprimer les imports @emotion.
Détecteur de dérive de périmètre
Developpement
Analyse les diffs git par rapport à une intention pour détecter la dérive de périmètre, fichiers non liés et PR trop larges, puis suggère de garder, diviser ou justifier.