Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BenchCheck-Pool: full-item-pool screening, steps 1-3 (run package)
|
| 2 |
+
|
| 3 |
+
This package lets an agent on a separate GPU machine run the three model-based screening steps of the
|
| 4 |
+
BenchCheck full-item pool and send the per-item results back. Everything needed is here except the
|
| 5 |
+
two open-weight models (downloaded from the Hugging Face hub) and the frame cache, which sits in the
|
| 6 |
+
companion dataset `GMLRVigil/BenchCheck-Pool-Frames` (public).
|
| 7 |
+
|
| 8 |
+
Produce: `results/pool/step1/*.jsonl`, `results/pool/step2/*.jsonl`, `results/pool/step3/*.jsonl`
|
| 9 |
+
(one row per item, append-only, resumable), packed and uploaded as described in section 8.
|
| 10 |
+
|
| 11 |
+
## 1. What the three steps do (do not change any of it)
|
| 12 |
+
|
| 13 |
+
Items: multiple-choice questions of 139 video benchmarks (299,366 after the step-0 dedup, table in
|
| 14 |
+
`items/`). Each step asks a Qwen3-VL model the question and reads the log-probability of every option
|
| 15 |
+
letter as the first generated token (assistant turn prefilled with `Answer:`, `max_tokens=1`,
|
| 16 |
+
`logprobs=true`, `top_logprobs=20`). An item leaves the pool when the model is right with a margin
|
| 17 |
+
above log 2:
|
| 18 |
+
|
| 19 |
+
| step | model | input | removal rule |
|
| 20 |
+
|---|---|---|---|
|
| 21 |
+
| 1 blind | Qwen3-VL-8B-Instruct | question + options, no frames, 4 option permutations per item | ≥ 3 of 4 permutations pick the gold letter and mean margin > log 2 |
|
| 22 |
+
| 2 single frame | Qwen3-VL-8B-Instruct | the middle frame (448 px long side) + question | gold letter is argmax and margin > log 2 |
|
| 23 |
+
| 3 32 frames | Qwen3-VL-2B-Instruct | 32 uniform frames (448 px) + question | same |
|
| 24 |
+
|
| 25 |
+
Step 2 runs only on items that survived step 1 and have frames; step 3 only on survivors of step 2.
|
| 26 |
+
Prompts, permutation seeds, frame selection, resolution, model revisions and the margin rule are
|
| 27 |
+
fixed in the code (`code/exp/analysis/pool/pool_steps.py`, `pool_common.py`, `pool_prompts.py`); the
|
| 28 |
+
paper protocol depends on them, so run the code as is. `code/exp/analysis/pool/TASK.md` is the
|
| 29 |
+
original task note (Chinese).
|
| 30 |
+
|
| 31 |
+
## 2. Hardware and software
|
| 32 |
+
|
| 33 |
+
Tested target: 4x RTX 5090 (32 GB each). Per GPU one vLLM server and one client shard.
|
| 34 |
+
VRAM: Qwen3-VL-8B bf16 weights ~16.4 GB, Qwen3-VL-2B ~4.4 GB; the launcher uses
|
| 35 |
+
`--gpu-memory-utilization 0.85`. If vLLM fails with out-of-memory at start-up, lower `MAX_SEQS`
|
| 36 |
+
in `code/run_remote.sh` (e.g. 64 -> 32 for step 1); do not lower the resolution or the frame count.
|
| 37 |
+
|
| 38 |
+
```bash
|
| 39 |
+
# Python 3.12 environment
|
| 40 |
+
python3 -m venv pool-env && source pool-env/bin/activate
|
| 41 |
+
pip install -r code/requirements.txt # vllm 0.11.0 + torch 2.8 (CUDA 12.8 wheels; sm_120 for RTX 5090)
|
| 42 |
+
pip install -U "huggingface_hub[cli]"
|
| 43 |
+
# models (pinned revisions; served under their hub names)
|
| 44 |
+
huggingface-cli download Qwen/Qwen3-VL-8B-Instruct --revision 0c351dd01ed87e9c1b53cbc748cba10e6187ff3b
|
| 45 |
+
huggingface-cli download Qwen/Qwen3-VL-2B-Instruct --revision 89644892e4d85e24eaac8bacfd4f463576704203
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
Disk: items 80 MB, frames ~35 GB unpacked (+35 GB for the tar shards until you delete them),
|
| 49 |
+
results < 2 GB, model weights ~21 GB.
|
| 50 |
+
|
| 51 |
+
## 3. Get the data
|
| 52 |
+
|
| 53 |
+
```bash
|
| 54 |
+
huggingface-cli download GMLRVigil/BenchCheck-Pool --repo-type dataset --local-dir pool
|
| 55 |
+
cd pool
|
| 56 |
+
mkdir -p results/pool && cp items/*.parquet items/*.csv items/*.jsonl results/pool/
|
| 57 |
+
# frames (public repo)
|
| 58 |
+
huggingface-cli download GMLRVigil/BenchCheck-Pool-Frames --repo-type dataset --local-dir frames_tar
|
| 59 |
+
python3 - <<'PY'
|
| 60 |
+
import json, hashlib, sys
|
| 61 |
+
m = json.load(open("frames_tar/frames_manifest.json"))
|
| 62 |
+
for s in m["shards"]:
|
| 63 |
+
h = hashlib.sha256(open("frames_tar/" + s["file"], "rb").read()).hexdigest()
|
| 64 |
+
print(s["file"], "OK" if h == s["sha256"] else "SHA256 MISMATCH"); assert h == s["sha256"]
|
| 65 |
+
PY
|
| 66 |
+
mkdir -p frames/pool_frames && for t in frames_tar/frames_*.tar; do tar -xf "$t" -C frames/pool_frames; done
|
| 67 |
+
ls frames/pool_frames | wc -l # expect the n_videos value of frames_tar/frames_manifest.json (67,021)
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
After this the package root `pool/` holds `code/`, `items/`, `results/pool/`, `frames/pool_frames/`.
|
| 71 |
+
|
| 72 |
+
## 4. Run
|
| 73 |
+
|
| 74 |
+
`code/run_remote.sh` starts one vLLM server per GPU (ports 8001+i), waits until they answer, runs one
|
| 75 |
+
client shard per GPU, then prints the remaining work. Run the steps in order; each command can be
|
| 76 |
+
re-run at any time and continues where it stopped (rows are keyed by item_id).
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
cd pool
|
| 80 |
+
STEP=1 bash code/run_remote.sh --plan-only # 299,366 items expected before the first run
|
| 81 |
+
STEP=1 bash code/run_remote.sh # ~1.5-2 h on 4x 5090 (estimate)
|
| 82 |
+
STEP=2 bash code/run_remote.sh --plan-only # survivors of step 1 that have frames (upper bound 183,196)
|
| 83 |
+
STEP=2 bash code/run_remote.sh # ~1.5-2.5 h (estimate)
|
| 84 |
+
STEP=3 bash code/run_remote.sh --plan-only
|
| 85 |
+
STEP=3 bash code/run_remote.sh # ~2-4 h (estimate); 2B model, 32 images per request
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
Environment variables the launcher accepts: `NGPU` (default: all visible GPUs), `WORKERS` (client
|
| 89 |
+
threads per GPU; defaults 32 / 16 / 8 for steps 1 / 2 / 3), `PORT0`, `GPU_UTIL`, `PY`, `VLLM`.
|
| 90 |
+
Logs: `logs/vllm_s<STEP>_gpu<i>.log`, `logs/client_s<STEP>_gpu<i>.log`.
|
| 91 |
+
|
| 92 |
+
The time estimates come from throughput on the origin cluster's smaller GPU slices and were not
|
| 93 |
+
measured on a 5090; step 1 calibrates them (its client log prints items/s).
|
| 94 |
+
|
| 95 |
+
## 5. Progress and expected counts
|
| 96 |
+
|
| 97 |
+
`STEP=N bash code/run_remote.sh --plan-only` prints `REMAINING_TOTAL=<n>`; a step is complete when it
|
| 98 |
+
prints 0. Step 1 covers 299,366 items = 1,197,464 forwards. Of these items, 183,196 (67,021 videos)
|
| 99 |
+
have frames in this snapshot; the other 116,170 items reference videos that were not yet downloaded on
|
| 100 |
+
the origin cluster (video_id starting with `k:`), so steps 2 and 3 skip them here. They will be finished
|
| 101 |
+
on the origin cluster; nothing to do about them on your side.
|
| 102 |
+
|
| 103 |
+
Sanity checks:
|
| 104 |
+
- Step 1 removes a minority of items per benchmark (blind removal on the 300-item samples was mostly
|
| 105 |
+
20-60 %); a benchmark with ~100 % removal or ~0 % removal deserves a look at its client log.
|
| 106 |
+
- Every step-1 item has 4 permutation forwards (`n_perm` / per-permutation fields in the row).
|
| 107 |
+
- Rows with `status != "ok"` are retried automatically up to the limit in the code; a few hundred
|
| 108 |
+
permanent errors in a million forwards is normal, thousands is not (check the vLLM log for OOM).
|
| 109 |
+
|
| 110 |
+
## 6. Files that must not be edited
|
| 111 |
+
|
| 112 |
+
`code/exp/analysis/pool/*.py` (protocol), `items/*` (inputs). The launcher `code/run_remote.sh` may be
|
| 113 |
+
adapted to the machine (ports, GPU count, paths) but not the vLLM model arguments other than
|
| 114 |
+
`--max-num-seqs` and `--gpu-memory-utilization`.
|
| 115 |
+
|
| 116 |
+
## 7. Known limits
|
| 117 |
+
|
| 118 |
+
- vLLM 0.11.0 needs the CUDA 12.8 torch 2.8 wheels for RTX 5090 (sm_120). If `pip install vllm==0.11.0`
|
| 119 |
+
pulls a torch without sm_120 support, install torch 2.8.0 from the cu128 index first.
|
| 120 |
+
- `--max-logprobs 20` and `continue_final_message` are vLLM features; the client will not work against
|
| 121 |
+
other serving stacks.
|
| 122 |
+
- The frame cache is a snapshot; missing directories for some `video_id` values are expected (see 5).
|
| 123 |
+
|
| 124 |
+
## 8. Return the results
|
| 125 |
+
|
| 126 |
+
```bash
|
| 127 |
+
cd pool
|
| 128 |
+
tar -czf pool_returns_$(hostname)_$(date +%Y%m%d).tar.gz results/pool/step1 results/pool/step2 results/pool/step3 logs
|
| 129 |
+
sha256sum pool_returns_*.tar.gz > pool_returns.sha256
|
| 130 |
+
# with a write token for GMLRVigil:
|
| 131 |
+
huggingface-cli upload GMLRVigil/BenchCheck-Pool pool_returns_$(hostname)_$(date +%Y%m%d).tar.gz returns/pool_returns_$(hostname)_$(date +%Y%m%d).tar.gz --repo-type dataset
|
| 132 |
+
huggingface-cli upload GMLRVigil/BenchCheck-Pool pool_returns.sha256 returns/pool_returns_$(hostname)_$(date +%Y%m%d).sha256 --repo-type dataset
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
If you have no write token, send the tarball and its sha256 by any file transfer. In the report,
|
| 136 |
+
state per step: items done, items removed, rows with status error (count and example item_ids),
|
| 137 |
+
wall time and items/s per GPU, and anything you changed in `run_remote.sh`.
|