czty's picture
Add files using upload-large-folder tool
ef16689 verified
|
Raw
History Blame Contribute Delete
6.51 kB

LAB-Bench Biomni 实验新手运行指南

这份说明用于运行 Biomni 在 LAB-Bench 上的实验,并且数据集设置要和 /225040511/project/Hypo_Bio_OS/experiments/lab_bench/scripts 里的 HypoBioOS 实验保持一致。

/225040511/project/Biomni/experiments/lab_bench

LAB-Bench 数据和代码默认位于:

/225040511/project/LAB-Bench

1. 进入 Biomni 项目

cd /225040511/project/Biomni

2. 本实验跑什么数据

不要跑 LAB-Bench 全量。为了和 HypoBioOS 对照实验一致,本实验只跑:

  • DbQA
  • SeqQA

默认数据设置:

  • split: test
  • dev offset: 45
  • test size: 315
  • seed: 20260514
  • shard count: 10
  • runner threads: 1

对应 HypoBioOS 脚本里的默认环境变量:

LAB_BENCH_SPLITS=test
LAB_BENCH_DEV_SIZE=45
LAB_BENCH_TEST_SIZE=315
LAB_BENCH_SUBSET_SEED=20260514
LAB_BENCH_TEST_SHARD_COUNT=10
LAB_BENCH_N_THREADS=1

Biomni 这边的 run_all_labbench_with_biomni.sh 已经改成只代理 DbQA + SeqQA 子集,不会启动 LAB-Bench 全量 eval。

3. 挂 DeepSeek 后端

推荐把 DeepSeek key 写到 Biomni 项目根目录的 .env

cat > /225040511/project/Biomni/.env <<'EOF'
DEEPSEEK_API_KEY=你的 DeepSeek API Key
DEEPSEEK_MODEL_NAME=deepseek-chat
DEEPSEEK_BASE_URL=https://api.deepseek.com/v1
EOF

也可以只在当前 shell 里临时设置:

export DEEPSEEK_API_KEY="你的 DeepSeek API Key"
export DEEPSEEK_MODEL_NAME="deepseek-chat"
export DEEPSEEK_BASE_URL="https://api.deepseek.com/v1"

实验脚本会自动把 DeepSeek 变量转换成 Biomni 需要的 Custom provider 配置:

BIOMNI_SOURCE=Custom
BIOMNI_LLM=$DEEPSEEK_MODEL_NAME
BIOMNI_CUSTOM_BASE_URL=$DEEPSEEK_BASE_URL
BIOMNI_CUSTOM_API_KEY=$DEEPSEEK_API_KEY

可以用下面命令确认 key 是否已设置,不会打印 key 内容:

for k in DEEPSEEK_API_KEY BIOMNI_CUSTOM_API_KEY BIOMNI_SOURCE BIOMNI_LLM BIOMNI_CUSTOM_BASE_URL; do
  if [ -n "${!k:-}" ]; then echo "$k=set"; else echo "$k=unset"; fi
done

如果你把 key 写进 .env,上面的检查命令在手动 source .env 之前可能显示 unset,这是正常的;运行脚本时会自动读取 /225040511/project/Biomni/.env/225040511/project/LAB-Bench/.env

4. Python 环境

默认使用:

/225040511/miniconda3/envs/biomni_e1/bin/python

如果要换 Python,可以设置:

export LAB_BENCH_RUNNER_PYTHON=/path/to/python

5. 快速跑一个小样本

先用 debug 模式验证 DeepSeek、Biomni 和 LAB-Bench 都能跑通:

/225040511/miniconda3/envs/biomni_e1/bin/python \
  experiments/lab_bench/run_labbench_with_biomni.py \
  --eval DbQA \
  --split test \
  --debug \
  --output experiments/lab_bench/results/debug_dbqa.json

成功后会生成:

experiments/lab_bench/results/debug_dbqa.json

6. 正式运行 DbQA 和 SeqQA

