Skip to content

armgit / Soup

Public Imported from GitHub
0

Fine-tune LLMs from one YAML. Layer streaming trains an 8B model on a 4 GB laptop GPU.

1.9 KB
Raw Blame
  • Layer streaming shards a DeepSeek-V3 FP8 block-quantised checkpoint by dequantising it (the format DeepSeek-V3 is published in: float8_e4m3fn weights with a float32 weight_scale_inv per 128 x 128 block, declared in config.json). It used to be refused. Each FP8 weight is multiplied by its block scales in fp32 at shard time, ragged edges cropped, cast to the stream dtype and then stored as before (NF4 under quantization: 4bit); routed experts are dequantised before they are stacked or written per expert, and the scales are never stored. The work goes one band of rows at a time into an output at the stream dtype, so a tensor costs its output plus a small band. No config key: the format is detected from the checkpoint, and the streamed model is built at the stream dtype. A tiny DeepSeek-V3 streamed from its FP8 copy matches a resident model holding the same dequantised weights bit for bit (logits, loss, LoRA gradients, both expert layouts), and its cache holds the same tensors, bit for bit, as one sharded from those weights, NF4 included (benchmarks/gate-fp8-shard.md). The disk pre-flight charges each FP8 weight at its stored rate and nothing for the scales: on Moonlight-16B-A3B converted to this format, CPU only, the 27-layer NF4 cache (30.60 GB, sharded in 93 s) came within 0.0002% of the estimate, and every checked FP8-derived tensor equals an independent dequant of the source. Refused, naming the supported format: every other FP8 spelling (per-tensor scales, e5m2, compressed-tensors, ue8m0 scales, static activation scales, an out-of-range weight_block_size, a missing or misshapen scale, an FP8 tensor without a scale, a scale without its tensor), damaged values (a NaN byte, a negative or non-finite scale, a float16 overflow) and an FP8 base that is not model_type: deepseek_v3. Kimi K2 (model_type: kimi_k2) is still refused by name. (#2061)