Repository navigation
Releases: markhammond/tsfm-forecasting
Release list
v0.1.3 - Covariates / Joint forecasting
TimesFmForecaster.ForecastJoint takes several series at once, any of which may carry
values known into the future.
- Series are attended jointly and normalised per variate, so a price in the thousands
mixes with a flag in {0,1} without scaling. The ceiling is read from the checkpoint
rather than hardcoded —MaxVariatesreports what the loaded one states, 32 for 3.0. - There is no variate identity or ordering. The model sees anonymous series and infers
their relationship from co-movement in the supplied window. - A known-future variate cannot be the forecast target; marking it is refused, since that
would hand a series its own future. - The known future is gathered by rolling whole patches forward, so the context must be a
positive multiple of the patch length and leave at least one patch after it. Both are
validated rather than producing a silently wrong anchor. samples/GroceryCovariatesreproduces the scenario from Google's covariates notebook:
ice cream and sunscreen, temperature and promotion known for both weeks. The numbers are
not comparable: the notebook uses the XReg path, which regresses covariates on forecast
residuals, whereas 3.0 attends over them as variates.
Only Tsfm.Forecasting.TimesFm changed. Other packages republished to keep project reference management simple.
TimesFM checkpoints are non-commercially licensed and are not distributed with any
package; see NOTICE.
Packages
| Package | |
|---|---|
| Tsfm.Forecasting | safetensors, checkpoint abstraction (MIT) |
| Tsfm.Forecasting.Kronos | tokenizer, model, forecaster (MIT) |
| Tsfm.Forecasting.Kronos.Weights.Small | Kronos-small (24.7M) + Tokenizer-base |
| Tsfm.Forecasting.Kronos.Weights.Mini | Kronos-mini (4.1M) + Tokenizer-2k |
| Tsfm.Forecasting.TimesFm | TimesFM 3.0 inference, no weights (Apache-2.0) |
Full Changelog: v0.1.2...v0.1.3
v0.1.2 - Named limits
No change to inference. Both ports remain parity-verified.
- KronosForecaster.Channels replaces the bare 6 at every call site, and carries the row-major layout, the channel order and the amount derivation in its own documentation.
- ICheckpoint.MaxContext states the longest context a checkpoint can attend over — 2048 for Kronos-mini, 512 for Kronos-small and -base. A property of the checkpoint, not of the architecture.
- Infer refuses a context beyond that limit. Upstream truncates silently, which reads as a working call that quietly ignored the bars past the ceiling.
- samples/CandleForecast takes its context from the checkpoint rather than a hard-coded number, and selects its device through DeviceType.
Full Changelog: v0.1.1...v0.1.2
Debut
Debut release of native .NET inference for Kronos, a pre-trained autoregressive model over K-line (OHLCVA) sequences. Runs on CPU and supported GPUs via TorchSharp.
Packages
| Package | |
|---|---|
| Kronos.Forecasting | tokenizer, model, forecaster |
| Kronos.Forecasting.Weights.Small | Kronos-small (24.7M) + Tokenizer-base |
| Kronos.Forecasting.Weights.Mini | Kronos-mini (4.1M) + Tokenizer-2k |
dotnet add package Kronos.Forecasting
dotnet add package Kronos.Forecasting.Weights.Small # or .Mini
dotnet add package TorchSharp-cpu # or a CUDA backend
Checkpoints are embedded as assembly resources. The native backend is not included; choose the TorchSharp package matching your intended target.
Included
- Kronos tokenizer (encode and decode) and autoregressive model, ported to TorchSharp
Safetensorsreader, so checkpoints load without Python at build or run timeIKronosCheckpoint: weights as streams, from embedded resources or a directory- Verified stage by stage against the reference implementation on CPU and Metal
Deliberate divergences
- Sampling is batch-invariant. Per-bar uniforms from a SplitMix64 stream seeded by the bar's own timestamp, selected by inverse CDF, so a draw does not depend on how bars were grouped into batches. The reference seeds one stream per batch and is not batch-invariant. Distributionally identical; the stream is not.
- No key-value cache. Attention is recomputed over the whole context at every decode step, matching the reference. A cache would change the arithmetic and forfeit checkable parity.
- Not bit-identical across devices (~1e-7 on the projected return). A determinism contract should pin one device rather than assume CPU and GPU agree.
Attribution
Model architecture, BSQ tokenizer and reference implementation by ShiYu (MIT). Checkpoints redistributed unmodified from NeoQuasar (MIT) at the revisions recorded in LICENSE.
Preview
feat: a faithful port of the Kronos predictor to .NET Runs the Kronos tokenizer and autoregressive decoder natively on CPU (or Apple GPU). No existing .NET runtime can load this architecture: the BSQ autoencoder, hierarchical subtoken embedding, dependency-aware cross attention and dual heads have no GGUF representation, which rules out the llama.cpp-based options, and the runtimes that do reach Metal load GGUF only. Weights ship as separate packages. Faithful in the arithmetic, verified stage by stage against the reference on both devices: the tokenizer embedding and first norm are bit-exact, relative error thereafter is float32 accumulation, and every discrete decision agrees across a 1536-token sample. Diverges in one place: sampling draws per-bar uniforms and selects by inverse CDF, so a draw does not depend on how bars were grouped into batches; the reference seeds one stream per batch and is not batch-invariant. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>