推荐使用分片脚本。它们默认后台运行、默认断点续跑,并把结果追加到 JSONL。

同时跑 DbQA + SeqQA:

export LAB_BENCH_SPLITS=test
export LAB_BENCH_DEV_SIZE=45
export LAB_BENCH_TEST_SIZE=315
export LAB_BENCH_SUBSET_SEED=20260514
export LAB_BENCH_TEST_SHARD_COUNT=10
experiments/lab_bench/run_dbqa_seqqa_biomni_experiment.sh --background --resume

只跑 DbQA:

experiments/lab_bench/run_dbqa_biomni_experiment.sh --background --resume

只跑 SeqQA:

experiments/lab_bench/run_seqqa_biomni_experiment.sh --background --resume

默认每个 eval 分成 10 个 shard 并行跑。可以调整 shard 数:

export LAB_BENCH_TEST_SHARD_COUNT=5
experiments/lab_bench/run_dbqa_seqqa_biomni_experiment.sh --background --resume

7. 前台调试

如果想直接在终端看到错误,使用前台模式:

experiments/lab_bench/run_dbqa_biomni_experiment.sh --foreground --resume

或者:

experiments/lab_bench/run_seqqa_biomni_experiment.sh --foreground --resume

前台模式会占住当前终端,适合调试;长时间正式实验建议用后台模式。

8. 结果位置

DbQA 分片结果:

experiments/lab_bench/results/dbqa_batch/dbqa_results.jsonl
experiments/lab_bench/results/dbqa_batch/dbqa_reasoning.log

SeqQA 分片结果:

experiments/lab_bench/results/seqqa_batch/seqqa_results.jsonl
experiments/lab_bench/results/seqqa_batch/seqqa_reasoning.log

*_results.jsonl 每行是一道题的紧凑结果,包含:

  • question
  • answer
  • agent_answer

*_reasoning.log 保存每题的 prompt、raw output 和 Biomni reasoning log,方便排查错误。

9. 断点续跑和重新开始

默认推荐断点续跑:

experiments/lab_bench/run_dbqa_seqqa_biomni_experiment.sh --background --resume

脚本会跳过已经存在于 *_results.jsonl 里的问题。

如果要清空旧结果重新跑:

experiments/lab_bench/run_dbqa_seqqa_biomni_experiment.sh --background --fresh

10. 常用参数

切换 split。为了和 HypoBioOS 正式实验一致,默认用 test

export LAB_BENCH_SPLITS=test

Biomni 分片脚本一次只支持一个 split。如果设置成 dev test,脚本会退出,避免和 HypoBioOS 默认测试集设置混淆。

调整 dev/test 数量:

export LAB_BENCH_DEV_SIZE=45
export LAB_BENCH_TEST_SIZE=315

固定抽样种子:

export LAB_BENCH_SUBSET_SEED=20260514

Biomni A1 runner 是有状态的,脚本默认:

LAB_BENCH_N_THREADS=1

不建议改成更大的值。

11. 检查是否在跑

查看后台进程:

ps -ef | grep lab_bench | grep -v grep

查看结果是否持续增长:

wc -l experiments/lab_bench/results/dbqa_batch/dbqa_results.jsonl
wc -l experiments/lab_bench/results/seqqa_batch/seqqa_results.jsonl

查看最近 reasoning log:

tail -80 experiments/lab_bench/results/dbqa_batch/dbqa_reasoning.log
tail -80 experiments/lab_bench/results/seqqa_batch/seqqa_reasoning.log

12. 常见报错

如果看到:

No LLM API key found.

说明脚本没有读到 DeepSeek key。检查:

ls -lh /225040511/project/Biomni/.env

并确认 .env 里至少有:

DEEPSEEK_API_KEY=你的 DeepSeek API Key
DEEPSEEK_MODEL_NAME=deepseek-chat
DEEPSEEK_BASE_URL=https://api.deepseek.com/v1

如果使用临时环境变量,确认你是在同一个 shell 里先 export,再启动脚本。