Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseOpenClawOpenClaw+21 more

    Accelerate Distributed Train

    10

    Add multi-GPU and multi-node training to any PyTorch script with Hugging Face Accelerate in a few lines. Use when a training run must scale from one GPU to seve

    Free

    2 installsSecurity scanned
    Accelerate Distributed Train

    Accelerate Distributed Train

    Example session with this skill installed

    Convert my single-GPU train.py script to support multi-GPU training using Accelerate. I need to use BF16 precision and FSDP for a large model.

    • Read your context and instructions
    • Compiled the accelerate distributed train

    I will instrument your train.py.

    1. Import and init Accelerator.
    2. Wrap your model, optimizer, and loader with accelerator.prepare().
    3. Replace loss.backward() with accelerator.backward(loss).
    4. Guard your print statements with if accelerator.is_main_process.
      Run via: accelerate launch --mixed_precision bf16 train.py

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem

    Rewriting PyTorch training loops for multi-GPU support is error-prone and tedious. Manually managing device placement, gradient synchronization, and mixed precision often leads to boilerplate-heavy code that is difficult to scale or port between different hardware setups.

    What it does

    • Instruments standard PyTorch scripts with the Hugging Face Accelerate wrapper to enable distributed execution.
    • Configures hardware backends including DDP, FSDP, and DeepSpeed via external config or flags rather than code changes.
    • Automates device placement and gradient accumulation to handle larger batch sizes and models.
    • Implements main-process guards and state saving/loading to ensure consistent logging and checkpointing across ranks.

    Frameworks & tools

    PyTorch, Hugging Face Accelerate, DeepSpeed, FSDP, and CUDA.

    Why this beats prompting it yourself

    Generic prompts often fail to handle the specific "contract" of distributed training, such as ensuring logging only happens on rank 0 or correctly replacing loss.backward(). This skill provides the exact touchpoints needed to port a script without breaking the training logic or causing deadlocks.

    Use cases

    • Scale a local PyTorch training script to a 4-GPU workstation or cloud cluster.
    • Enable BF16 or FP16 mixed precision to reduce VRAM usage and speed up training.
    • Transition large models to FSDP sharding when they no longer fit on a single GPU.
    • Standardize checkpointing and logging across multi-node environments.

    Known limitations

    Designed strictly for PyTorch scripts. Does not support other ML frameworks or inference-only optimization workflows.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    2 installs

    Downloaded by developers to date

    Free forever

    No account required to browse

    Trust & safety

    Security scanned

    Verified clean 1 month ago

    • Free to download with an account

    Listed1 month ago
    Updated12 days ago

    What's inside

    Frequently Asked Questions