Something went wrong. Try again.
The fastest decode and prefill for 4-bit Qwen3.8-27B on one RTX 3090 that preserves the model's intelligence
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127#!/usr/bin/env bash# Install the locked upstream evaluator; never call a model endpoint.set -euo pipefailunset PYTHONPATH PYTHONHOME
root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd -P)# shellcheck source=eval/prime-envs.locksource "$root/prime-envs.lock"mode=${1:-sync}if [[ $# -gt 1 || "$mode" != sync && "$mode" != --sources-only && "$mode" != --check-sources && "$mode" != --check ]]; then printf 'Usage: %s [--sources-only|--check-sources|--check]\n' "$0" >&2 exit 2fiif [[ ! "$PRIME_ENVS_REVISION" =~ ^[0-9a-f]{40}$ || ! "$VERIFIERS_REVISION" =~ ^[0-9a-f]{40}$ || ! "$VERIFIERS_TAG_REVISION" =~ ^[0-9a-f]{40}$ ]]; then printf 'Invalid source lock identities.\n' >&2 exit 2fiif [[ -L "$root/.sources" ]]; then printf 'Refusing symlinked source directory.\n' >&2 exit 2fiif [[ "$mode" != --check-sources && "$mode" != --check ]]; then mkdir -p -- "$root/.sources"fi
checkout() { local name=$1 repository=$2 revision=$3 tag=$4 tag_revision=$5 local destination="$root/.sources/$name" if [[ ! -e "$destination" && ! -L "$destination" && "$mode" != --check-sources && "$mode" != --check ]]; then # Exclusive ownership: a failed fetch leaves a visible partial checkout. mkdir -- "$destination" git -C "$destination" init --quiet git -C "$destination" remote add origin "$repository" if [[ -n "$tag" ]]; then git -C "$destination" fetch origin "$revision" "refs/tags/$tag:refs/tags/$tag" else git -C "$destination" fetch --depth=1 origin "$revision" fi GIT_LFS_SKIP_SMUDGE=1 git -C "$destination" checkout --quiet --detach "$revision" fi if [[ -L "$destination" || ! -d "$destination/.git" ]]; then printf 'Missing or invalid source checkout: %s\n' "$destination" >&2 exit 2 fi if [[ "$(git -C "$destination" remote get-url origin)" != "$repository" || "$(git -C "$destination" rev-parse HEAD)" != "$revision" || -n "$(git -C "$destination" status --porcelain --untracked-files=all)" ]]; then printf 'Refusing wrong-revision, wrong-origin, or dirty source: %s\n' "$destination" >&2 exit 2 fi if [[ -n "$tag" && "$(git -C "$destination" rev-parse "refs/tags/$tag^{commit}")" != "$tag_revision" ]]; then printf 'Release tag does not match locked revision: %s\n' "$destination" >&2 exit 2 fi}
checkout prime-envs "$PRIME_ENVS_REPOSITORY" "$PRIME_ENVS_REVISION" "" ""checkout verifiers "$VERIFIERS_REPOSITORY" "$VERIFIERS_REVISION" "$VERIFIERS_TAG" "$VERIFIERS_TAG_REVISION"if [[ "$mode" == --sources-only || "$mode" == --check-sources ]]; then exit 0ficd -- "$root"if [[ "$mode" == --check ]]; then uv sync --locked --offline --check --python python3.12 --no-managed-pythonelse uv sync --locked --python python3.12 --no-managed-pythonfiuv run --locked --no-sync --python python3.12 --no-managed-python python -c 'import emailimport hashlibimport osimport sysimport tempfileimport tomllibfrom importlib.metadata import versionfrom pathlib import Path
import hatchling.buildfrom verifiers.v1.harnesses.utils.launch import CHAT_PROGRAM_SOURCE
root = Path.cwd()# uv locks the static dependency-metadata and does not compare it with the build.config = tomllib.loads((root / "pyproject.toml").read_text())["tool"]["uv"]for entry in config["dependency-metadata"]: source = root / config["sources"][entry["name"]]["path"] build = tomllib.loads((source / "pyproject.toml").read_text())["build-system"] if build["build-backend"] != "hatchling.build": raise SystemExit("Static metadata check supports only hatchling sources") with tempfile.TemporaryDirectory() as directory: os.chdir(source) info = hatchling.build.prepare_metadata_for_build_editable(directory) os.chdir(root) built = email.message_from_bytes((Path(directory) / info / "METADATA").read_bytes()) expected = (entry["version"], entry["requires-python"], entry["requires-dist"]) if (built["Version"], built["Requires-Python"], built.get_all("Requires-Dist", [])) != expected: raise SystemExit("Static dependency-metadata differs from the built metadata: " + entry["name"])if version("verifiers") != sys.argv[1]: raise SystemExit("Installed Verifiers version differs from the source lock")programs = ( ("null", CHAT_PROGRAM_SOURCE.encode(), sys.argv[2]), ( "livecodebench", (root / ".sources/prime-envs/environments/code/livecodebench/livecodebench/verify.py").read_bytes(), sys.argv[3], ),)destination = root / ".cache/runtime"if destination.is_symlink() or destination.parent.is_symlink(): raise SystemExit("Refusing symlinked runtime cache")if sys.argv[4] != "--check": destination.mkdir(parents=True, exist_ok=True)for name, source, expected in programs: digest = hashlib.sha256(source).hexdigest() if digest != expected: raise SystemExit("Upstream runtime source differs from the source lock") lock = (root / "runtime" / (name + ".py.lock")).read_bytes() artifacts = ((destination / (digest + ".py"), source), (destination / (digest + ".py.lock"), lock)) for path, data in artifacts: if path.is_symlink(): raise SystemExit("Refusing symlinked runtime artifact") if path.exists(): if path.read_bytes() != data: raise SystemExit("Existing runtime artifact differs from the lock") else: if sys.argv[4] == "--check": raise SystemExit("Missing exported runtime artifact; run setup") with path.open("xb") as stream: stream.write(data)' "$VERIFIERS_VERSION" "$CHAT_PROGRAM_SHA256" "$LIVECODEBENCH_PROGRAM_SHA256" "$mode"