OLMES / vLLM evaluation for looped (per-loop quantized) Ouro
This is the evaluation used for the GSM8k numbers of the ParetoQaft/*-looped-*-nemotron models and the
per-loop bit-width routes (e.g. 2-2-2-4, 2-4-4-4). It runs OLMES (oe_eval) on vLLM 0.21.0, with a patched
Ouro model implementation. It is the companion to the quantization code in
ParetoQaft/looped-autoround-ouro.
What the vLLM patch does (vllm/model_executor/models/ouro.py)
- Per-loop weights. After the normal weights are loaded, the model reads
quant_ut_stepsandquantized_weights_pathfromconfig.json. For the loops listed inquant_ut_steps, the projection weights are swapped in from that file (and swapped back afterwards), so one checkpoint can run e.g. loops 0-2 at 2-bit and loop 3 at 4-bit.total_ut_stepssets the number of loops (1 = run Ouro as a single-pass model). - Unrolled checkpoints. If
config.original_num_hidden_layersis set and differs fromnum_hidden_layers(e.g. a 96-layer unrolled copy of the 24-layer x 4-loop model), the layers run once in sequence, with one norm / exit gate per original loop. - No torch.compile, no CUDA graphs for looped models. The weight swap modifies parameters at runtime, which breaks CUDA-graph capture. All reported numbers were produced in this mode, including uniform models without a swap.
The lm_eval patch only renames prompt_token_ids= to prompts= in three LLM.generate calls, as required
by the vLLM 0.21 API.
Contents
| File | Purpose |
|---|---|
requirements.txt |
exact package set of the evaluation environment (Python 3.10, vllm 0.21.0, torch 2.11.0, CUDA 13 wheels, OLMES at commit 5a51f502) |
patches/vllm-0.21.0-ouro-looped.patch |
Ouro model changes above |
patches/lm_eval-0.4.3-vllm-prompts.patch |
vLLM 0.21 API fix |
apply_patches.sh |
applies both patches after checking the package versions and the stock file hashes |
prepare_model.py |
copies a dense checkpoint and writes the loop schedule into config.json |
run_eval.sh |
runs any OLMES task(s) or a predefined task set (see below) and prints each task's primary_score |
run_gsm8k.sh |
shortcut for run_eval.sh <model> <out> pretrained (GSM8k 3-shot, the reported numbers) |
Usage
python3.10 -m venv venv && source venv/bin/activate
# --no-deps is required: the file pins every package exactly, but OLMES declares numpy<2 while the
# working environment (and vLLM 0.21) uses numpy 2.2.6, so pip's resolver would refuse the set.
pip install --no-deps --src ./src -r requirements.txt # OLMES is installed editable into ./src
./apply_patches.sh
# packed GPTQ -> dense BF16 first (dequantize.py from ParetoQaft/looped-autoround-ouro)
python prepare_model.py --model path/to/dense-model --output eval_models/model-4loops # uniform, 4 loops
python prepare_model.py --model path/to/dense-model --output eval_models/model-1loop --total-loops 1
python prepare_model.py --model path/to/w4-dense --output eval_models/2444 --quant-loops 0 # needs 2bit_model.quant
./run_gsm8k.sh eval_models/model-4loops results/model-4loops # GSM8k 3-shot only
./run_eval.sh eval_models/model-4loops results/model-4loops dev # instruct task set
./run_eval.sh eval_models/model-4loops results/model-4loops gsm8k::tulu ifeval::tulu -- --batch-size 64
Task sets
run_eval.sh <prepared model> <output dir> <task|set>... [-- --batch-size N --max-length N]
Each task writes <output dir>/<name>/metrics.json (plus OLMES's predictions/requests files). At the end,
the script prints one RESULT <name> <alias> primary_score <x> line per task. primary_score is the
task's main metric in percent: exact match for GSM8k, pass@1 for HumanEval, micro-average for BBH, etc.
pretrained: for base and quantized models, no chat template. All reported numbers use this set.
| Name | Task |
|---|---|
gsm8k_pre |
GSM8k test, 3-shot, STD:GSM8k few-shot examples, exact_match, no chat format, batch 64 |
Three more pretrained-style tasks were defined but switched off in the original pipeline. They can be requested by name but were not part of the reported results:
| Name | Task |
|---|---|
humaneval_pre |
HumanEval, pass_at_1, greedy, max 1024 new tokens, no chat format |
bbh_pre |
bbh:cot-v1::olmes (BIG-Bench Hard, chain of thought) |
winogrande |
Winogrande validation, 5-shot, acc_raw |
dev: the instruct suite for instruction-tuned / chat models (Tulu 3 setup, chat template applied):
| Name | OLMES task | Domain |
|---|---|---|
gsm8k |
gsm8k::tulu |
math |
codex_humaneval |
codex_humaneval::tulu |
coding |
codex_humanevalplus |
codex_humanevalplus::tulu |
coding |
ifeval |
ifeval::tulu |
instruction following |
bbh |
bbh:cot-v1::tulu |
reasoning |
truthfulqa |
truthfulqa::tulu |
knowledge |
agi_eval_english |
agi_eval_english:0shot_cot::tulu3 |
reasoning |
gpqa |
gpqa:0shot_cot::tulu3 |
knowledge |
The dev set does not suit base models such as the quantized Ouro checkpoints, which are not chat-tuned.
gsm8k (Tulu, chat format) and gsm8k_pre (3-shot, plain text) are different evaluations whose scores cannot be compared.
Any other OLMES task can be given directly, either as a registered name (mmlu:mc::olmes) or as a
JSON task config ('{"task_name": "gsm8k", "num_shots": 8, ...}'). The result folder is named after
the part before the first : or after task_name.
Defaults follow the original pipeline: batch size 64 for gsm8k_pre and 128 for all other tasks, max length 4096.
Batch size only affects speed, apart from tiny numerical differences.
The HumanEval tasks execute the generated code locally in subprocesses, so run them only in a sandboxed or
disposable environment.
For mixed routes, the model directory holds the "high" weights as model.safetensors and the replacement
projections for the listed loops as 2bit_model.quant (a safetensors file with HF parameter names,
e.g. model.layers.0.mlp.down_proj.weight). The file name is just the default of --quant-file.
Verification
A fresh venv was built from requirements.txt (--no-deps), patched with apply_patches.sh, and used to
re-evaluate two models whose scores came from the original pipeline (GSM8k pretrained, 1 x 80 GB GPU):
| Model | Original pipeline | This bundle | Identical generations |
|---|---|---|---|
| Ouro-1.4B, W2 on all 4 loops | 122/1319 (9.25%) | 122/1319 (9.25%) | 1217/1319 |
| Ouro-1.4B, route 2-4-4-4 (loop 0 swapped to W2) | 880/1319 (66.72%) | 878/1319 (66.57%) | 1256/1319 |
The few differing generations come from non-deterministic GPU kernels in long greedy generations. Scores differ by up to 2 questions (about ยฑ0.2 points).
Notes
- Needs Python 3.10 development headers. Triton/vLLM compile small C stubs at runtime and need
Python.h. If they are not installed system-wide (e.g. nopython3.10-dev), pointPYTHON_INCLUDEat a directory containing them:PYTHON_INCLUDE=/path/to/include/python3.10 ./run_gsm8k.sh ....CUDA_HOMEdefaults to the CUDA 13 toolkit wheel inside the venv (site-packages/nvidia/cu13). - Environment set by
run_gsm8k.sh:VLLM_USE_DEEP_GEMM=0,VLLM_USE_FLASHINFER_SAMPLER=0,VLLM_WORKER_MULTIPROC_METHOD=spawn. - The patched
ouro.pyreplaces the stock one for every Ouro model served from this environment. - The reported numbers were run on a single 80 GB or 141 GB GPU. Runs on different GPU types or batch sizes can differ by a few questions (see Verification).
- Only the
pretrainedGSM8k setting was used for the released results and was verified above. Thedevset and the extra tasks pass straight through to OLMES at the pinned commit, but were not re-run in this environment.
Model tree for ParetoQaft/looped-eval-ouro
Base model
ByteDance/Ouro-1.4B