Agent skill · nvidia

nvflare-convert-lightning

Convert existing PyTorch Lightning training code into an NVFLARE federated job using the Lightning Client API patch, local validation, and job export; use only when the request names federated/NVFLARE conversion or asks multiple sites to train collaboratively while keeping each site's data local, and either names PyTorch Lightning or preliminary source inspection identifies one Lightning owner; do not use for non-federated Lightning work such as DDP, profiling, inference serving, or training-loop changes, nor for plain PyTorch, TensorFlow/Keras, other frameworks, deployment, POC/production lifecycle, or experiment workflows.

What it needs

About 6k tokens when loaded.

What this skill does

NVFLARE Convert PyTorch Lightning Use When Use only when the user asks to convert PyTorch Lightning code into an NVFLARE federated training job; require both federation intent and Lightning ownership. Treat requests for multiple sites or institutions to train collaboratively while each site's data remains local as federation intent, even when the request does not say "federated" or "NVFLARE." Lightning source evidence alone is not sufficient. Relevant source may contain a LightningModule, LightningDataModule, a Trainer fit/validate/test loop, Lightning callbacks, checkpointing, or loggers. Supported: the PyTorch recipe family with flare.patch(trainer) as the model exchange integration, Lightning-native evaluation, custom aggregation through the same recipe aggregator= hook, and local validation and export. Standard Path Always read this converter SKILL.md with ../nvflare-shared/references/conversion-common.md. For an explicit-FedAvg conversion, load only these references, in workflow order: 1. During inspection, references/lightning-detection.md. 2. For generated splits, relative paths, or per-site data locations, ../nvflare-shared/references/site-data-and-paths.md. 3. After nvflare recipe show fedavg-pt --format json, ../nvflare-shared/references/pytorch-family-recipe-construction.md. 4. During conversion, references/lightning-conversion.md, then ../nvflare-shared/references/pytorch-model-exchange.md. 5. Only after generated files exist, ../nvflare-shared/references/validation-evidence.md, then references/lightning-validation.md. Complete each workflow phase before loading the next phase's reference. Do not enumerate reference directories or preload validation, DDP/tracking, broad workflow, dependency, runtime-output, or reporting references. Do not depend on NVFLARE repository examples. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills nvidia/nvflare-convert-lightning

View the source on GitHub

Browse the @skills marketplace