Prince Osei Aboagye
// Mini DeepSeek V4

Guide

Run every stage yourself: setup, data, pretraining, SFT, RL, evaluation and serving, with the exact commands and the results to expect.

  1. 01SetupHow to prepare a laptop, one H100 or an 8×H100 node for this project: the pinned environment, Megatron-LM at d6316eb45 with our patch, the setup script, and the health checks to run before any training.
  2. 02DataHow to build the RL curriculum and test sets, 2.6B tokens of FineWeb-Edu in Megatron's format, and the packed SFT set, then stage them with checksums for the GPU machine.
  3. 03PretrainingHow to run the router study and the main pretraining of the 6.86B-parameter mixture of experts on 8×H100 with Megatron-LM, size it before launch, watch it, and check the result against our numbers.
  4. 04Supervised fine-tuningHow to fine-tune the pretrained model on 55,083 worked math problems with Megatron's SFT mode, choose the epoch to keep, and run the checks that decide whether RL can start.
  5. 05Reinforcement learning with GSPOHow to run GSPO with Megatron-LM's own RL loop on 8×H100: the rate calibration, the first-update checks, the run and what to watch, the optional difficulty filter, and the laptop experiments that came first.
  6. 06EvaluationHow to run the held-out evaluations with Megatron's inference engine inside a time limit, read greedy, pass@8 and avg@8, compare two models with paired tests, and measure the evaluation's own noise.
  7. 07ServingHow to benchmark the trained model with Megatron's dynamic inference engine, in a 512-request mode on 8 GPUs and a one-request mode on one GPU, and how to size the KV cache.
  8. 08The control runHow to run our GSPO pipeline on Qwen2.5-Math-1.5B with PocketRL's data, prompt and grader on one H100, with a decision rule fixed in advance, and check the result stage by stage.
  9. 09Distillation and 4-bit trainingHow to distil the pretrained mixture of experts into a 314M dense student, and quantize the experts to 4 bits with NVIDIA Model Optimizer, with the commands, the checks, and what the rehearsal and the laptop measured.
  10. 10Converting checkpointsHow we converted Qwen2.5-Math-1.5B from Hugging Face into Megatron's format for the control run, how we checked the conversion, and what exists, and does not, for converting our own model the other way.
  11. 11MonitoringWhat to watch at each stage of the pipeline, the threshold that turns each signal into an alarm, what an alarm looks like, and the scripts that check them for you.
  12. 12CheckpointsWhat each stage saves and how big it is, how to resume pretraining and RL, how to make a weights-only copy with Megatron's checkpoint conversion, and how to check copies and saved weights.
  13. 13Testing the pipelineHow to run the 541 unit tests, what the known-answer tests and the planted-bug checks are, how to check every launch script's flags without a GPU, and the rehearsal checklist for one H100.
  14. 14TroubleshootingOne table of every defect recorded in this project's code, data, configuration, measurements and infrastructure, with its cause, its fix, and the stage that caught it.