Repository navigation
streamft 1.2.0: resumable LM-shard training
Status: released 2026-12-02. PyPI, GitHub tag/release, dev.to, X and
LinkedIn are published.
- PyPI: https://pypi.org/project/streamft/1.2.0/
- GitHub: https://github.com/byjameson/stream-finetune/releases/tag/v1.2.0
- dev.to: https://dev.to/mycute_97b39c4e34027570f9/streamft-120-resumable-lm-shard-training-on-a-6-gb-gpu-314e
- X: https://x.com/aigokhan/status/2127914803674907125
- LinkedIn: https://www.linkedin.com/feed/update/urn:li:activity:7533680694393401344/
1.1.0 made the SFT path resumable. 1.2.0 does the same for the LM-shard path
(--data): the trainer now saves the adapter, AdamW state, loss history and
sampler RNG, and it records a SHA-256 fingerprint of the token shard plus
the sequence length. Resuming a different --data file or a different --seq
is refused instead of silently continuing on unrelated windows.
What changed
--save DIR --save-every Nworks for LM-shard runs. The periodic checkpoint
is the same three files as the SFT path:adapter.pt,adapter_config.json
andtrainer_state.pt.--resume DIRcontinues to the total--stepstarget, not "N more
steps". The sampler generator state is restored after the optimizer step, so
an interrupted step is replayed rather than skipped.- The checkpoint stores the shard name, size and SHA-256, plus
seq. A changed
shard or a changed--seqexits with a clear error. streamft --versionnow works at the top level (it previously fell through to
the low-level trainer parser).- The SFT path is unchanged; 1.1.0 checkpoints keep working.
Real GPU smoke test
Hardware: NVIDIA RTX 3050 6GB Laptop, Qwen2.5-0.5B prepared as NF4, token shard
300,000 tokens, LM path, --seq 64 --chunk 64 --lora_r 8 --compute-dtype fp16.
- Started a 30-step run with
--save checkpoints/streamft_lm_interrupt --save-every 5. - Let it reach the periodic save at step 10, then terminated the process.
The checkpoint had step 10, 10 losses, the optimizer state andsampler_rng. - Resumed with
--resume checkpoints/streamft_lm_interruptand the same
--steps 30. The log showed
[resume] ... at step 10/30,optimizer and RNG state restored, and it
completed steps 11–30 with a final step-30 checkpoint.
Observed run:
[step] 10/30 loss=3.5023
[save] step 10 -> checkpoints/streamft_lm_interrupt
[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)
The final adapter_config.json has step: 30, mode: "lm", seq: 64 and the
same shard SHA-256 as the checkpoint. No .tmp files remain. Peak VRAM was
0.933 GB; median step time 0.40 s after the first autotune step.
Refusal checks on the same checkpoint:
--data data/streamft_smoke_valid.pt -> fingerprint changed ... use a fresh --save directory
--seq 128 -> checkpoint seq=64 does not match --seq 128
Both exited 1 before training.
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_runValidation
tests/test_lm_checkpoint_resume.py CPU exact resume / fingerprint tests
tests/test_checkpoint_resume.py SFT checkpoint round-trip
tests/test_streamft_smoke.py install/import smoke
local Streamft suite 96 passed
Ubuntu VM (CPU) 96 passed
The CPU suite asserts bit-exact continuation of the adapter and AdamW moments.
The GPU smoke test verifies 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.