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
- 参考文档references/quickstart-and-environment.md3.3 KB
- 参考文档references/repo-provenance.md1.7 KB
- 参考文档references/repo-routing-metadata.json439 B
- 参考文档references/template-file-map.md3.5 KB
- 参考文档references/troubleshooting.md4.6 KB
- 脚本scripts/check_lightning_hydra_project.py5.9 KB
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
- Confirm you are in a target project that resembles the template: it should have
configs/,src/,tests/,.project-root,requirements.txtorenvironment.yaml, and usuallysetup.py. - Install or verify the project environment. The public template path is usually:
Use the project's own environment policy if it has diverged from the template.pip install -r requirements.txt pip install -e . - 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 - For a current/staleness check on this generated skill, read repository provenance.
- 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:
srcwithsrc.train,src.eval,src.data.mnist_datamodule,src.models.mnist_module, andsrc.models.components.simple_dense_net. - Console entry points from
setup.py:train_command = src.train:mainandeval_command = src.eval:main. - Main config groups visible through Hydra help:
data,model,callbacks,logger,trainer,paths,extras,hydra,debug,experiment, andhparams_search. - Safe config/API inspection composes train/eval configs and instantiates datamodule, model, and trainer without calling
prepare_data(),fit(), ortest().
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=nullorlogger=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
srcpackage, update all_target_strings, imports,setup.pyentry 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
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.
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.
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.
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.
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.
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).