Update upload_clawbenchpro_base100_hard100_npu/v14/0708_new/score_clawbenchpro.sh
Browse files
upload_clawbenchpro_base100_hard100_npu/v14/0708_new/score_clawbenchpro.sh
CHANGED
|
@@ -62,11 +62,53 @@ fi
|
|
| 62 |
|
| 63 |
mkdir -p "${SCORE_OUTPUT_ROOT}" "$(dirname "${JUDGE_LOG}")"
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
# 默认与训练/推理一样完整安装 GCC、CANN、torch-npu、vLLM-Ascend、Triton、
|
| 66 |
# VERL 和 verifier 依赖。使用 source,确保导出的动态库和 Python 路径对 Judge 生效。
|
| 67 |
source "${BUNDLE_ROOT}/scripts/setup_full_npu_environment.sh"
|
| 68 |
cd "${BUNDLE_ROOT}"
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
judge_pid=""
|
| 71 |
cleanup() {
|
| 72 |
exit_code=$?
|
|
|
|
| 62 |
|
| 63 |
mkdir -p "${SCORE_OUTPUT_ROOT}" "$(dirname "${JUDGE_LOG}")"
|
| 64 |
|
| 65 |
+
# Triton/vLLM 在 Judge 初始化 KV cache 前会通过 tempfile 创建 hivmc
|
| 66 |
+
# 探测文件。训练环境安装脚本历史上默认使用 /cache/ray_tmp,但该目录在
|
| 67 |
+
# 某些独立评分节点上不存在、不可写或已耗尽配额。评分任务使用独立临时
|
| 68 |
+
# 目录,允许通过 JUDGE_TMPDIR 覆盖,避免把 Judge 启动失败误报成评分失败。
|
| 69 |
+
export JUDGE_TMPDIR=${JUDGE_TMPDIR:-/tmp/clawbenchpro_judge_${USER:-unknown}_$$}
|
| 70 |
+
if [ -z "${TMPDIR:-}" ]; then
|
| 71 |
+
export TMPDIR="${JUDGE_TMPDIR}"
|
| 72 |
+
fi
|
| 73 |
+
if ! mkdir -p "${TMPDIR}" 2>/dev/null || [ ! -d "${TMPDIR}" ] || [ ! -w "${TMPDIR}" ]; then
|
| 74 |
+
echo "WARNING: configured TMPDIR is unavailable: ${TMPDIR}; falling back to ${JUDGE_TMPDIR}" >&2
|
| 75 |
+
export TMPDIR="${JUDGE_TMPDIR}"
|
| 76 |
+
mkdir -p "${TMPDIR}"
|
| 77 |
+
fi
|
| 78 |
+
if [ ! -d "${TMPDIR}" ] || [ ! -w "${TMPDIR}" ]; then
|
| 79 |
+
echo "ERROR: Judge temporary directory is not writable: ${TMPDIR}" >&2
|
| 80 |
+
df -h "$(dirname "${TMPDIR}")" >&2 || true
|
| 81 |
+
df -i "$(dirname "${TMPDIR}")" >&2 || true
|
| 82 |
+
exit 2
|
| 83 |
+
fi
|
| 84 |
+
export TEMP="${TMPDIR}"
|
| 85 |
+
export TMP="${TMPDIR}"
|
| 86 |
+
echo "Judge temporary directory: ${TMPDIR}"
|
| 87 |
+
|
| 88 |
# 默认与训练/推理一样完整安装 GCC、CANN、torch-npu、vLLM-Ascend、Triton、
|
| 89 |
# VERL 和 verifier 依赖。使用 source,确保导出的动态库和 Python 路径对 Judge 生效。
|
| 90 |
source "${BUNDLE_ROOT}/scripts/setup_full_npu_environment.sh"
|
| 91 |
cd "${BUNDLE_ROOT}"
|
| 92 |
|
| 93 |
+
# Probe the same Python tempfile path used by Triton before launching all TP
|
| 94 |
+
# workers. This produces a short actionable error instead of a long vLLM
|
| 95 |
+
# multiprocess traceback.
|
| 96 |
+
python3 - "${TMPDIR}" <<'PY'
|
| 97 |
+
import shutil
|
| 98 |
+
import sys
|
| 99 |
+
import tempfile
|
| 100 |
+
from pathlib import Path
|
| 101 |
+
|
| 102 |
+
tmpdir = Path(sys.argv[1])
|
| 103 |
+
try:
|
| 104 |
+
probe = Path(tempfile.mkdtemp(prefix="clawbenchpro_probe_", dir=str(tmpdir)))
|
| 105 |
+
(probe / "probe").write_text("ok", encoding="utf-8")
|
| 106 |
+
shutil.rmtree(probe)
|
| 107 |
+
except Exception as exc:
|
| 108 |
+
print(f"ERROR: Python/Triton temporary-file probe failed in {tmpdir}: {type(exc).__name__}: {exc}", file=sys.stderr)
|
| 109 |
+
raise SystemExit(2)
|
| 110 |
+
PY
|
| 111 |
+
|
| 112 |
judge_pid=""
|
| 113 |
cleanup() {
|
| 114 |
exit_code=$?
|