TorchSpec
TorchSpec copied to clipboard
Eval cache generation hangs when eval dataset size isn't a multiple of `inference_batch_size`
Summary
When the eval dataset size is not an exact multiple of inference_batch_size, eval cache generation never completes. The trailing 0 < n < inference_batch_size prompts are never dispatched to the inference engines, so generate_eval_cache stalls and eventually dies with a TimeoutError after the 300s idle window.
Environment
- Backend: SGLang (
v0.5.10.post1), single node - Model:
Qwen/Qwen3-8B - 1 trainer GPU + 1 inference GPU
Reproduction
Using the single-node example with the shipped 64-sample eval set and a batch size that does not divide 64:
examples/qwen3-8b-single-node/run.sh configs/sglang_qwen3_8b.yaml \
dataset.eval_data_path=examples/data/eval_conversations.jsonl \
dataset.eval_interval=1 \
inference.inference_batch_size=6 # 64 % 6 = 4 ← trailing partial batch
(examples/data/eval_conversations.jsonl is 64 samples; 64 = 10*6 + 4.)
Observed behavior
Eval caching climbs to 60/64 and then stops. After 300s of no progress:
Eval caching: 94%|█████████▍| 60/64 [06:16<00:25]
AsyncInferenceManager: Drain: discarding 4 buffered prompts on shutdown
TimeoutError: Timed out while waiting for eval cache generation
(no progress during eval for 300.0s, idle_timeout=300.0s, dispatched=60/64 samples)
at generate_eval_cache → _check_idle_timeout (torchspec/controller/eval.py:131 → :57)