torchrun loop, or anything you can launch with a command.
How it works
You supply four things:
Veri runs your entrypoint inside the base image on the GPU, with a set of
VERI_* environment variables injected:
Exit code
0 marks the job completed; a non-zero exit marks it failed.
Base images
Pick the base that matches your stack. Each prebakes the slow, compiled pieces so cold start stays fast; you layer light dependencies on top.Example: a minimal training run
A small project directory:train.py reads the Veri contract, trains, logs metrics, and writes a checkpoint:
train.py
requirements.txt layers your extra dependencies on top of the base image:
requirements.txt
Multi-node
For runs that do not fit on one box, launch a multi-node gang with--num-nodes. Veri provisions all nodes together as a single unit, wires the topology into the VERI_* env above, and runs your entrypoint on every node. Your script drives the distributed launch (torchrun, with c10d rendezvous on rank 0).
Constraints:
- Whole-box only: each node is an 8-GPU box, so set
--gpu-count 8with--gpu-type A100-80GBor--gpu-type H100-80GB. Other shapes are rejected. - AWS only: multi-node runs on AWS.
- Custom script only: managed methods (GRPO, SFT, DPO) are single-node.
- Exact node count or fail:
--num-nodesmust be one of1,2,4,8,16. The gang launches at exactly that size or the submit fails fast (no silent cap-down).
torchrun at the injected topology. Rank 0 is the rendezvous host (VERI_HEAD_IP), every node reads its own VERI_NODE_RANK, and VERI_JOB_ID is the rendezvous id:
train.py
torchrun launch line, consuming the injected topology directly:
Checkpoints across nodes
Everything written underVERI_OUTPUT_DIR is captured, the same as single node. With N nodes you must avoid each rank writing the same path:
- Rank 0 saves (shown above): the simplest pattern. Gate the write on
rank == 0and use adist.barrier()so other ranks wait for the save to finish. - Sharded checkpoints: for large models,
torch.distributed.checkpoint(DCP) writes one shard per rank underVERI_OUTPUT_DIR, so no two ranks collide and you reload the shards on resume.
VERI_OUTPUT_DIR; a shared filesystem across nodes is not provided yet.
Observability
Everything shows up in the Veri UI for the job, alongside your managed jobs and deployments:- Live logs: your script’s stdout and stderr stream in real time.
- GPU metrics: utilization, memory, and power.
- Checkpoints: whatever you write under
VERI_OUTPUT_DIR. - Reward curves: two ways, pick either.
veri_sdk.log_metrics(shown above): append{"step": n, "reward": ..., "loss": ...}records and Veri renders them natively. Addveri-sdkto yourrequirements.txt.- Weights & Biases: connect your W&B account once (
veri wandb set) and Veri injectsWANDB_API_KEY,WANDB_PROJECT, andWANDB_RUN_IDinto the container, so your framework’s existingwandblogging flows to your own W&B account with no code change (OpenRLHF, verl, slime, and TRL all support it out of the box). Veri deep-links the run from the job page. AnyWANDB_*value you set yourself inenvtakes precedence.
Limits
- Node counts are exact:
1,2,4,8, or16. A gang launches at the requested size or the submit fails fast (no cap-down to fewer nodes). - Multi-node is whole-box, AWS, custom script only:
--gpu-count 8with--gpu-type A100-80GBorH100-80GBon AWS. Managed methods (GRPO, SFT, DPO) are single-node. - No shared filesystem across nodes yet: each node writes to its own
VERI_OUTPUT_DIR. Have rank 0 save, or shard withtorch.distributed.checkpoint. - Three base images (above). If your stack does not fit, a bring-your-own container image is the escape hatch (coming soon).

