data-preparation
Prepare and validate Tevatron JSON/JSONL datasets, rankings, qrels, hard-negative inputs, rerank inputs, and ranking conversion outputs.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- data-preparation
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Prepare and validate Tevatron JSON/JSONL datasets, rankings, qrels, hard-negative inputs, rerank inputs, and ranking conversion outputs.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/data-formats.md9.1 KB
- 参考文档references/hard-negatives.md5.5 KB
- 参考文档references/troubleshooting.md7.4 KB
- 脚本scripts/convert_result_to_marco.py2.8 KB
- 脚本scripts/convert_result_to_trec.py3.2 KB
- 脚本scripts/validate_tevatron_jsonl.py19.6 KB
03 SKILL.md 正文
Tevatron Data Preparation
Use this sub-skill when the task is to prepare, inspect, validate, repair, or convert files before Tevatron training, encoding, retrieval evaluation, or reranking. It covers local JSON/JSONL loading, Hugging Face dataset loading, train/corpus/query schemas, ID-list data with separate corpora, qrels/rankings, hard-negative prerequisites, rerank input bridges, and tiny local ranking conversions.
Fast Path
- Identify the downstream consumer:
- Retriever training accepts either embedded
positive_passages/negative_passages, compactpositive_document_ids/negative_document_idsplus a corpus, or pre-tokenized rows. - Retriever encoding accepts query rows with
query_idplusquery_textorquery, or corpus rows withdocidplus text/media fields. - Reranker inference accepts one query-document pair per JSONL row with
query_id,query,docid,title, andtext. - Retrieval evaluation and hard-negative mining consume ranking/qrels files whose delimiters must match the target tool.
- Retriever training accepts either embedded
- Decide loader mode:
- Local JSONL: use
--dataset_name json --dataset_path <file.jsonl>. - Local ID-list training: add
--corpus_name json --corpus_path <corpus.jsonl>so document IDs can be resolved. - Hosted Tevatron/Hugging Face data: use
--dataset_name <namespace/name>with optional--dataset_config,--dataset_split, and cache flags.
- Local JSONL: use
- Validate local files from this sub-skill directory before expensive runs:
python scripts/validate_tevatron_jsonl.py --kind train --input train.jsonl --corpus corpus.jsonlpython scripts/validate_tevatron_jsonl.py --kind corpus --input corpus.jsonlpython scripts/validate_tevatron_jsonl.py --kind query --input queries.jsonlpython scripts/validate_tevatron_jsonl.py --kind ranking --input rank.tsv --corpus corpus.jsonlpython scripts/validate_tevatron_jsonl.py --kind qrels --input qrels.txt --corpus corpus.jsonlpython scripts/validate_tevatron_jsonl.py --kind rerank --input rerank.jsonl
- Convert retrieval rankings when evaluation or submission tooling needs another format:
python scripts/convert_result_to_trec.py --input rank.tsv --output rank.trecpython scripts/convert_result_to_marco.py --input rank.tsv --output rank.marco.tsv
- Route after validation:
- Training command assembly:
../training/. - Embedding/search execution and ranking generation:
../encoding-retrieval/. - Pairwise reranker scoring:
../reranking/. - Media-model dependencies, Qwen/ColPali/DSE, and optional multimodal execution:
../multimodal-llm/.
- Training command assembly:
Key References
references/data-formats.md: accepted record schemas, loader flags, qrels/ranking formats, local-vs-hosted dataset decisions, and multimodal-ish fields.references/hard-negatives.md: hard-negative mining inputs, top-k/min-count requirements, ID consistency checks, and rerank input bridge requirements.references/troubleshooting.md: fixes for malformed JSONL, missing IDs/text, corpus pairing mistakes, delimiter mismatches, hard-negative shortages, and missing media assets.
Bundled Scripts
scripts/validate_tevatron_jsonl.py: static validator for train, corpus, query, rerank, ranking, and qrels files; it performs no Tevatron imports, model loads, or network calls.scripts/convert_result_to_trec.py: standalone converter from Tevatron-style rankings to six-column TREC run format.scripts/convert_result_to_marco.py: standalone converter from Tevatron-style rankings to MS MARCOqid<TAB>docid<TAB>rankformat.
Safe Defaults
- Keep IDs as strings across train rows, corpus rows, rankings, qrels, and rerank inputs.
- Keep ranking files grouped by query in desired rank order before conversion; converters recompute rank per contiguous query block.
- For default
train_group_size=8, plan at least seven usable negatives per query after removing positives and duplicate/invalid docids. - Treat hosted datasets as network/cache-dependent unless the working environment already has the dataset cached.
- Check media path fields with
--assets-rootbefore multimodal execution; a schema-valid row can still fail later if assets are missing.
Boundaries
- Do not assemble or launch model training commands here; route to
../training/. - Do not encode embeddings, run FAISS search, merge shards, or evaluate retrieval here; route to
../encoding-retrieval/. - Do not score reranker pairs or select reranker model arguments here; route to
../reranking/. - Do not execute multimodal or LLM retrievers here; only validate fields/assets and route execution to
../multimodal-llm/.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).