diff --git a/evals/aligners/rumblex/config.yaml b/evals/aligners/rumblex/config.yaml index 936a1c6..e5a4e13 100644 --- a/evals/aligners/rumblex/config.yaml +++ b/evals/aligners/rumblex/config.yaml @@ -14,4 +14,8 @@ emits_confidence: true params: venv: venv model: Reson8/Rumble-2-Flash + # The model commit the published row was measured on. rumblex has no + # revision argument, so the worker resolves this snapshot itself. Keep it + # equal to REVISION in download_and_install.sh, and re-run the sweep on a bump. + revision: 95bd5f9133a2398e5e48a98c089fe48e122bde97 device: cuda diff --git a/evals/aligners/rumblex/download_and_install.sh b/evals/aligners/rumblex/download_and_install.sh index a2a948a..612c15e 100755 --- a/evals/aligners/rumblex/download_and_install.sh +++ b/evals/aligners/rumblex/download_and_install.sh @@ -20,6 +20,9 @@ set -euo pipefail HERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) MODEL=${MODEL:-Reson8/Rumble-2-Flash} +# MODEL COMMIT PINNED, the one the published row was measured on. Keep it equal +# to params.revision in config.yaml. Bump deliberately + re-run the sweep. +REVISION=${REVISION:-95bd5f9133a2398e5e48a98c089fe48e122bde97} # Re-runnable: reuse a venv that already has an interpreter. [ -x "$HERE/venv/bin/python" ] || uv venv "$HERE/venv" --python 3.12 @@ -36,11 +39,17 @@ uv pip install --python "$HERE/venv/bin/python" rumblex==0.6.0 # uv venvs have no pip of their own; ask uv, not the venv. uv pip freeze --python "$HERE/venv/bin/python" > "$HERE/requirements.lock" +# The whole snapshot, not only what load_model reads: rumblex fetches +# ctc/ctc_head.safetensors on the first align, which an offline sweep cannot do. "$HERE/venv/bin/python" - < tuple[np.ndarray, int]: def main(argv: list[str]) -> int: jobs_path, model_id = argv[0], argv[1] device = argv[2] if len(argv) > 2 else "cuda" + revision = argv[3] if len(argv) > 3 else None import rumblex import torch + # rumblex takes a repo id or a local folder and has no revision argument, + # so a pinned commit is resolved to its snapshot folder here. That folder + # holds ctc/ as well, and with HF_HUB_OFFLINE=1 it comes from the cache. + if revision and not os.path.isdir(model_id): + from huggingface_hub import snapshot_download + model_id = snapshot_download(model_id, revision=revision) + # startswith, as in the other workers: the cell runners pass "cuda:0". device = device if (device.startswith("cuda") and torch.cuda.is_available()) else "cpu" diff --git a/fabench/aligners/rumblex/README.md b/fabench/aligners/rumblex/README.md index 22af0a5..8b92d76 100644 --- a/fabench/aligners/rumblex/README.md +++ b/fabench/aligners/rumblex/README.md @@ -21,6 +21,9 @@ CTC probability among a word's tokens. evals/aligners/rumblex/download_and_install.sh # its own venv, pinned ``` +The script fetches the whole model snapshot at the pinned commit, CTC head +included, so the sweep can run with `HF_HUB_OFFLINE=1` afterwards. + ## Config ```yaml @@ -29,5 +32,7 @@ evals/aligners/rumblex/download_and_install.sh # its own venv, pinned enabled: true modes: [A] granularity: [word] - params: { model: Reson8/Rumble-2-Flash, device: cuda } + params: { model: Reson8/Rumble-2-Flash, revision: 95bd5f9133a2398e5e48a98c089fe48e122bde97, device: cuda } ``` + +`revision` is the model commit. Without it the worker loads the repo's latest. diff --git a/fabench/aligners/rumblex/adapter.py b/fabench/aligners/rumblex/adapter.py index e6d3a27..5688737 100644 --- a/fabench/aligners/rumblex/adapter.py +++ b/fabench/aligners/rumblex/adapter.py @@ -27,5 +27,9 @@ class Rumblex(SubprocessAligner): default_model = "Reson8/Rumble-2-Flash" def _extra_argv(self) -> list[str]: - """worker.py .""" - return [str(self.params.get("device", "cuda"))] + """worker.py [revision].""" + argv = [str(self.params.get("device", "cuda"))] + revision = self.params.get("revision") + if revision: + argv.append(str(revision)) + return argv