api-v2-workflows
Guide experimental PyTorch Forecasting API-v2 D1/D2/M/P workflows, package wrappers, metadata flow, and beta troubleshooting.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- api-v2-workflows
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Guide experimental PyTorch Forecasting API-v2 D1/D2/M/P workflows, package wrappers, metadata flow, and beta troubleshooting.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-v2-layered-workflows.md13.3 KB
- 参考文档references/troubleshooting.md8.1 KB
- 参考文档references/v2-package-reference.md10.0 KB
- 脚本scripts/tiny_v2_data_smoke.py8.3 KB
03 SKILL.md 正文
API-v2 Workflows Sub-skill
Use this sub-skill only when a task explicitly asks for the experimental PyTorch Forecasting API-v2 stack in pytorch-forecasting 1.8.0: D1 TimeSeries, D2 EncoderDecoderTimeSeriesDataModule or TslibDataModule, direct M-layer Lightning models, or P-layer package wrappers with fit()/predict().
Stability warning: API-v2 is active-development/beta. Do not present it as the stable production interface; for production forecasting workflows route to the v1 sub-skills below.
Route here for
- Building API-v2
TimeSeriesdatasets from pandas DataFrames and checking the metadata that flows into v2 datamodules. - Choosing between
EncoderDecoderTimeSeriesDataModuleandTslibDataModule, creatingdatamodule_cfg, and validatingmetadatabefore model construction. - Using direct M-layer models such as
TFT,DLinear,Samformer,TIDE,TimeXer,DecoderMLP_v2, andSOFTSwith PyTorch Lightning. - Using P-layer wrappers such as
TFT_pkg_v2,DLinear_pkg_v2,Samformer_pkg_v2,TIDE_pkg_v2,TimeXer_pkg_v2,DecoderMLP_pkg_v2, andSOFTS_pkg_v2withmodel_cfg,trainer_cfg,datamodule_cfg,fit(),predict(),return_info, and checkpoint metadata. - Translating a v1-style request into v2 config dictionaries for beta experiments, while warning the user that v1 remains the stable path.
Route away
- Stable production v1 data construction,
TimeSeriesDataSet,from_dataset(), andto_dataloader()belong in../data-pipeline/SKILL.md. - Stable v1 model selection,
.from_dataset()model construction, Lightning training, checkpointing, interpretation, and prediction belong in../forecasting-models/SKILL.md. - Custom model, datamodule, metric, or package-wrapper implementation belongs in
../custom-components/SKILL.md.
Bundled references and scripts
- Use
references/api-v2-layered-workflows.mdwhen you need the D1/D2/M-layer concepts,TimeSeriesand datamodule recipes, metadata keys, direct Lightning model construction, and v1-to-v2 translation guidance. - Use
references/v2-package-reference.mdwhen you need the P-layer config-drivenfit()/predict()workflow, model/package names, compatibility table, checkpoint behavior, andreturn_infousage. - Use
references/troubleshooting.mdwhen beta API behavior fails due to missing metadata, incompatible datamodule/model pairing, config key mistakes, short series, fragilereturn_info, or package-layer lifecycle mistakes. - Use
scripts/tiny_v2_data_smoke.pyto create a synthetic DataFrame, instantiate API-v2TimeSeries, and optionally build/setup an API-v2 datamodule without training any model.
Minimal beta workflow choice
- If the user needs stable forecasting, route away to v1.
- If the user wants quick API-v2 experimentation, prefer a P-layer package wrapper and three config dictionaries.
- If the user needs custom Trainer/callbacks or direct batch inspection, use the D1 + D2 + M-layer recipe and pass
metadata=data_module.metadatainto the model. - Always validate D1/D2 metadata before model construction; most v2 failures come from missing metadata keys or pairing a model with the wrong datamodule family.
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).