time-series-library
Use Time-Series-Library (TSLib) to configure, run, debug, and adapt deep time-series forecasting, imputation, anomaly detection, classification, zero-shot, and model-customization workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- time-series-library
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use Time-Series-Library (TSLib) to configure, run, debug, and adapt deep time-series forecasting, imputation, anomaly detection, classification, zero-shot, and model-customization workflows.
- disable-model-invocation
- true
02 资源文件 9
- 参考文档references/cli-arguments.md3.9 KB
- 参考文档references/data-formats.md3.2 KB
- 参考文档references/installation-and-environment.md4.6 KB
- 参考文档references/model-catalog.md3.6 KB
- 参考文档references/repo-provenance.md1.4 KB
- 参考文档references/repo-routing-metadata.json513 B
- 参考文档references/troubleshooting.md4.0 KB
- 脚本scripts/check_tslib_environment.py4.8 KB
- 脚本scripts/create_tiny_tslib_dataset.py1.9 KB
03 SKILL.md 正文
Time-Series-Library (TSLib)
Use this skill when the task names Time-Series-Library, TSLib, run.py, TimesNet, TimeXer, iTransformer, PatchTST, DLinear, M4, ETT, UEA, PSM/MSL/SMAP/SMD/SWAT, long-term forecasting, short-term forecasting, time-series imputation, anomaly detection, classification, zero-shot forecasting, or adapting a model/script inside a TSLib-style checkout.
Start Here
- Confirm the environment and source layout before running training-scale work. From this skill directory, pass the user's TSLib checkout as
--repo-root:python scripts/check_tslib_environment.py --repo-root /path/to/Time-Series-Library --check-torch --check-core-imports - For command/data debugging, create a tiny local
customCSV in the user's checkout instead of downloading benchmark data:python scripts/create_tiny_tslib_dataset.py --output /path/to/Time-Series-Library/dataset/tiny-custom/tiny.csv - Use the route map below. TSLib has one unified CLI (
python run.py ...), but each task has different data layouts, output files, metrics, and failure modes. - Prefer
--no_use_gpu, tiny custom data,--train_epochs 1, and--num_workers 0for smoke checks. Treat upstream benchmark scripts as templates, not as safe default commands.
Route by Task
- Data layout, CLI flags, outputs, and preflight checks: use
sub-skills/data-and-cli/SKILL.mdforrun.pyarguments, dataset names, local-vs-Hugging Face fallback behavior, GPU flags, result/checkpoint folders, and safe data validation. - Forecasting workflows: use
sub-skills/forecasting/SKILL.mdfor long-term forecasting, short-term/M4 forecasting, exogenous/TimeXer recipes, zero-shot forecast routing, metrics, M4 summary behavior, and forecast command construction. - Imputation, anomaly detection, and classification: use
sub-skills/imputation-anomaly-classification/SKILL.mdfor masked reconstruction, reconstruction-threshold anomaly detection, UEA classification, task metrics, and dataset-specific troubleshooting. - Model catalog, optional dependencies, and customization: use
sub-skills/foundation-models-and-customization/SKILL.mdfor dynamic model discovery, Mamba and large time-series model dependencies, augmentation flags, custommodels/<Name>.pyfiles, and contribution-style script additions.
Core Mental Model
TSLib is a source-tree benchmark framework rather than a packaged library with console entry points. The normal flow is:
choose a task and bash/script template -> run python run.py with explicit flags ->
run.py dispatches to exp/Exp_* -> data_provider builds datasets/loaders ->
models/<Name>.py is lazy-imported -> train/test writes checkpoints, metrics, and result files
Important consequences:
--task_nameselects the experiment class, not just reporting labels.--dataselects a loader family;--root_pathand--data_pathmust match that family.--modelmust match a Python file undermodels/;Exp_Basicscans that directory dynamically.- Many upstream shell scripts export
CUDA_VISIBLE_DEVICESand run full benchmark settings. Remove or change those exports for your machine and use smoke settings first. - Several optional model families need extra packages or model downloads; do not assume a basic TSLib environment can import every file in
models/.
References
references/installation-and-environment.mdexplains public installation choices, optional dependencies, and safe smoke checks.references/cli-arguments.mdsummarizes the unifiedrun.pyargument families and task dispatch.references/data-formats.mddocuments CSV, M4, anomaly, and UEA layouts plus local-vs-Hub behavior.references/model-catalog.mdlists model families, dynamic discovery, and optional dependency surfaces.references/troubleshooting.mdcovers cross-cutting install/import, data, CLI, GPU, output, and source-tree issues.references/repo-provenance.mdrecords the source revision and evidence baseline.
Helpers
scripts/check_tslib_environment.pychecks Python imports, selected models,run.py --help, and optional torch CUDA status without training; pass--repo-rootfor the user's TSLib checkout.scripts/create_tiny_tslib_dataset.pycreates a small localcustomCSV with adatecolumn and target column for smoke commands.
Operating Rules
- Do not run benchmark-scale scripts or download large datasets/model weights unless the user explicitly wants that cost.
- Do not recommend a raw upstream
scripts/.../*.shcommand without checking itsCUDA_VISIBLE_DEVICES, dataset path, epochs, model dependencies, and output folders. - Use local tiny fixtures for CLI/data validation; use real benchmark data only for final experiment work.
- Treat Mamba/MambaSL and large time-series model files as optional dependency routes. First decide whether the user's task requires them; otherwise choose a core model such as DLinear, TimesNet, TimeXer, PatchTST, or Transformer for smoke checks.
- Keep generated commands generic and portable across TSLib checkouts; never rely on a particular local checkout path.
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).