[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJDE10JST6M73CB5AX14HQ":3,"skill-same:01M6KJDE10JST6M73CB5AX14HQ":65},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":48,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":50,"install":51,"resources":64},"01M6KJDE10JST6M73CB5AX14HQ","environment-setup-pytorch",null,"Set up Python environment for PyTorch-based NLP projects with transformers and alignment training. Use this skill when initializing project environments, managing dependencies from environment.yml files, installing required packages, and ensuring CUDA\u002Fdevice compatibility. Essential for reproducible machine learning research requiring specific package versions.","cxcscmu\u002FSkillLearnBench","cxcscmu","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142838272?v=4","01M6KCQDFQWPDSN0MKZY96MSQP","01M6KCQDM7G70TKJ28NTSQC0RZ",93,"MIT","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fb4-skill-creator-claude-haiku-4-5\u002Fnlp-paper-reproduction\u002Fenvironment-setup-pytorch\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"setup","environment setup pytorch","environment setup","environment","pytorch","packages","Reproducible","Transformers","SET","projects","training","up","alignment","files","compatibility","project","essential","environments","for","machine learning","2026-11-10 10:12:30",false,"---\nname: environment-setup-pytorch\ndescription: Set up Python environment for PyTorch-based NLP projects with transformers and alignment training. Use this skill when initializing project environments, managing dependencies from environment.yml files, installing required packages, and ensuring CUDA\u002Fdevice compatibility. Essential for reproducible machine learning research requiring specific package versions.\n---\n\n# Environment Setup for PyTorch Projects\n\n## Overview\n\nThis skill covers setting up a complete Python environment for PyTorch-based NLP and language model alignment training, including dependency management and device verification.\n\n## Environment Setup Workflow\n\n### Step 1: Identify Environment Configuration Files\n\nCheck for conda\u002Fpip configuration files:\n- `environment.yml` - Conda environment specification\n- `requirements.txt` - Pip requirements\n- `setup.py` - Package setup configuration\n- `pyproject.toml` - Modern Python project config\n\n### Step 2: Choose Installation Method\n\n#### Option A: Conda Environment\n```bash\n# Create environment from YAML\nconda env create -f environment.yml\n\n# Activate environment\nconda activate \u003Cenv_name>\n```\n\nBenefits:\n- Manages both Python and system dependencies\n- Consistent across platforms\n- Handles CUDA toolkit versions\n\n#### Option B: Pip with Virtual Environment\n```bash\n# Create virtual environment\npython -m venv venv\nsource venv\u002Fbin\u002Factivate  # Linux\u002FMac\n# or: venv\\Scripts\\activate  # Windows\n\n# Install requirements\npip install -r requirements.txt\n```\n\n#### Option C: Direct Pip Installation\n```bash\n# Install specific packages\npip install torch torchvision torchaudio\npip install transformers datasets accelerate peft\n```\n\n### Step 3: Verify Python Version and Packages\n\nGet detailed environment information:\n```bash\npython -VV                      # Detailed Python version\npython -m pip freeze           # All installed packages with versions\npython -m pip show torch       # Specific package info\npython -c \"import torch; print(torch.__version__)\"\n```\n\n### Step 4: Check CUDA\u002FDevice Availability\n\nVerify GPU access for training:\n```bash\npython -c \"import torch; print(f'CUDA available: {torch.cuda.is_available()}'); print(f'Device: {torch.cuda.get_device_name(0) if torch.cuda.is_available() else \\\"CPU\\\"}')\"\n```\n\n### Step 5: Install Project in Development Mode\n\nFor local project development:\n```bash\npip install -e .\n# or for projects with setup.py\npython setup.py develop\n```\n\n## Common Packages for Alignment Training\n\n### Core PyTorch Stack\n- `torch`: Deep learning framework\n- `torchvision`: Computer vision utilities\n- `torchaudio`: Audio processing\n- `pytorch-cuda`: CUDA runtime (if using conda)\n\n### NLP and Transformers\n- `transformers`: Hugging Face models and utilities\n- `tokenizers`: Fast tokenizer library\n- `datasets`: Dataset loading and processing\n- `accelerate`: Multi-GPU\u002Fdevice training utilities\n\n### Alignment and Training\n- `peft`: Parameter-Efficient Fine-Tuning (LoRA, etc.)\n- `trl`: Transformers Reinforcement Learning\n- `bitsandbytes`: 8-bit optimization utilities\n- `flash-attn`: Optimized attention (optional, for efficiency)\n\n### Development Tools\n- `numpy`: Numerical computing\n- `scipy`: Scientific computing\n- `scikit-learn`: Machine learning utilities\n- `wandb`: Weights & Biases experiment tracking (optional)\n\n## Dependency Conflict Resolution\n\n### Check for Conflicts\n```bash\npip check\n```\n\n### Resolve Common Issues\n\n#### PyTorch Version Mismatch\n```bash\n# Reinstall PyTorch with specific CUDA version\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\n# For CPU-only\npip install torch torchvision torchaudio\n```\n\n#### Package Incompatibilities\n```bash\n# Use environment solver\nconda install --solver=libmamba  # Faster solver\n# or\npip install --upgrade --upgrade-strategy eager \u003Cpackage>\n```\n\n#### Remove Conflicting Packages\n```bash\npip uninstall -y \u003Cpackage_name>\npip install \u003Cpackage_name>==\u003Cspecific_version>\n```\n\n### Conda Environment from File\nWhen using conda with environment.yml, sometimes recreating helps:\n```bash\n# Backup current environment\nconda env export > backup_env.yml\n\n# Remove and recreate\nconda env remove --name \u003Cenv_name>\nconda env create -f environment.yml\n```\n\n## Reproducibility Best Practices\n\n### 1. Lock Dependency Versions\n```bash\npip freeze > requirements-lock.txt\nconda env export > env-lock.yml\n```\n\n### 2. Document Environment Information\nAlways log:\n- Python version and build (`python -VV`)\n- Key package versions (torch, transformers, cuda)\n- Hardware details (GPU model, CPU)\n\n```bash\n# Create comprehensive environment log\n{\n    echo \"=== Python Version ===\"\n    python -VV\n    echo\n    echo \"=== Package Freeze ===\"\n    python -m pip freeze\n    echo\n    echo \"=== PyTorch Info ===\"\n    python -c \"import torch; print(f'PyTorch: {torch.__version__}'); print(f'CUDA Available: {torch.cuda.is_available()}')\"\n} > environment_info.txt\n```\n\n### 3. Test Critical Imports\n```python\nimport torch\nimport transformers\nfrom datasets import load_dataset\nfrom peft import get_peft_model\nprint(\"All critical imports successful!\")\n```\n\n## Environment Variables\n\n### CUDA Configuration\n```bash\nexport CUDA_VISIBLE_DEVICES=0,1,2,3  # Specify GPUs\nexport CUDA_LAUNCH_BLOCKING=1         # Synchronous GPU operations (for debugging)\n```\n\n### Training Configuration\n```bash\nexport HF_DATASETS_CACHE=\u002Fpath\u002Fto\u002Fcache  # Hugging Face cache\nexport TRANSFORMERS_CACHE=\u002Fpath\u002Fto\u002Fcache\nexport TOKENIZERS_PARALLELISM=false      # Avoid warnings\n```\n\n### Debugging\n```bash\nexport PYTHONUNBUFFERED=1  # Real-time output\nexport PYTHONBREAKPOINT=ipdb.set_trace  # Use ipdb for breakpoints\n```\n\n## Troubleshooting\n\n### Import Errors\n```bash\n# Reinstall with no cache\npip install --no-cache-dir --force-reinstall \u003Cpackage>\n\n# Check installation location\npython -c \"import \u003Cmodule>; print(\u003Cmodule>.__file__)\"\n```\n\n### CUDA\u002FDevice Errors\n```bash\n# Verify CUDA installation\npython -c \"import torch; torch.cuda.is_available()\"\n\n# Check CUDA version\nnvcc --version\n\n# Match PyTorch CUDA version to installed CUDA\n```\n\n### Memory Issues\n```bash\n# Install CPU-only version for testing\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcpu\n```\n\n## Project-Specific Setup\n\nFor SimPO and similar training projects:\n\n1. Check `environment.yml` for required versions\n2. Create conda environment if file exists\n3. Verify transformers and torch compatibility\n4. Confirm CUDA\u002Fdevice availability\n5. Install project in dev mode if setup.py exists\n6. Log all environment details for reproducibility\n","# Environment Setup for PyTorch Projects\n\n## Overview\n\nThis skill covers setting up a complete Python environment for PyTorch-based NLP and language model alignment training, including dependency management and device verification.\n\n## Environment Setup Workflow\n\n### Step 1: Identify Environment Configuration Files\n\nCheck for conda\u002Fpip configuration files:\n- `environment.yml` - Conda environment specification\n- `requirements.txt` - Pip requirements\n- `setup.py` - Package setup configuration\n- `pyproject.toml` - Modern Python project config\n\n### Step 2: Choose Installation Method\n\n#### Option A: Conda Environment\n```bash\n# Create environment from YAML\nconda env create -f environment.yml\n\n# Activate environment\nconda activate \u003Cenv_name>\n```\n\nBenefits:\n- Manages both Python and system dependencies\n- Consistent across platforms\n- Handles CUDA toolkit versions\n\n#### Option B: Pip with Virtual Environment\n```bash\n# Create virtual environment\npython -m venv venv\nsource venv\u002Fbin\u002Factivate  # Linux\u002FMac\n# or: venv\\Scripts\\activate  # Windows\n\n# Install requirements\npip install -r requirements.txt\n```\n\n#### Option C: Direct Pip Installation\n```bash\n# Install specific packages\npip install torch torchvision torchaudio\npip install transformers datasets accelerate peft\n```\n\n### Step 3: Verify Python Version and Packages\n\nGet detailed environment information:\n```bash\npython -VV                      # Detailed Python version\npython -m pip freeze           # All installed packages with versions\npython -m pip show torch       # Specific package info\npython -c \"import torch; print(torch.__version__)\"\n```\n\n### Step 4: Check CUDA\u002FDevice Availability\n\nVerify GPU access for training:\n```bash\npython -c \"import torch; print(f'CUDA available: {torch.cuda.is_available()}'); print(f'Device: {torch.cuda.get_device_name(0) if torch.cuda.is_available() else \\\"CPU\\\"}')\"\n```\n\n### Step 5: Install Project in Development Mode\n\nFor local project development:\n```bash\npip install -e .\n# or for projects with setup.py\npython setup.py develop\n```\n\n## Common Packages for Alignment Training\n\n### Core PyTorch Stack\n- `torch`: Deep learning framework\n- `torchvision`: Computer vision utilities\n- `torchaudio`: Audio processing\n- `pytorch-cuda`: CUDA runtime (if using conda)\n\n### NLP and Transformers\n- `transformers`: Hugging Face models and utilities\n- `tokenizers`: Fast tokenizer library\n- `datasets`: Dataset loading and processing\n- `accelerate`: Multi-GPU\u002Fdevice training utilities\n\n### Alignment and Training\n- `peft`: Parameter-Efficient Fine-Tuning (LoRA, etc.)\n- `trl`: Transformers Reinforcement Learning\n- `bitsandbytes`: 8-bit optimization utilities\n- `flash-attn`: Optimized attention (optional, for efficiency)\n\n### Development Tools\n- `numpy`: Numerical computing\n- `scipy`: Scientific computing\n- `scikit-learn`: Machine learning utilities\n- `wandb`: Weights & Biases experiment tracking (optional)\n\n## Dependency Conflict Resolution\n\n### Check for Conflicts\n```bash\npip check\n```\n\n### Resolve Common Issues\n\n#### PyTorch Version Mismatch\n```bash\n# Reinstall PyTorch with specific CUDA version\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\n# For CPU-only\npip install torch torchvision torchaudio\n```\n\n#### Package Incompatibilities\n```bash\n# Use environment solver\nconda install --solver=libmamba  # Faster solver\n# or\npip install --upgrade --upgrade-strategy eager \u003Cpackage>\n```\n\n#### Remove Conflicting Packages\n```bash\npip uninstall -y \u003Cpackage_name>\npip install \u003Cpackage_name>==\u003Cspecific_version>\n```\n\n### Conda Environment from File\nWhen using conda with environment.yml, sometimes recreating helps:\n```bash\n# Backup current environment\nconda env export > backup_env.yml\n\n# Remove and recreate\nconda env remove --name \u003Cenv_name>\nconda env create -f environment.yml\n```\n\n## Reproducibility Best Practices\n\n### 1. Lock Dependency Versions\n```bash\npip freeze > requirements-lock.txt\nconda env export > env-lock.yml\n```\n\n### 2. Document Environment Information\nAlways log:\n- Python version and build (`python -VV`)\n- Key package versions (torch, transformers, cuda)\n- Hardware details (GPU model, CPU)\n\n```bash\n# Create comprehensive environment log\n{\n    echo \"=== Python Version ===\"\n    python -VV\n    echo\n    echo \"=== Package Freeze ===\"\n    python -m pip freeze\n    echo\n    echo \"=== PyTorch Info ===\"\n    python -c \"import torch; print(f'PyTorch: {torch.__version__}'); print(f'CUDA Available: {torch.cuda.is_available()}')\"\n} > environment_info.txt\n```\n\n### 3. Test Critical Imports\n```python\nimport torch\nimport transformers\nfrom datasets import load_dataset\nfrom peft import get_peft_model\nprint(\"All critical imports successful!\")\n```\n\n## Environment Variables\n\n### CUDA Configuration\n```bash\nexport CUDA_VISIBLE_DEVICES=0,1,2,3  # Specify GPUs\nexport CUDA_LAUNCH_BLOCKING=1         # Synchronous GPU operations (for debugging)\n```\n\n### Training Configuration\n```bash\nexport HF_DATASETS_CACHE=\u002Fpath\u002Fto\u002Fcache  # Hugging Face cache\nexport TRANSFORMERS_CACHE=\u002Fpath\u002Fto\u002Fcache\nexport TOKENIZERS_PARALLELISM=false      # Avoid warnings\n```\n\n### Debugging\n```bash\nexport PYTHONUNBUFFERED=1  # Real-time output\nexport PYTHONBREAKPOINT=ipdb.set_trace  # Use ipdb for breakpoints\n```\n\n## Troubleshooting\n\n### Import Errors\n```bash\n# Reinstall with no cache\npip install --no-cache-dir --force-reinstall \u003Cpackage>\n\n# Check installation location\npython -c \"import \u003Cmodule>; print(\u003Cmodule>.__file__)\"\n```\n\n### CUDA\u002FDevice Errors\n```bash\n# Verify CUDA installation\npython -c \"import torch; torch.cuda.is_available()\"\n\n# Check CUDA version\nnvcc --version\n\n# Match PyTorch CUDA version to installed CUDA\n```\n\n### Memory Issues\n```bash\n# Install CPU-only version for testing\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcpu\n```\n\n## Project-Specific Setup\n\nFor SimPO and similar training projects:\n\n1. Check `environment.yml` for required versions\n2. Create conda environment if file exists\n3. Verify transformers and torch compatibility\n4. Confirm CUDA\u002Fdevice availability\n5. Install project in dev mode if setup.py exists\n6. Log all environment details for reproducibility\n",{"name":5,"description":7},"main","726e1f79b96b0cb3d729d0e55a1c847e0b5353ae","skills\u002Fb4-skill-creator-claude-haiku-4-5\u002Fnlp-paper-reproduction\u002Fenvironment-setup-pytorch",8,"https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench","https:\u002F\u002Fcxcscmu.github.io\u002FSkillLearnBench","https:\u002F\u002Fgithub.com\u002Fcxcscmu","2026-10-02 22:55:36",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add cxcscmu\u002FSkillLearnBench --skill environment-setup-pytorch",{"tool":57,"command":58},"bunx","bunx skills add cxcscmu\u002FSkillLearnBench --skill environment-setup-pytorch",{"tool":60,"command":61},"pnpm","pnpm dlx skills add cxcscmu\u002FSkillLearnBench --skill environment-setup-pytorch","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fb4-skill-creator-claude-haiku-4-5\u002Fnlp-paper-reproduction\u002Fenvironment-setup-pytorch\u002FSKILL.md",true,[],[66,79,99,116,136,146],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":38},"01M6KM5KH175P5ABP5JMX2SBDQ","object_counter","Count occurrences of an object in the image using computer vision algorithm.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Fvideo-object-counting\u002Fobject_counter\u002FSKILL.md",[],[73,74,75,76,77,78],"object counter","object","vision","computer","Computer Vision","image",{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":38},"01M6KM51TMVXG79MMPCS6Y8G86","travel-planning-workflow","Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftravel-planning\u002Ftravel-planning-workflow\u002FSKILL.md",[],[86,87,88,89,90,91,92,93,94,36,95,96,97,34,98],"workflow","planning","planning workflow","travel","travel planning","travel planning workflow","structured","performing","plan","user","it","requirements","itineraries",{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":38},"01M6KM4DY820XHS9YTSK5QP5HD","bundled-dataset-search-tool","invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftravel-planning\u002Fbundled-dataset-search-tool\u002FSKILL.md",[],[106,107,108,109,110,111,29,89,112,113,90,114,36,115,87],"search","tool","dataset","bundled dataset search tool","restaurants","Tools","look","flights","you","database",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":38},"01M6KM465BB9PQ0B548HQSVAWZ","glm-output","Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final \u002Froot\u002Fmetrics.json.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-output\u002FSKILL.md",[],[123,124,125,36,126,127,128,129,130,131,132,133,114,134,135],"glm output","output","glm","tasks","metrics","json","basics","guidance","matching","verifier","processing","root","calibration",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":38},"01M6KM40KY3QWDW5W97S39R2BC","glm-calibration","Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-calibration\u002FSKILL.md",[],[143,135,125,124,130,129,126,18,144,36,145],"glm calibration","companion","metric",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":38},"01M6KM3VHHVSGMGHJQB3PPT6YG","glm-basics","A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-basics\u002FSKILL.md",[],[153,125,129,154,143,135,36,124,155,31,156,157,158,159,126],"glm basics","inspect","relevant","good","use","how","Evaluation"]