KronosPredictor.predict() hangs after ~20-40 invocations in a loop on Windows (torch 2.11, Python 3.14) · Issue #403 · shiyu-coder/Kronos · GitHub
Skip to content

KronosPredictor.predict() hangs after ~20-40 invocations in a loop on Windows (torch 2.11, Python 3.14) #403

Open

Description

@markoni82-stack

Bug summary

KronosPredictor.predict() reliably hangs (process goes to 0% CPU, no exception, no output) after roughly 20–40 successful invocations in a Python for loop. Reproducible on both Kronos-mini (4.1M) and Kronos-small (24.7M), with device='cpu' and device='cuda'. Process is not recoverable (cannot be interrupted with Ctrl+C; only taskkill).

Environment

  • OS: Windows 11 (10.0.26200)
  • Python: 3.14.3
  • PyTorch: 2.11.0+cu128 (CUDA available: True; GPU NVIDIA GeForce RTX 3070)
  • numpy/pandas/einops/huggingface_hub/safetensors: installed per requirements.txt
  • Repo commit: latest master (cloned 2026-09-11)
  • Model: NeoQuasar/Kronos-mini and NeoQuasar/Kronos-small; tokenizer NeoQuasar/Kronos-Tokenizer-base

Minimal reproduction

import sys, gc, time
sys.path.insert(0, "/path/to/Kronos")
import torch
from model import Kronos, KronosTokenizer, KronosPredictor

tokenizer = KronosTokenizer.from_pretrained("NeoQuasar/Kronos-Tokenizer-base")
model = Kronos.from_pretrained("NeoQuasar/Kronos-mini")  # same with Kronos-small
predictor = KronosPredictor(model, tokenizer, device="cpu", max_context=512)

# Synthetic 400-bar OHLCV window + 20-bar horizon timestamps
import pandas as pd
n = 400
df = pd.DataFrame({
    "open":   [100.0]*n, "high":   [101.0]*n,
    "low":    [ 99.0]*n, "close":  [100.0]*n,
    "volume": [1000.0]*n,
})
x_ts = pd.Series(pd.date_range("2026-01-01", periods=n, freq="15min"))
y_ts = pd.Series(pd.date_range("2026-01-01 04:00", periods=20, freq="15min"))

for i in range(200):
    t0 = time.time()
    pred = predictor.predict(df=df, x_timestamp=x_ts, y_timestamp=y_ts,
                             pred_len=20, T=1.0, top_p=0.9, sample_count=1)
    elapsed = time.time() - t0
    print(f"iter {i}: {elapsed:.2f}s", flush=True)
    gc.collect()  # did not help

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions