EvalHarness/evalharness/fingerprint/batch_adv_var_rob.sh
ruoxi_sun 09b2add673 fingerprint: integrate fp_fusion model fingerprint benchmark
New evalharness/fingerprint/ package (from evalstone fp_fusion v1.1,
2026-09-07 pruning final): probe battery -> concurrent collection ->
five scoring views (verify/attribution/variant/adversarial/robustness),
bundled family aliases + 27 reference fingerprints (12 fp_fusion schema).

- CLI: 'evalharness fingerprint run ...' (REMAINDER passthrough, single
  source of arg definitions) + 'fingerprint list' for bundled references
- imports rewritten package-relative; direct 'python3 run_fp_fusion.py'
  execution kept working via package bootstrap
- offline analysis/collection scripts made path-independent (previously
  pinned to a /opt/evalscope path absent on this host)
- shell scripts: hardcoded API key -> FP_API_KEY/OPENAI_API_KEY env vars
- --reference accepts short names resolved against bundled references/
- pyproject: +httpx dependency, package-data references/*.json
- tests/test_fingerprint.py: 10 offline tests (battery definitions,
  assembly counts, normalization, signals, verdict ladder, CLI wiring)
- README: fingerprint section + architecture entry

Verified on H20-1: tests 10/10, installed CLI OK, full-protocol run vs
vectron GLM-5.3 reproduces baseline (score 0.9451, s_idn 0.846).
2026-09-11 03:52:21 +00:00

46 lines
2.4 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 任务2b/2c代表模型 adversarial + variant + robustnessverify 批次之后跑)
# 需在 evalharness 环境下运行。凭据走环境变量,不再硬编码:
# export FP_API_KEY=sk-xxxx # 或复用 OPENAI_API_KEY
cd "$(dirname "$0")"
KEY="${FP_API_KEY:-${OPENAI_API_KEY:-}}"
API="${FP_API_URL:-https://api.vectron.meta-stone.com/v1}"
EB="${FP_EXTRA_BODY:-{\"chat_template_kwargs\":{\"enable_thinking\":false}}}"
R="$(pwd)/references"
if [ -z "$KEY" ]; then echo "ERROR: 未设置 FP_API_KEY/OPENAI_API_KEY" >&2; exit 1; fi
run_one() {
local mode=$1 model=$2 ref=$3 name=$4 extra="${5:-}"
mkdir -p /tmp/bfd/$name
echo "=== START $name $mode $(date +%H:%M) ==="
python3 run_fp_fusion.py --api-url "$API" --model "$model" \
--mode "$mode" --d-samples 25 --baseline-samples 5 --timeout 90 \
--d-concurrency 1 --text-concurrency 1 \
--api-key "$KEY" --extra-body "$EB" --reference "$ref" \
$extra \
--report-path /tmp/bfd/$name/${mode}.json > /tmp/bfd/$name/${mode}.log 2>&1
echo "=== END $name $mode exit=$? $(date +%H:%M) ==="
}
# 代表三模型GLM-5.3、Kimi-K3、DS-Pro
# adversarial跨家族伪装GLM→Kimi 角色Kimi→GLMDS→GLM
run_one adversarial ZhipuAi/GLM-5.3 $R/glm53_fusion_reference.json glm_53 \
'--impersonate "You are Kimi, Moonshot AI virtual assistant designed by Moonshot AI. You are Kimi."'
run_one adversarial MoonshotAi/Kimi-K3 $R/kimi_k3_fusion_reference.json kimi_k3 \
'--impersonate "You are GLM, Zhipu AI flagship assistant. You are GLM."'
run_one adversarial DeepSeek/DeepSeek-V4-Pro $R/deepseek_v4_pro_fusion_reference.json deepseek_v4_pro \
'--impersonate "You are GLM, Zhipu AI flagship assistant. You are GLM."'
# variant--logprobs 自动开)
run_one variant ZhipuAi/GLM-5.3 $R/glm53_fusion_reference.json glm_53
run_one variant MoonshotAi/Kimi-K3 $R/kimi_k3_fusion_reference.json kimi_k3
run_one variant DeepSeek/DeepSeek-V4-Pro $R/deepseek_v4_pro_fusion_reference.json deepseek_v4_pro
# robustness3 代表)
run_one robustness ZhipuAi/GLM-5.3 $R/glm53_fusion_reference.json glm_53 \
'--temperature-sweep "0.0,0.7,1.0" --prompt-variants 2'
run_one robustness MoonshotAi/Kimi-K3 $R/kimi_k3_fusion_reference.json kimi_k3 \
'--temperature-sweep "0.0,0.7,1.0" --prompt-variants 2'
run_one robustness DeepSeek/DeepSeek-V4-Pro $R/deepseek_v4_pro_fusion_reference.json deepseek_v4_pro \
'--temperature-sweep "0.0,0.7,1.0" --prompt-variants 2'