Black Friday: 10% off every GPU you launch, no code needed. Until 30 Nov. Rent a GPU

Arrakis / Blog / Train and fine-tune

Fine-Tune Qwen with LoRA: Cost, Memory and Hours

To fine tune Qwen with LoRA, the cost is three numbers multiplied: GPUs, price per GPU-hour, and hours. Memory picks the GPU, your token count sets the hours, and the market sets the price. Here is each number for the Qwen models we size, with a worked example you can redo with your own data before you rent anything.

1. Memory picks the GPU

Fine-tuning holds more than the weights. LoRA keeps the 16-bit base model frozen and trains small adapters: about 2.4 bytes per parameter. QLoRA stores the frozen base in 4-bit: about 0.7. Full fine-tuning with Adam needs about 16 bytes per parameter. The GPU memory guide explains each one. All figures below are before activations.

Model QLoRA LoRA Full fine-tuning
Qwen3-VL-8B-Instruct (8.8B) 6 GB: 1 x RTX 4090 21 GB: 1 x RTX 4090 140 GB: 1 x H200
Qwen3.8-27B (27.8B) 19 GB: 1 x RTX 4090 67 GB: 1 x A100 80 GB 445 GB: 2 x B300
Qwen3.6-35B-A3B (36B) 25 GB: 1 x RTX 5090 86 GB: 1 x RTX PRO 6000 575 GB: 8 x H100
Qwen3.8-Flash-Next (180B) 126 GB: 1 x H200 432 GB: 2 x B300 2,880 GB: more than one 8-GPU machine

The case for adapters in one row: full fine-tuning Qwen3.8-27B takes two B300s, LoRA takes one A100, QLoRA one RTX 4090.

Watch the activations. "Before activations" means long sequences and big batches need memory on top. If a run runs out of memory, cut the sequence length or the batch, turn on gradient checkpointing, or step up one card. QLoRA on Qwen3.6-35B-A3B shows how tight this gets: 25 GB is one gigabyte more than an RTX 4090 holds, so it goes to a 32 GB RTX 5090.

Which method to pick

  • QLoRA when the card is the constraint. It is how its authors fine-tuned a 65B model on one 48 GB GPU (arXiv:2305.14314), and it puts Qwen3.8-27B on a 24 GB RTX 4090.
  • LoRA when the 16-bit base fits a card you can rent. There is no 4-bit copy of the base to make, and on Qwen3.8-27B it still fits one 80 GB A100.
  • Full fine-tuning when adapters have clearly fallen short on your own evals. It needs the most GPUs for the same model, so make it earn its place.

Start with the smallest method that could work, measure, and move up only when the evals say so. Each step up rents a bigger machine.

2. Your tokens set the hours

We do not publish measured training speeds. We use a rough rule from compute, the same one behind our own estimates: training work is about 6 x parameters x training tokens, and a GPU sustains about 40% of its peak. An A100's peak is 312 TFLOPS in BF16, dense.

Worked out for one A100 80 GB and 10 million training tokens:

Run Work Rough time
LoRA, 8B model 6 x 8B x 10M = 4.8 x 10^17 about 64 minutes
LoRA, Qwen3.8-27B 6 x 27.8B x 10M = 1.7 x 10^18 about 3.7 hours

Treat these as planning numbers, not promises. Sequence length, batch size, the framework and the data loader all move the real time. So measure it: run the first hour, read the time per step from your trainer's log, and multiply out. You pay for that hour anyway.

QLoRA saves memory, not time, and we have no figure for its speed. Measure it the same way.

3. Dollars: started hours, not minutes

Every machine bills each started hour in full, at the price locked when you rent. That changes the math:

  • The 8B run: 64 minutes is two started hours. Trim the data a little, or plan for 2 x the live price.
  • The Qwen3.8-27B LoRA run: about 3.7 hours of training plus downloading the model. Set a 5-hour removal time and the bill is capped at 5 x the live price; checkpoints on a volume survive if the run goes long.
  • QLoRA on an RTX 4090: the live price per started hour, for however many hours your first-hour measurement says.

