streamft 1.2.0 is out. 1.1.0 made the SFT path resumable. 1.2.0 does the same for the LM-shard path (--data), where a checkpoint has to remember more than the adapter and AdamW state.
Why LM shards are different
The SFT path walks rows in a fixed order. The LM path samples random windows from a token shard. If you resume on a different shard, or with a different --seq, the sampler windows point at different tokens. Silently continuing would produce a run that looks like one training curve but is really two unrelated ones.
1.2.0 stores:
- the adapter and AdamW moments,
- the loss history,
- the sampler RNG state, restored after the optimizer step so an interrupted step is replayed, not skipped,
- the shard name, size and SHA-256,
- the sequence length.
A changed shard or --seq is refused before training starts.
Real GPU smoke test
I ran this on the actual RTX 3050 6GB laptop with Qwen2.5-0.5B prepared as NF4 and a 300,000-token shard.
[step] 10/30 loss=3.5023 [save] step 10 -> checkpoints/streamft_lm_interrupt # process terminated here [resume] checkpoints/streamft_lm_interrupt at step 10/30 [resume] optimizer and RNG state restored [step] 11/30 loss=3.5449 ... [step] 30/30 loss=3.6567 [save] checkpoints/streamft_lm_interrupt (step 30) Peak VRAM was 0.933 GB, median step time 0.40 s after the first autotune step. The final adapter config recorded step: 30, mode: "lm", seq: 64 and the same shard SHA-256. No .tmp files remained.
The two safety checks also behaved:
--data different_shard.pt -> fingerprint changed; use a fresh --save directory --seq 128 -> checkpoint seq=64 does not match --seq 128 Both exited before touching the optimizer.
Usage
# checkpoint every 100 LM steps streamft train --model-dir checkpoints/qwen0.5b_nf4 \ --data data/wt2_train.pt --steps 2000 --seq 256 \ --save checkpoints/lm_run --save-every 100 # after a crash or Ctrl+C: --steps is the total target streamft train --model-dir checkpoints/qwen0.5b_nf4 \ --data data/wt2_train.pt --steps 2000 --seq 256 \ --resume checkpoints/lm_run The SFT path is unchanged; 1.1.0 checkpoints keep working.
Install
pip install --upgrade streamft==1.2.0 Validation
- Streamft CPU suite: 96 passed locally and on the Ubuntu VM.
- CPU tests assert bit-exact continuation of the adapter and AdamW moments.
- The GPU smoke test covers the real quantized LM path end to end. GPU kernel nondeterminism means a fresh run is not expected to be bit-identical to a resumed run.


