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.

818 B
Raw Blame
  • Expert-granularity streaming for DeepSeek-V3 MoE layers. shard_checkpoint(..., expert_layout="per_expert") writes each MoE layer's routed experts to their own file, one pair of matrices per expert (NF4 under quant="nf4"), and the streamed model reads an expert only when the router picks it, so the VRAM bound no longer grows with the expert count. It is bit-exact against transformers' eager experts on real OLMoE-1B-7B layers, forward and backward, in fp32, bf16 and NF4. Measured on an RTX 5070 Laptop (8 GB): LoRA steps of a Kimi K2-shaped 1.03 T-parameter model (random weights) at 4,723 MiB of peak VRAM, 14.5-18.5 minutes per step. Reachable from the sharder API and the benchmark harnesses; no config field yet. Backward recomputation preserves the forward autocast settings. (#2008)