Upload job_entry.sh with huggingface_hub
Browse files- job_entry.sh +49 -0
job_entry.sh
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# Job entry script for HF Jobs. Runs inside the container.
|
| 3 |
+
# /workspace is the read-only mount of the paper directory (contains repro.py + JustGRPO/).
|
| 4 |
+
set -e
|
| 5 |
+
echo "=== Job started ==="
|
| 6 |
+
nvidia-smi --query-gpu=name,memory.total --format=csv 2>/dev/null || echo "no nvidia-smi"
|
| 7 |
+
echo "Python: $(python --version)"
|
| 8 |
+
|
| 9 |
+
cd /workspace
|
| 10 |
+
|
| 11 |
+
echo "=== Installing dependencies ==="
|
| 12 |
+
pip install --no-input --quiet \
|
| 13 |
+
"transformers==4.51.3" "datasets==3.1.0" "peft==0.17.1" \
|
| 14 |
+
accelerate sympy regex word2number antlr4-python3-runtime latex2sympy2 \
|
| 15 |
+
huggingface_hub numpy 2>&1 | tail -3
|
| 16 |
+
echo "=== Deps installed ==="
|
| 17 |
+
|
| 18 |
+
export HF_HUB_ENABLE_HF_TRANSFER=0
|
| 19 |
+
export TOKENIZERS_PARALLELISM=false
|
| 20 |
+
|
| 21 |
+
echo "=== Smoke test: imports ==="
|
| 22 |
+
python -c "
|
| 23 |
+
import sys; sys.path.insert(0,'JustGRPO')
|
| 24 |
+
import torch
|
| 25 |
+
print('torch', torch.__version__, 'cuda', torch.cuda.is_available(), torch.cuda.get_device_name(0) if torch.cuda.is_available() else '')
|
| 26 |
+
from utils.generate import generate
|
| 27 |
+
from utils.grader import math_equal
|
| 28 |
+
from utils.code_exec import evaluate_functional_correctness
|
| 29 |
+
print('imports OK; math_equal test:', math_equal('42','42'))
|
| 30 |
+
" 2>&1 | tail -10
|
| 31 |
+
|
| 32 |
+
echo "=== Running repro (C1+C2+C3) ==="
|
| 33 |
+
# Budget-safe subsets on A100:
|
| 34 |
+
# C1: GSM8K 200 ex (parallel block_length=32) ~ the 89.1% headline
|
| 35 |
+
# C2a: GSM8K 100 ex AR mode (block_length=1) ~ parallel-decoding retained
|
| 36 |
+
# C2b: MATH-500 100 ex ~ math reasoning
|
| 37 |
+
# C2c: HumanEval 80 ex ~ coding reasoning
|
| 38 |
+
# C3: Pass@k 20 problems, k=4, AR vs AO ~ solution coverage collapse
|
| 39 |
+
python repro.py --claim all \
|
| 40 |
+
--ckpt_path nzl-thu/LLaDA-Instruct-JustGRPO-GSM8K \
|
| 41 |
+
--math500_ckpt nzl-thu/LLaDA-Instruct-JustGRPO-Math500 \
|
| 42 |
+
--code_ckpt nzl-thu/LLaDA-Instruct-JustGRPO-Code \
|
| 43 |
+
--base_ckpt GSAI-ML/LLaDA-8B-Instruct \
|
| 44 |
+
--gen_length 256 --steps 256 --block_length 32 \
|
| 45 |
+
--max_examples 200 \
|
| 46 |
+
--k 4 --n_problems 20 --temperature 0.7 \
|
| 47 |
+
--output /tmp/results 2>&1
|
| 48 |
+
|
| 49 |
+
echo "=== Job finished ==="
|