torch-and-foundation-models
Use Darts PyTorch forecasting models and foundation wrappers with explicit backend, checkpoint, and cache/download boundaries.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- torch-and-foundation-models
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use Darts PyTorch forecasting models and foundation wrappers with explicit backend, checkpoint, and cache/download boundaries.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/backend-and-training.md2.4 KB
- 参考文档references/model-overview.md2.2 KB
- 参考文档references/troubleshooting.md2.0 KB
- 参考文档references/workflows.md2.3 KB
- 脚本scripts/torch_model_smoke.py2.2 KB
03 SKILL.md 正文
Torch and foundation models
Use this sub-skill when the user needs Darts neural forecasting models, darts[torch], PyTorch Lightning trainer kwargs, CPU/GPU verification, checkpoints, or foundation model wrapper planning.
Read first
references/backend-and-training.mdfor install checks, CPU/GPU/TPU boundaries, trainer kwargs, chunk lengths, and checkpoint discipline.references/model-overview.mdfor torch/foundation model family routing and optional dependencies.references/workflows.mdfor tiny CPUTCNModelpatterns and staged backend escalation.references/troubleshooting.mdfor torch import, CUDA, covariates/chunks, checkpoints, and foundation cache/no-network failures.scripts/torch_model_smoke.pyfor safe import/model-construction and optional one-epoch CPU training smoke.
Route by task
- Install or validate neural Darts: check
darts[torch],torch, andpytorch_lightning; runtorch_model_smoke.pybefore real training. - Tiny CPU prototype: use small
input_chunk_length,output_chunk_length,n_epochs, and CPUpl_trainer_kwargs. - GPU/TPU request: verify the exact backend in the target environment. CPU torch import is not GPU proof.
- Covariates for neural models: validate spans in
../data-processing-and-covariates/, then map them to model-specific chunk/covariate support here. - Foundation wrappers: require explicit local cache/model path or approved network downloads before constructing wrappers that may fetch weights.
- Metrics or explainability: route forecast evaluation to
../evaluation-and-explainability/.
Safe check
python scripts/torch_model_smoke.py # imports and constructs a tiny CPU TCNModel
python scripts/torch_model_smoke.py --train # optional one-epoch generated-data CPU training smoke
Use an explicit temporary or user-approved work directory for checkpoints/logs. Do not write training artifacts into the skill directory.
Boundaries
This sub-skill documents optional CUDA/foundation behavior but the baseline verification only proved CPU torch. Do not claim accelerator or foundation model execution until separately verified with the required hardware, wheel, cache, and memory in the user's environment.
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).