File size: 2,915 Bytes
158258b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# Reproduce upstream's published baseline scores, to check this runner's evaluation path against
# the official one before spending GPU-days on agent runs.
#
# Targets come from third_party/PostTrainBench/scripts/baselines.json ("zeroshot"). The cells below
# are chosen to exercise every benchmark's own code path with a non-zero, discriminating target:
# gsm8k/humaneval use the 3000-token generation budget, gpqamain/aime2025 the 12000-token one, and
# bfcl the tool-calling harness.
#
#   bash scripts/ptb_validate_baselines.sh          # submit
#   bash scripts/ptb_validate_baselines.sh --check  # compare finished runs against baselines.json
set -euo pipefail
cd /home/jiaruiliu/local/git-repos/auto-impl

OUT_ROOT="${OUT_ROOT:-/home/jiaruiliu/ptb-data/baseline_validation}"

# task model expected
CELLS=(
    "gsm8k     Qwen/Qwen3-1.7B-Base           0.1266"
    "gsm8k     Qwen/Qwen3-4B-Base             0.4185"
    "humaneval Qwen/Qwen3-4B-Base             0.3659"
    "gpqamain  Qwen/Qwen3-1.7B-Base           0.1406"
    "aime2025  Qwen/Qwen3-4B-Base             0.0333"
    "bfcl      google/gemma-3-4b-pt           0.0600"
)

if [[ "${1:-}" == "--check" ]]; then
    # Judge by |delta| against the run's own stderr, not a fixed tolerance: inspect_ai samples with
    # the model's HF generation config rather than greedily, so repeating an eval moves the score.
    # On aime2025 (30 questions) a single problem is already 0.033, which is why a fixed band
    # flagged runs that are in fact indistinguishable from upstream's.
    printf "%-10s %-30s %8s %8s %9s %9s %7s  %s\n" TASK MODEL EXPECTED ACTUAL STDERR DELTA "|d|/se" VERDICT
    for cell in "${CELLS[@]}"; do
        read -r task model expected <<< "$cell"
        out="$OUT_ROOT/${task}_$(echo "$model" | tr '/' '_')"
        python3 -c "
import json, math, os
p = '$out/metrics.json'
if not os.path.exists(p):
    print(f'{\"$task\":<10} {\"$model\":<30} {$expected:8.4f} {\"-\":>8} {\"-\":>9} {\"-\":>9} {\"-\":>7}  pending')
else:
    d = json.load(open(p)); a = d.get('accuracy', d.get('score')); se = d.get('stderr')
    if se:
        z = abs(a - $expected) / se
        v = 'consistent' if z < 2 else ('suspect' if z < 3 else 'DIVERGENT')
        print(f'{\"$task\":<10} {\"$model\":<30} {$expected:8.4f} {a:8.4f} {se:9.4f} {a-$expected:+9.4f} {z:7.2f}  {v}')
    else:
        print(f'{\"$task\":<10} {\"$model\":<30} {$expected:8.4f} {a:8.4f} {\"n/a\":>9} {a-$expected:+9.4f} {\"n/a\":>7}  (no stderr)')
"
    done
    exit 0
fi

for cell in "${CELLS[@]}"; do
    read -r task model expected <<< "$cell"
    out="$OUT_ROOT/${task}_$(echo "$model" | tr '/' '_')"
    echo "submitting $task $model (expect $expected)"
    sbatch --job-name="ptbval-${task}" \
        ${DEPENDENCY:+--dependency="$DEPENDENCY"} \
        --export="ALL,TASK=${task},MODEL=${model},LIMIT=-1,OUT=${out}" \
        scripts/ptb_eval.sbatch
done