๐ป CLI Referenceยถ
This page documents every mmirage subcommand and its flags.
For background on what each command does in the context of the pipeline, see Pipeline and SLURM & Cluster Deployment.
All MMIRAGE commands share the pattern:
mmirage <subcommand> [flags]
Common flags available on most subcommands:
Flag |
Description |
|---|---|
|
Path to a MMIRAGE YAML config file (required) |
|
Log verbosity: |
mmirage runยถ
Run the pipeline according to execution_params.mode and execution_params.retry.
mmirage run --config configs/config.yaml [--force-retry] [--shard-id N] [--stats] [--export-prompts PATH]
Flag |
Description |
|---|---|
|
Enable retry orchestration even if |
|
Run a single specific shard locally, ignoring the execution mode |
|
Enable GPU utilization and throughput collection during shard execution |
|
Dry-run for |
Behaviour summary:
mode: localโ Runs shards in the current Python environment.mode: slurmโ Submits an sbatch array job.retry: trueโ After each run, automatically retries failed shards until all succeed or the retry budget is exhausted.merge: trueโ After all shards succeed, merges outputs into<output_dir>/merged/.
mmirage submitยถ
Submit a single SLURM array job without the retry/merge orchestration loop.
mmirage submit --config configs/config.yaml [--shard-ids 0,2,3] [--wait] [--stats]
Flag |
Description |
|---|---|
|
Comma-separated shard IDs to submit instead of the full array |
|
Block until the submitted job finishes |
|
Enable GPU utilization and throughput collection on compute nodes |
mmirage checkยถ
Inspect shard status from the state directory and optionally submit retries.
mmirage check --config configs/config.yaml [--retry] [-y] [--stats] [--metadata-path PATH ...]
Flag |
Description |
|---|---|
|
Submit a retry job for any failed shards |
|
Submit retries without prompting for confirmation |
|
Enable GPU utilization and throughput collection on retried compute nodes |
|
|
Exits with code 0 if all shards succeeded, 1 otherwise.
For a config declaring a batch_api processor, check reports the provider batch status from the metadata receipts instead of the shard state โ see Batch API. It exits 1 only when a batch failed at provider level, batches still running are not a failure, and --retry, -y and --stats are ignored.
mmirage retryยถ
Submit a retry job for failed shards without inspecting status interactively.
mmirage retry --config configs/config.yaml [-y] [--stats]
Flag |
Description |
|---|---|
|
Submit retries without prompting |
|
Enable GPU utilization and throughput collection on retried compute nodes |
mmirage mergeยถ
Merge shard outputs for all datasets listed in loading_params.datasets.
mmirage merge --config configs/config.yaml [--output-root /path/to/merged]
mmirage merge --config configs/batch_config.yaml --output-path merged.jsonl [--metadata-path PATH ...]
Flag |
Description |
|---|---|
|
Root directory for merged outputs. MMIRAGE creates one subdirectory per dataset. If omitted, each dataset is merged into |
|
|
|
|
For a config declaring a batch_api processor, merge retrieves the completed provider results and merges them by source index into --output-path, since the shards only hold submission placeholders โ see Batch API.
mmirage merge-dirยถ
Merge shard outputs directly from a directory, without a config file.
mmirage merge-dir --input-dir /path/to/shards --output-dir /path/to/merged
Flag |
Description |
|---|---|
|
Directory containing |
|
Output directory for the merged dataset(s) |
If shard_* folders are present directly in --input-dir, MMIRAGE treats it as a single dataset and merges it there, ignoring nested internal folders such as _pipeline_state.
mmirage statsยถ
Print per-shard benchmark statistics including runtime, throughput, and GPU utilization.
mmirage stats --config configs/config.yaml
Stats are only available for shards that were run with --stats enabled (or MMIRAGE_COLLECT_STATS=1). Output is a JSON report:
{
"per_shard": [
{
"shard_id": 0,
"status": "success",
"started_at": "2026-04-30T10:00:00",
"finished_at": "2026-04-30T10:01:05",
"stats": {
"runtime_seconds": 65.2,
"runtime_human": "1m 5s",
"rows_processed": 1024,
"throughput_rows_per_sec": 15.7,
"gpu_util_mean": 88.4,
"gpu_util_min": 72.0,
"gpu_util_max": 98.0,
"tokens_per_sec_per_gpu": 753.1,
"gpu_days_per_billion_tokens": 0.0015
}
}
],
"aggregate": {
"total_shards": 1,
"completed_shards": 1,
"total_rows_processed": 1024,
"overall_throughput_rows_per_sec": 15.7,
"mean_gpu_util_pct": 88.4,
"tokens_per_sec_per_gpu": 753.1,
"gpu_days_per_billion_tokens": 0.0015
}
}
Key metrics:
Metric |
Description |
|---|---|
|
Shard wall-clock time (excludes SLURM queue wait) |
|
Total rows / wall-clock time across all parallel shards |
|
Output tokens per second per GPU โ primary throughput metric |
|
GPU-days to generate 1B output tokens โ useful for cost comparison |
|
Mean GPU utilization across shards |
Token metrics are null when no LLM processor was active. GPU stats are null when nvidia-smi is unavailable or --stats was not passed.
Exit Codesยถ
Code |
Meaning |
|---|---|
|
All shards completed successfully |
|
One or more shards failed or exceeded the retry budget |
See alsoยถ
Pipeline โ understand the stages each command drives
SLURM & Cluster Deployment โ
submit,check,retryin contextBenchmarking โ
--statsflag andmmirage statsin depthConfiguration Reference โ the YAML config every command reads