AGENT SKILL

lightning-hydra-template

Operate Lightning-Hydra-Template projects: Hydra configs, Lightning training/evaluation, data/model customization, tests, CI, and template maintenance.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
lightning-hydra-template
license
MIT
metadata
{ "disco-role": "operating" }
description
Operate Lightning-Hydra-Template projects: Hydra configs, Lightning training/evaluation, data/model customization, tests, CI, and template maintenance.
disable-model-invocation
true

02 资源文件 6

03 SKILL.md 正文

Lightning-Hydra-Template Repo Skill

Use this skill when a task involves a project based on Lightning-Hydra-Template: a PyTorch Lightning + Hydra template with configs/, src/train.py, src/eval.py, Lightning DataModule/LightningModule examples, pytest smoke tests, and MLOps-style logging/callback/sweep configuration.

This skill is self-contained operating guidance. Treat paths such as configs/train.yaml and src/train.py as files in the user's target checkout or derived project, not as links to the construction repository.

First checks

  1. Confirm you are in a target project that resembles the template: it should have configs/, src/, tests/, .project-root, requirements.txt or environment.yaml, and usually setup.py.
  2. Install or verify the project environment. The public template path is usually:
    pip install -r requirements.txt
    pip install -e .
    
    Use the project's own environment policy if it has diverged from the template.
  3. Run a no-training inspection before expensive work:
    python <this-skill>/scripts/check_lightning_hydra_project.py --repo-root . --config-name train.yaml --instantiate
    python <this-skill>/scripts/check_lightning_hydra_project.py --repo-root . --config-name eval.yaml --override ckpt_path=/tmp/dummy.ckpt --instantiate
    
  4. For a current/staleness check on this generated skill, read repository provenance.
  5. For environment setup, dependency groups, and public import checks, read quickstart and environment. For the template file layout, read template file map. For cross-cutting failures, read troubleshooting.

Route by task

User task Read next Why
Edit Hydra defaults, choose config groups, convert CLI overrides to experiment YAML, debug MissingConfigException, set log paths, or run multiruns/Optuna sweeps. configure-experiments Owns Hydra composition, overrides, debug configs, sweeps, tags, and path interpolation.
Train, resume, evaluate checkpoints, choose callbacks/loggers/accelerators, inspect CLI help, or build safe repeated-run commands. train-evaluate Owns src.train, src.eval, train_command, eval_command, checkpoint/logging semantics, and accelerator choices.
Add a new dataset, replace MNIST, add a LightningModule or network component, rename the src package, or fix _target_ imports. customize-data-model Owns DataModule/LightningModule/component APIs, optimizer/scheduler partials, target strings, and data/model config wiring.
Pick no-network tests, adapt pytest fixtures, update CI/pre-commit, diagnose RunIf skips, or maintain package metadata after template changes. test-maintain-template Owns pytest/CI/Makefile workflow, package rename checklist, and maintenance gates.

Public runtime surfaces verified for this skill

  • Distribution metadata: default template distribution src==0.0.1.
  • Import package: src with src.train, src.eval, src.data.mnist_datamodule, src.models.mnist_module, and src.models.components.simple_dense_net.
  • Console entry points from setup.py: train_command = src.train:main and eval_command = src.eval:main.
  • Main config groups visible through Hydra help: data, model, callbacks, logger, trainer, paths, extras, hydra, debug, experiment, and hparams_search.
  • Safe config/API inspection composes train/eval configs and instantiates datamodule, model, and trainer without calling prepare_data(), fit(), or test().

Safe operating rules

  • Do not treat default training commands as no-network: the MNIST example can download data.
  • Prefer config composition, CLI --help, and target-import checks before running training.
  • Disable online loggers in smoke tests unless credentials and optional packages are explicitly available: use logger=null or logger=csv.
  • Keep accelerator claims scoped. CPU config/API checks are portable; CUDA, MPS, TPU, DDP, and online loggers require hardware, packages, services, or credentials.
  • If the user has renamed the default src package, update all _target_ strings, imports, setup.py entry points, and CI coverage paths together.

Bundled scripts

  • scripts/check_lightning_hydra_project.py: shared target-checkout inspector; composes configs, checks imports/entry points, optionally instantiates objects and probes CUDA.
  • Sub-skill scripts provide narrower helpers for config rendering, scheduled command previews, _target_ scanning, and smoke-test selection.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351