core-db-bundle
收藏资源简介:
该数据集是门控的 Hugging Face 数据集 thanhdath/core-db-bundle,pretty_name 为 CoRE-DB RL bundle (FINER-SQL-3B-BIRD, Spider+BIRD train),许可证为 other,发布日期为 2026-10-22,替代 2026-10-20;旧脚本和文档位于 archive/2026-10-20/,不应使用。它服务于对 FINER-SQL-3B-BIRD 进行持续 GRPO 强化学习的场景,目标是在全部 Spider train 与 BIRD train 问题(18,087 条)上再训练 2 个 epoch,并比较 CoRE-DB 与原始数据库作为奖励/执行环境的效果。数据集捆绑数据、模型和脚本:包括 FINER-SQL-3B-BIRD 模型(约 6.2 GB)、Qwen3-Embedding-0.6B 嵌入模型(约 1.2 GB)、原始 Spider/BIRD 训练数据库(压缩包 8 GB,解压后约 31 GB)、CoRE-DB v5(约 0.6 GB;树 253fb988,792 个 sqlite 文件,覆盖全部 BIRD/Spider 训练 DB 和 18,087 个问题),以及代码和输入。CoRE v7(树 a547722f,679 个 sqlite 文件)仅用于 2,208 条 prone 子集(199 个 DB,1,881 个 gold)。coredb+origdb 预检期望 1007 个 sqlite 文件,树为 full_core 与 orig。下载体积约 17 GB,解压后的原始 DB 约 31 GB。奖励设置在各 arm 间共用相同 trainer、recipe 和 corpus,仅奖励环境不同:奖励 = 格式 + 执行 + 官方 verdict(BIRD 按行集合;Spider 按测试套件规则、去掉 DISTINCT、bag 比较);atomic credit 开启(对可执行但错误 SQL 的 SQL 结构评分);memory/intrinsic thought reward 开启,每次运行新建 ChromaDB 存储,并在作业 GPU 上运行 Qwen3-Embedding-0.6B 嵌入服务器。强制 arm 为 coredb 和 origdb;可选 arm 包括 coredb_gate、coredb_tier2、coredb_tier2_ts、prone_origdb、prone_coredb、prone_coredb_gate、prone_coredb_tier2、prone_coredb_tier2_ts。全量 arm 有 18,087 行,prone arm 有 2,208 行。固定训练配方为:有效 batch 32、学习率 8e-6、KL beta 0.04、8 generations、temperature 1.0、seed 42、bf16、2 epochs、max_prompt_length 2048、max_completion_length 2048、标准 AdamW、官方 verdict、atomic credit、memory reward。使用方式面向 SLURM,每个 arm 一张 GPU;推荐 H200 > H100 > A100 80GB,A100 40GB 不支持 3B。访问受门控,需要写权限 token;作业会将状态、日志、指标和 checkpoint 推送到同一 HF 仓库的 runs/ 下。HF checkpoint 包含权重、tokenizer、config 和 trainer_state.json,优化器状态通常跳过;本地 checkpoint 保留优化器、scheduler 和 RNG 以精确恢复。适用任务包括文本到 SQL/数据库执行强化学习、SQL 执行正确性奖励、CoRE-DB 与原始 DB 对比实验,以及 Spider/BIRD 上的训练与评估。
This is a gated Hugging Face dataset thanhdath/core-db-bundle, pretty_name CoRE-DB RL bundle (FINER-SQL-3B-BIRD, Spider+BIRD train), license other, released 2026-10-22, supersedes 2026-10-20; old scripts and docs under archive/2026-10-20/ should not be used. It serves continual GRPO reinforcement learning for FINER-SQL-3B-BIRD, aiming to retrain for 2 epochs on all Spider train and BIRD train questions (18,087) and compare CoRE-DB versus original databases as reward/execution environments. The bundle includes data, models and scripts: FINER-SQL-3B-BIRD model (~6.2 GB), Qwen3-Embedding-0.6B embedding model (~1.2 GB), original Spider/BIRD training databases (8 GB compressed, ~31 GB uncompressed), CoRE-DB v5 (~0.6 GB; tree 253fb988, 792 sqlite files, covering all BIRD/Spider training DBs and 18,087 questions), plus code and inputs. CoRE v7 (tree a547722f, 679 sqlite files) is only used for the 2,208-question prone subset (199 DBs, 1,881 gold). The coredb+origdb precheck expects 1007 sqlite files with trees full_core and orig. Download size is about 17 GB, and uncompressed original DBs about 31 GB. Reward setup shares the same trainer, recipe and corpus across arms; only reward environment differs: reward = format + execution + official verdict (BIRD by row sets; Spider by test-suite rules, removing DISTINCT, bag comparison); atomic credit enabled (SQL structure scoring for executable but incorrect SQL); memory/intrinsic thought reward enabled, with a new ChromaDB store per run and Qwen3-Embedding-0.6B embedding server on the job GPU. Mandatory arms are coredb and origdb; optional arms include coredb_gate, coredb_tier2, coredb_tier2_ts, prone_origdb, prone_coredb, prone_coredb_gate, prone_coredb_tier2, prone_coredb_tier2_ts. Full arms have 18,087 rows; prone arms have 2,208 rows. Fixed training recipe: effective batch 32, learning rate 8e-6, KL beta 0.04, 8 generations, temperature 1.0, seed 42, bf16, 2 epochs, max_prompt_length 2048, max_completion_length 2048, standard AdamW, official verdict, atomic credit, memory reward. Usage is SLURM-oriented, one GPU per arm; recommended H200 > H100 > A100 80GB, A100 40GB is not supported for 3B. Access is gated and requires a write token; jobs push status, logs, metrics and checkpoints to runs/ in the same HF repository. HF checkpoints contain weights, tokenizer, config and trainer_state.json; optimizer state is usually skipped; local checkpoints keep optimizer, scheduler and RNG for exact resume. Applicable tasks include text-to-SQL/database execution reinforcement learning, SQL execution correctness rewards, CoRE-DB versus original DB comparison experiments, and training/evaluation on Spider/BIRD.
CoRE-DB RL bundle 数据集概述
基本信息
- 数据集名称:
thanhdath/core-db-bundle - pretty_name:
CoRE-DB RL bundle (FINER-SQL-3B-BIRD, Spider+BIRD train) - 许可证:
other - 数据集页面:https://huggingface.co/datasets/thanhdath/core-db-bundle
- 发布版本:2026-10-22,替代 2026-10-20;旧脚本和文档位于 HF 数据集仓库中的
archive/2026-10-20/,不得使用。 - 监控与状态页:https://huggingface.co/datasets/thanhdath/core-db-bundle/blob/main/runs/STATUS.md
用途与内容
- 用于训练
FINER-SQL-3B-BIRD,进行额外 2 个 epoch 的 GRPO,覆盖所有 Spider train 和 BIRD train 问题,共 18,087 条。 - 配方为 RL 会话当前 FINER-SQL 配置记录。所有 arm 使用相同 trainer、recipe 和 corpus,仅 reward 环境不同。
- reward 组成:format + execution + official verdict。BIRD 使用 set of rows;Spider 使用 test-suite rule,DISTINCT removed,bag compare。
- atomic credit 开启:对可执行但错误 SQL 的 SQL 结构评分。
- memory(intrinsic thought)reward 开启:每次运行新建 ChromaDB 存储,并使用 Qwen3-Embedding-0.6B embed server,运行在任务 GPU 上。
- 数据、模型和脚本均来自 gated HF 数据集
thanhdath/core-db-bundle,包含 data、model 和 scripts(slurm/)。 - 所有者无法看到执行机器;监控仅通过任务推送到同一 HF 仓库的
runs/下。因此需要该数据集的 write token。
数据集配置
| config_name | default | split | data_files |
|---|---|---|---|
prone_v7_2208 |
true | train | https://huggingface.co/datasets/thanhdath/core-db-bundle/blob/main/stage/prone_v7/arms/BJ/inputs/train.parquet |
full_18087 |
- | train | https://huggingface.co/datasets/thanhdath/core-db-bundle/blob/main/stage/arms/BJ/inputs/train.parquet |
训练 ARM
| ARM | need | reward DBs and rule | RL session arm | rows | steps / epoch | total steps (2 epochs) | HF checkpoints |
|---|---|---|---|---|---|---|---|
coredb |
mandatory | CoRE-DB v5 only:correct = official-correct on D0 and every active member DB | CP25 | 18,087 | 4,522 | 9,044 | 4522, 9044 |
origdb |
mandatory | original Spider / BIRD train DBs(pure DB swap) | AP24 | 18,081 | 4,521 | 9,042 | 4521, 9042 |
coredb_gate |
optional | CoRE-DB v5 for groups where one own rollout is correct on original DB and on CoRE;other groups on original DB | CP26 | 18,087 | 4,522 | 9,044 | 4522, 9044 |
coredb_tier2 |
optional | ORI-based:original-DB verdict,plus a 0.5 bonus when also CoRE-correct | CP28 | 18,087 | 4,522 | 9,044 | 4522, 9044 |
coredb_tier2_ts |
optional | coredb_tier2 with memory term x 0.25 and atomic credit x 0.5 |
CP29 | 18,087 | 4,522 | 9,044 | 4522, 9044 |
prone_origdb |
optional | RL session 的 exact pair on its 2,208 spurious-prone questions:original DBs | AP24 | 2,208 | 552 | 1,104 | 276, 552, 828, 1104 |
prone_coredb |
optional | prone subset,CoRE v7 only | CP25 | 2,208 | 552 | 1,104 | 276, 552, 828, 1104 |
prone_coredb_gate |
optional | prone subset,CoRE v7 with exemplar gate | CP26 | 2,208 | 552 | 1,104 | 276, 552, 828, 1104 |
prone_coredb_tier2 |
optional | prone subset,ORI-based tier two on CoRE v7 | CP28 | 2,208 | 552 | 1,104 | 276, 552, 828, 1104 |
prone_coredb_tier2_ts |
optional | prone subset,tier two with re-weighted terms | CP29 | 2,208 | 552 | 1,104 | 276, 552, 828, 1104 |
origdb 在原始 BIRD DBs 上会丢失 6 个超时 BIRD golds。coredb 与 origdb 为必训 arm;可选 arm 仅在所有者要求时训练。
提交命令
从 slurm/ 运行,且在 srun_test.sh 对每个要提交的 arm PASS 后执行:
bash
bash submit_best.sh
ARMS="coredb origdb" bash submit_best.sh --chain 4
ARMS="coredb_tier2" bash submit_best.sh --chain 4
sbatch --gres=gpu:h100:1 --export=ALL,ARM=coredb train_3b_h100.sh
CoRE 树
- full-corpus arms 使用 CoRE-DB v5,tree
253fb988,792 个 sqlite 文件。它覆盖所有 BIRD 和 Spider train DB 以及全部 18,087 问题,与 2026-10-20 发布相同。 - RL 会话较新的 CoRE v7,tree
a547722f,679 个 sqlite 文件,仅为 2,208 问题的 prone 子集构建,包含 199 个 DB、1,881 个 golds。因此仅用于prone_*arms。
固定训练参数与限制
- effective batch:32 sequences per optimizer step,4 prompts x 8 generations,
PER_DEVICE x GRAD_ACC = 32。 - learning rate
8e-6,KL beta0.04,8 generations,temperature1.0,seed42,bf16。 - 2 epochs,
max_prompt_length 2048,max_completion_length 2048。 - 标准 AdamW,不得使用 8-bit Adam 或其他优化器。
- official verdict、atomic credit ON、memory reward ON(
--intrinsic_top_k 20);不得添加--no-memory或--no-atomic。 - corpus、reward、trainer 文件和 arm 的 reward 设置均经过 hash 校验。
- 仅可更改 memory knobs:
PER_DEVICE/GRAD_ACC、VLLM_MEM、GRAD_CKPT。 - OOM 回退顺序:
PER_DEVICE减半,GRAD_ACC加倍。- 若关闭则设置
GRAD_CKPT=1。 VLLM_MEM每次降低 0.02,最低到 80 GB 为 0.10,141 GB 为 0.06。- 仍 OOM 则停止并报告。不得使用
REF_DTYPE=bfloat16或未经所有者批准的其他更改。
- 执行顺序:setup env(SLURM 外)-> download -> verify -> 对每个要提交的 arm 在目标 GPU 类型上
srun_test.shPASS ->sbatch(通过submit_best.sh)。未 PASS 不得sbatch。 - 不得删除 HF 上
runs/下内容。不得编辑 HF 数据集仓库中的stage/或model/。不得使用 HF 数据集仓库中的archive/。 - GPU 优先级:H200 > H100 > A100 80GB。A100 40GB 不支持 3B,标准 AdamW 下 OOM。
每 GPU 配置(3B)
| GPU file | card | PER_DEVICE x GRAD_ACC |
VLLM_MEM |
GRAD_CKPT |
REF_DTYPE |
s/step | peak VRAM | time / epoch (full) | status |
|---|---|---|---|---|---|---|---|---|---|
train_3b_h200.sh |
H200 141 GB | 4 x 8 | 0.12 | 0 | float32 | ~9(estimate) | ~110 GB(estimate) | ~11 h | estimated, not run |
train_3b_h100.sh |
H100 80 GB | 4 x 8 | 0.20 | 1 | float32 | ~10(estimate) | ~74 GB(estimate) | ~13 h | estimated, not run |
train_3b_a100_80g.sh |
A100 80 GB | 4 x 8 | 0.20 | 1 | float32 | ~18(estimate) | ~74 GB(estimate) | ~23 h | estimated, not run |
train_3b_a100_40g.sh |
A100 40 GB | - | - | - | - | - | OOM | - | not supported for 3B,文件拒绝启动 |
- embed server 每行增加 0.08 卡内存:80 GB 为 6.4 GB,141 GB 为 11 GB。
- 每个 arm 每步成本约相同。
coredb*arms 还会等待 CoRE API,bundle-scope arms 运行两个 API。 - 完整 2-epoch 运行约为每个 arm 每 epoch 时间的 2 倍。
prone_*运行 1,104 步,约为完整运行的 1/8。各 arm 作为独立任务运行,一 GPU 一个。
估计来源
- 峰值内存:固定内存 34.5 GB(bf16 policy 6.2 + grads 6.2 + fp32 KL reference 12.3 + AdamW states 12.3 GB)。此外有 vLLM 份额、embed server 的 0.08 卡内存。激活约 micro-batch 2 时 8.5 GB,micro-batch 4 时约 17 GB。
- 速度:在 A100 40 GB MIG slice(42/108 SMs,无 memory reward)测得 3B 为 36.5 s/step。其他速度按计算缩放,另加约 10% 用于 memory reward 和 official Spider verdict。
- 40 GB 测试:标准 AdamW 下,3B 在该 slice 第一个 optimizer step OOM,即使 1x32、
VLLM_MEM0.18 和 gradient checkpointing。 - 本版本未在 GPU 上测量。2026-10-22 脚本尚未在任何 GPU 上运行训练步骤。
srun_test.shPASS 是第一次 GPU 运行,需报告其 s/step 和 peak VRAM。
操作步骤
- 获取脚本:需要所有者 token;安装
huggingface_hub,下载slurm/*和README.md到$CRDB_ROOT/bundle。 - 构建环境:
bash setup_env.sh。创建 conda 环境coredb-rl,Python 3.11.15,torch 2.8.0 cu128,安装 requirements 等。预期ENV OK。 - 获取访问和下载:请求 fine-grained HF token,需对
thanhdath/core-db-bundle有 write access。bash download_bundle.sh或ARMS=all bash download_bundle.sh。预期 preflight OK、[data] OK。 - 验证:
bash verify_setup.sh;可选CACHE_CHECK=1。预期VERIFY PASS。 - 目标 GPU 类型上的 srun 测试:
bash srun_test.sh h100 coredb、bash srun_test.sh h100 origdb等。预期SRUN_TEST PASS。 - 提交:
bash submit_best.sh。 - HF 监控:查看
runs/STATUS.md和 HF 仓库 https://huggingface.co/datasets/thanhdath/core-db-bundle 下runs/<arm>/<jobid>/目录。
任务内部运行内容
sbatch train_3b_<gpu>.sh (ARM=...)- preflight:env imports/versions、bundle sha256、HF write access(失败退出码 11-16)。
hf_pusher.py --loop:后台每 6 分钟推送 status/logs/metrics,checkpoints 推送到 HF。run_train.py:在 127.0.0.1 上启动 original DBs 的 db_execution API,coredb*额外启动 CoRE tree 的第二个 API,每个 API 做 40-gold probe。- Qwen3-Embedding-0.6B embed server(vLLM,占 0.08 GPU)+ 空的 run-local ChromaDB store。
accelerate launch w19_train_entry:trl GRPO + vLLM colocate,使用 RL 会话 pinned trainer files,reward adapter 代码instrument_pilot_v12_official,以及 arm 的RL_TIER/RL_V12_GATE/RL_TERM_SCALE。- EXIT trap:
hf_pusher.py --final,状态 done/failed、退出码、最后 200 行日志,等待最后 checkpoint 上传。
本地输出在 $CRDB_ROOT/runs/<RUN_NAME>/,默认 RUN_NAME=3b_<arm>_2ep。
run/checkpoints/checkpoint-<step>/:完整 HF checkpoints。保留 epoch checkpoints 及最新 rolling resume point(coredb*每 646 步,origdb每 411 步,prone_*每 276 步)。run/process.log、run/STEP_TIMING_v1.jsonl、run/TELEMETRY.jsonl、run/ROLLOUT_LOG_V2.jsonl、run/BUNDLE_REWARD_STATS.json、run/chroma_db/、run/MEMORY_*.json、gpu_mem.csv、RUN_RESULT_<job>.json、hf_pusher.log。
HF 上每个 job 在 HF 仓库 https://huggingface.co/datasets/thanhdath/core-db-bundle 的 runs/<arm>/<jobid>/ 下包含:
status.jsonlog_tail.txt(最后 300 行日志)logs/(完整日志,gzip 分片)metrics/(每步 timing 和 rewards、trainer log history、reward-tier statisticsBUNDLE_REWARD_STATS.json、MEMORY_START.json/MEMORY_FINAL.json)checkpoint-<step>/:full arms 每个 epoch 末,prone_*每 276 步。
推送每 6 分钟一次(HF_PUSH_INTERVAL),任何退出时最终推送。running 行更新时间远旧于 6 分钟表示节点死亡且未最终推送。
Resume
- 使用相同
ARM和RUN_NAME重新提交,或使用submit_best.sh --chain N。trainer 从最新本地checkpoint-*恢复 optimizer、scheduler、RNG 和 step。不完整 checkpoint 先重命名为incomplete_checkpoint-*。 - memory store 在 resume 时重新空启动。reward adapter 要求开始时空 store,因此上一 job 的 store 移到
run/chroma_db_prev_<time>。RUN_RESULT_<job>.json在memory_store_restarted下记录。 - 使用
--chain且集群允许的最长 walltime,使一次运行尽可能少 resume。 - resume 时可切换 GPU 文件:仅 micro-batch 拆分变化。
- HF checkpoints 给所有者,包含 weights、tokenizer、config 和
trainer_state.json。optimizer state 仅当其大小至多为 weights 的 2 倍时上传。AdamW state 略大于 2 倍 bf16 weights,因此跳过。HF checkpoint 可从这些权重开始新运行,但不能继续精确 optimizer 轨迹。精确恢复使用本地 checkpoint,其保留 optimizer、scheduler 和 RNG。
故障排除摘要
| symptom | fix |
|---|---|
PREFLIGHT FAIL: set ARM= one of: ... |
在 --export 中添加 ARM= |
PREFLIGHT FAIL: env python missing |
运行 setup_env.sh,或 export CRDB_PY=/path/to/env/bin/python |
PREFLIGHT FAIL: bundle files / sha256 |
用覆盖该 arm 的 ARMS 重新运行 download_bundle.sh |
PREFLIGHT FAIL: no HF write access |
在 sbatch 前 export HF_TOKEN=<write token>,并保持 --export=ALL;token 需对 thanhdath/core-db-bundle 有 write access |
trainer / reward files differ from the RL sessions pinned hashes |
stage/code 被编辑;重新下载 |
reward adapter probe failed |
arm 模式不在 adapter install line;查看 DRYRUN.json 的 adapter_probe 并报告 |
FATAL embed server did not come up |
查看 run/EMBEDDER_try*.log 和 run/MEMORY_START.json;通常为 GPU 内存或端口忙 |
NO CUDA (missing --gres?) |
提供 --gres=gpu:<type>:1 |
CUDA out of memory |
按 OOM 回退顺序处理 |
API did not answer /meta |
查看 runs/<RUN_NAME>/api_orig.log / api_core.log。launcher 会为其 127.0.0 地址丢弃代理变量 |
报告要求
- 向所有者报告每个 arm 的
SRUN_TEST PASS行。 - 报告
submit_best.sh打印的 job ids。 - 报告 HF 链接:https://huggingface.co/datasets/thanhdath/core-db-bundle/blob/main/runs/STATUS.md
- 报告从配置表中更改的每个 knob 及原因。
- 失败时报告错误行及其位置:HF 上 job 的
log_tail.txt。





