K-Dense-AI/scientific-agent-skills / skills/timesfm-forecasting
timesfm-forecasting
VerifiedPerforms zero-shot time-series forecasting with Google's TimesFM, including regular-grid CSV preparation, quantile forecasts, XReg covariates, and held-out evaluation. Uses the Apache-licensed TimesFM 2.5 checkpoint by default and documents the distinct TimesFM 3.0 multivariate API and weight-license requirements.
references/performance_tuning.md
View on GitHub# Tune the actual workload
Start with `per_core_batch_size=1`, a context such as 512 and a horizon rounded
to 128. Record wall time and peak resident/device memory for representative
lengths before increasing batch size. No table can guarantee a batch size from
VRAM alone: contexts, horizon, copies, backend, compiler and concurrent work matter.
The 2.5 `torch_compile` loader option defaults True. Use False for first-load
smokes; separately benchmark whether compilation pays off for repeated calls.
`model.compile(ForecastConfig(...))` is still needed with either setting.
The continuous quantile head supports <=1,024 horizon. Symmetric flip averaging
adds a second decode pass. Reduce context only after evaluating its accuracy cost.
For CUDA float32 matmul, `torch.set_float32_matmul_precision("high")` can trade
internal precision for speed on supported hardware; it is not a universal
accuracy-preserving setting and does not make CPU/MPS use CUDA. Use
`torch.cuda.get_device_properties(0).total_memory`, not `.total_mem`.
Process many series in outer chunks if input/output arrays are large; persist
outputs as you go instead of retaining every array. Passing a copied list avoids
2.5's in-place padding-list growth. `gc.collect()` or `torch.cuda.empty_cache()`
does not free live model tensors or fix an oversized workload. After OOM,
reduce the actual context/batch/horizon allocation and rerun the representative
smoke, then reassess forecast quality.
Backend details: [TimesFM torch source](https://github.com/google-research/timesfm/blob/e51928e27119cb17bebc005be2696b75e0a9e688/src/timesfm/timesfm_2p5/timesfm_2p5_torch.py),
[PyTorch precision API](https://docs.pytorch.org/docs/stable/generated/torch.set_float32_matmul_precision.html).
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |