The GPU Spent 95% of Its Time Computing Nothing: Packing Short Dialogues Made Fine-Tuning 20x Cheaper
The author rented an H200 GPU to fine-tune a language model and paid $53 for 15% of the second stage. The dialogues are short, about 20 tokens, but each one was padded with empty positions up to 1024, so only 5% of the work was useful. Packing the dialogues into dense blocks raised that share to 99%, and the stage now costs $14–17 instead of $331–413. Before renting, check on a sample how large a share of the tokens is useful.
AI-processed from Habr AI; edited by Hamidun News
The author of a series of articles on a Crimean Tatar language model rented an H200 GPU in the cloud and got only 15% of the second fine-tuning stage for $53. The reason is mundane: the card spent almost all its time computing emptiness. Imagine hauling one small box at a time in a whole truck while paying for the entire cargo bed.
That is what happened here: the training dialogues are short, about 20 tokens, but each one was padded with empty positions (padding) up to 1024, so only a fifth of a fifth turned out to be useful: about 5% of the compute. This breakdown is worth reading for anyone who rents GPUs by the hour: it shows which checks take a minute and save hundreds of dollars. Over a month and a half, rentals cost a little over $300.
First run: $53 for 15% of the work
Full fine-tuning required a 141 GB card at about $4.6 per hour. The estimate promised 9–11 hours and $33–40. After 11.5 hours and $53, the author stopped the run: the second stage was 15% complete, with about 46 hours still to go. The card delivered roughly 3–4% useful output, and the author found three causes.
The first and main one was padding. Masks ensure that empty positions do not affect the result, but they fully affect the compute bill: the matrices are multiplied across the entire sequence length. The estimate assumed 59 million tokens, while the card processed 1.17 billion positions, so the estimate was off by a factor of 20. The plan did include the assumption that "padding adds about 20% overhead," but nobody verified it, even though checking it on a dataset sample takes a minute.
The second cause was checkpoints. A 46 GB state was written every 400 steps to a network volume, the write was synchronous, and the card sat idle. In total, about 600 GB was written, and GPU utilization held at 58–68%. The author advises measuring save frequency in hours of work rather than in steps, and writing to a local disk first. The third cause was the data loader: on a 128-core machine, 2 processes prepared batches, and the fast card waited for the next one. As a rule of thumb, give about a quarter of the cores to loader processes.
The cure for padding is packing: short dialogues are packed into dense blocks, and the mask stops neighboring examples from seeing each other. The share of useful tokens rose from 5% to 99%. By recalculation, the second stage in its old form would have cost $331–413; now it costs $14–17. Caveat: the old setup was never run to completion, so this is a calculation, not a measurement.
Everything around the training kept failing
On September 1–2 alone, the author had to rent five machines in a row. Training itself never crashed once; the launch scripts, the checks and the watchdog did. One machine died at step 50 of 95: a new intermediate check required about 160 GB on a card with 141 GB. Another was killed by an old "run failed" marker file left on a persistent volume: the watchdog believed it and shut down healthy training at step 80 of 95, 4 minutes before the end of the stage. Each piece had been tested separately; the whole chain, never.
The answer is a free dry run at home: the same chain and the same watchdogs, but with a tiny model. One dry run on September 5 took 4.7 hours and caught 6 defects. The nastiest one: because of the model wrapper, gradient accumulation made the effective learning rate in the first stage 16 times higher than configured. Gradient clipping masked it, and the loss curve looked decent.
The most expensive habit turned out to be killing the machine on any error: a new machine reinstalls the environment and downloads tens of gigabytes of weights from scratch, and the logs vanish with the old one. The new rule is to fix things in place and restart the process. The run with packing and this rule went through both stages in one go and cost about $41, while the trial training took 2.81 hours and $12.91 with no failures.
The watchdog erred in both directions
The watchdog is a separate program that monitors training and shuts down the machine. On September 6, it missed the end of training on a B300, and the machine, which costs $7.89 per hour, sat idle for 30–40 minutes.
On September 24, it overreacted: readings of 94, 0, 100 and 0% averaged 48% against a 50% threshold, and 28 seconds before the end it saved a checkpoint and destroyed the machine. The zeros fell on save pauses, when the card is legitimately waiting for the disk. Now a hang is defined as the card sitting idle while the step counter does not change.
The watchdog lives at home and reaches the machine from outside, and it goes through a drill alarm before each launch.
The takeaway is universal: build the estimate from the number of positions that will actually pass through the card, check it against reality in the first minutes, and rehearse the whole chain at home. The author does not name the models and techniques involved, so the figures cannot be carried over one to one, but the questions stay the same.
- Nov 23, 20267% of AI agent sessions in a code editor burned 74% of tokens over 90 days
- Apr 27, 2026DeepSeek cuts DeepSeek-V4-Pro prices by 75% and makes repeat requests 10 times cheaper
- Nov 8, 2026KPN launches Mobiel AI: voice assistant for small businesses boosts accuracy from 50% to 90%
- Oct 9, 2026Fine-Tuned 0.8B-Parameter Model Beats GPT-5.4 at Grammar Annotation
Key Questions Answered
What are the key details on First run: $53 for 15% of the work?
Full fine-tuning required a 141 GB card at about $4.6 per hour. The estimate promised 9–11 hours and $33–40. After 11.5 hours and $53, the author stopped the run: the second stage was 15% complete, with about 46 hours still to go. The card delivered roughly 3–4% useful output, and the author found three causes. The first and main one was padding. Masks ensure that empty positions do not affect the result, but they fully affect the compute bill: the matrices are multiplied across the entire sequence length.
What are the key details on Everything around the training kept failing?
On September 1–2 alone, the author had to rent five machines in a row. Training itself never crashed once; the launch scripts, the checks and the watchdog did. One machine died at step 50 of 95: a new intermediate check required about 160 GB on a card with 141 GB. Another was killed by an old "run failed" marker file left on a persistent volume: the watchdog believed it and shut down healthy training at step 80 of 95, 4 minutes before the end of the stage.
What are the key details on The watchdog erred in both directions?
The watchdog is a separate program that monitors training and shuts down the machine. On September 6, it missed the end of training on a B300, and the machine, which costs $7.89 per hour, sat idle for 30–40 minutes. On September 24, it overreacted: readings of 94, 0, 100 and 0% averaged 48% against a 50% threshold, and 28 seconds before the end it saved a checkpoint and destroyed the machine. The zeros fell on save pauses, when the card is legitimately waiting for the disk.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
