Repository navigation
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.