Compare the full fine-tune of the same model: two B300s, 2 x the live price for every hour it runs, before you have learned whether the adapter would have been enough. LoRA is the cheap road. Take it first.

Run it

Find an A100 that can mount a volume with GET /v1/gpus?gpu_type=A100&volumes=true, then rent it with the default PyTorch image, the volume and a removal time:

Shell
curl -X POST https://arrakis.goodailabs.com/v1/instances \
  -H "Authorization: Bearer ark_..." \
  -H "Content-Type: application/json" \
  -d '{"name": "qwen-lora", "node_id": "<an A100 node id>",
       "termination_hours": 5, "ssh_key_id": "<your saved key id>",
       "volume_id": "vol_..."}'

The volume mounts at /mnt, outlives the machine and is billed per GB-month of data it holds. Keep the dataset and checkpoints there. If you rent spot to save money, that volume is what lets you resume when a host takes the machine back (spot training with checkpoints). Copy the dataset to the machine's own disk once before training, since the local disk is faster for repeated reads.

Or hand the whole run to an agent with a capped token:

Text
Find an A100 80 GB that can mount my volume vol_... and rent it for 5 hours.
Run python train.py --config qwen27b-lora.yaml with checkpoints in /mnt,
copy ./adapter back to me when it finishes, then terminate the machine.

The token's spend cap counts the rental at its worst case (hourly price x removal hours) before it starts, so the agent cannot run past your budget. Setup is on the agents page.

Either way, stop the machine when the run ends. Fine-tuning comes in bursts, and the volume means nothing has to stay up between them: tomorrow, rent a machine that takes a volume, pass the same volume_id, and evaluate the adapter there, on a cheaper card if one holds the model. Leave the public Qwen base off the volume, since each machine downloads it from Hugging Face to its own disk, and keep the volume for your data, checkpoints and adapters. A volume is billed per GB-month of what it holds, so keeping them costs little. The full pattern: persistent storage for cloud GPUs.

Then serve it

Merge the adapter into the base model, push it to a private Hugging Face repository, and deploy it like any model. The read-only Hugging Face token goes to the machine only:

Shell
curl -X POST https://arrakis.goodailabs.com/v1/deploy \
  -H "Authorization: Bearer ark_..." \
  -H "Content-Type: application/json" \
  -d '{"model": "your-org/qwen3.8-27b-support-bot", "engine": "vllm",
       "hf_token": "hf_...", "termination_hours": 8}'

A merged fine-tune has the same parameter count as its base, so it needs the same memory to serve: Qwen3.8 27B GPU requirements. Options for the endpoint are on the deploy page.

Price your run

Find your model's row, check the live price of its card, multiply by started hours, and rent it from the console.

New here? Use code FIRST25 for $25 off your first deposit of $50 or more, until 31 December 2026.

Rent the GPUs in this post

New here? Use code FIRST25 for $25 off your first deposit of $50 or more, until 31 December 2026.

Lowest price now, per GPU-hour. Billed per started hour; stop any time.

Questions

How much GPU memory does a Qwen LoRA fine-tune need?
About 2.4 bytes per parameter before activations: about 67 GB for Qwen3.8-27B, which fits one A100 80 GB. QLoRA needs about 0.7 bytes per parameter: about 19 GB for the same model, one RTX 4090.
How long does a LoRA fine-tune take?
It depends on your tokens and your GPU. A rough rule from compute is 6 x parameters x training tokens at 40% of the GPU's peak, which gives about 64 minutes for an 8B model on 10 million tokens on one A100. It is an estimate, not a measurement.
How is a fine-tuning run billed on Arrakis?
By the GPU-hour from a prepaid balance. Each started hour is charged in full at the price locked when you rented, and the machine is removed at its removal time.
Should I fine-tune on spot GPUs?
For short runs, or runs that save checkpoints off the machine, yes: spot is the cheapest tier. Its host can take the machine back, so write checkpoints to a volume and resume on the next machine.
How do I serve my fine-tuned Qwen model?
Merge the adapter, push the model to a private Hugging Face repository, and deploy it with POST /v1/deploy and a read-only Hugging Face token.

More from the blog

Every postRSS feed