custom-components
Implement custom PyTorch Forecasting metrics, models, package wrappers, data modules, and focused maintainer tests.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- custom-components
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Implement custom PyTorch Forecasting metrics, models, package wrappers, data modules, and focused maintainer tests.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/custom-components.md10.3 KB
- 参考文档references/maintainer-testing.md6.3 KB
- 参考文档references/troubleshooting.md9.9 KB
- 脚本scripts/custom_metric_template.py3.2 KB
03 SKILL.md 正文
Custom Components
Use this sub-skill when you are adding or reviewing PyTorch Forecasting custom components for version 1.8.0: metrics/losses, v1 BaseModel implementations, v1 _pkg package containers, experimental v2 model/package/data-module components, and focused maintainer tests.
Do not use this sub-skill for ordinary package usage, release/changelog work, broad CI administration, documentation-site builds, or hyperparameter-tuning workflows.
Route by task
- For a custom metric or loss, start from the bundled template, then read the metric section in references/custom-components.md; it explains the
MultiHorizonMetriccontract, optional distribution-loss hooks, and package-wrapper tags when a metric must be discoverable. - For a v1 custom model, read references/custom-components.md; it gives the
BaseModel/BaseModelWithCovariates/_pkgpattern,TimeSeriesDataSet.from_datasetrules, tensor-dict shape expectations, and registry tags. - For experimental v2 work, read references/custom-components.md; it summarizes the v2
BaseModel,Base_pkg,TimeSeries, andEncoderDecoderTimeSeriesDataModuleconcepts without relying on source templates. - Before running checks, use references/maintainer-testing.md; it lists focused pytest selections, CPU smoke tests, ruff/mypy/pre-commit basics, and when to avoid broad optional extras.
- When a component fails import,
.from_dataset, tensor-shape, package-linkage, optional-dependency, or estimator tests, use references/troubleshooting.md; it maps common failure signals to fixes. - Copy scripts/custom_metric_template.py when implementing a new point-style
MultiHorizonMetric; it is a syntactically valid, minimal class with a CPU self-check.
Operating stance
Prefer small CPU fixtures and package-relative commands. Keep optional dependencies behind lazy imports and explicit python_dependencies tags. Treat v2 APIs as beta/unstable; prefer stable v1 TimeSeriesDataSet + BaseModel.from_dataset() unless the task explicitly targets v2 package/data-module layers.
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).