Skip to main content
Use this when you can score an answer more easily than you can write the ideal one. The run loads a small instruct model, samples groups of completions, and steps a LoRA adapter with TRL’s accuracy_reward on DeepMath. You get JSON metrics back. The machine is gone when the function returns. Public self-service for this guide is MI300X. Stock can be tight. Need install and credit first? Install, sign in, then add credit.

Save the file

Save as rl.py:
The decorator sets a 30-minute kill limit. One GRPO step still samples several completions, so stay on --wait for the first run.

Dry-run, then run

The homepage command is the same entrypoint without --wait --yes. Without --wait, the CLI prints a run id and exits; compute logs <run_id> -f follows it from another terminal. Defaults are one step, 16 prompts, 4 generations each. To do more work:
--timeout may go up to 24 hours. You are billed for started minutes while the machine exists. Closing the laptop after a detached create does not keep the job warm past the timeout or after the function returns.

What you get back

JSON with reward_mean, train_loss, and the device name. There is no checkpoint-resume API and no artifact download in v0.1. If create is refused, send the request id to Support.

Fine-tune a model

Supervised LoRA when you have labeled examples.

Batch inference

Score or label a set without training.