Menu

Post-Training Alignment (DPO) & Live Online GRPO Reinforcement Learning on TPUs with TorchTPU (Part 3)
📰

Post-Training Alignment (DPO) & Live Online GRPO Reinforcement Learning on TPUs with TorchTPU (Part 3)

DEV Community: pytorch·Ahmed Elnaggar·1 day ago
#IXsIIP4b
#devtopytorch#devto#dev#grpo#model
Long article (1391 words) — no AI summary yet.
Reading 0:00
15s threshold

Companion GitHub Repository: agemagician/torchtpu-zero-to-hero

From 0.0% to 96.9% Verifiable Math Accuracy in 45 Online GRPO Steps — on a Single 16 GiB Colab TPU

Post-training is where base language models turn into helpful assistants ( Direct Preference Optimization [DPO] ) and verifiable step-by-step reasoners ( Group Relative Policy Optimization [GRPO] , the online RL algorithm popularized by DeepSeek-R1).

Running post-training and online RL on a single 16 GiB TPU TensorCore ( TPU v5e-1 ) forces you to solve three classic systems bottlenecks:

Vocabulary Logit HBM Blowups: Upcasting [B*G=8, S=192, V=151,936] Qwen3 logits to float32 allocates ~ 0.93 GiB per tensor ( >5 GiB across forward + autograd), leaving no room for KV caches and weights.

Mid-Step Dynamo Guard Breaks: Toggling with model.disable_adapter(): inside a DPO training step mutates module state and invalidates torch.compile guards.

Variable-Length Rollout Recompilations: Generating G = 4 online reasoning rollouts per prompt with variable…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.