tevatron
Use Tevatron for neural retrieval workflows including data preparation, retriever training, encoding, FAISS retrieval, reranking, and multimodal or LLM retrievers.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- tevatron
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use Tevatron for neural retrieval workflows including data preparation, retriever training, encoding, FAISS retrieval, reranking, and multimodal or LLM retrievers.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/repo-provenance.md3.7 KB
- 参考文档references/repo-routing-metadata.json508 B
- 参考文档references/troubleshooting.md6.6 KB
- 脚本scripts/check_tevatron_environment.py5.2 KB
03 SKILL.md 正文
Tevatron
Use this repo skill when a task mentions Tevatron, neural retrieval, dense retriever training, embedding query/corpus datasets, FAISS search, cross-encoder reranking, sparse retrievers, RepLLaMA/RankLLaMA, ColPali, DSE, Qwen, or multimodal retrieval data.
Tevatron is a Python toolkit for learning and running neural retrieval models across scale, language, and modality. This skill is self-contained: use the bundled references and scripts here instead of reopening the source repository.
Quick Start
- Choose the workflow route from the table below.
- Confirm the package surface:
python - <<'PY' import tevatron print("tevatron import ok") PY - Install only the optional dependencies needed by the selected route. Base metadata requires
transformersanddatasets; many practical workflows also needtorch,faiss-cpuorfaiss-gpu,peft,deepspeed,accelerate,jax/flax/optax,vllm,Pillow, or Qwen-specific utilities. - Run
python scripts/check_tevatron_environment.py --jsonfor a safe optional-dependency report before recommending heavyweight model, GPU, JAX, vLLM, or multimodal commands. - Read
references/troubleshooting.mdbefore broad dependency changes, GPU/JAX installs, model downloads, or long training/evaluation runs.
Route by Task
| User task | Read next |
|---|---|
| Validate JSONL, corpus/query schemas, qrels, rankings, hard-negative inputs, or format conversions | sub-skills/data-preparation/ |
| Build dense, sparse, distillation, GradCache, LoRA, DeepSpeed, or JAX training commands | sub-skills/training/ |
| Encode query/corpus embeddings, shard outputs, run FAISS search, merge rankings, or plan BEIR/MS MARCO evaluation | sub-skills/encoding-retrieval/ |
| Prepare pairwise rerank input, train a cross-encoder reranker, run reranking, or interpret reranker scores | sub-skills/reranking/ |
| Work with ColPali, DSE/Qwen, Qwen2.5-VL, Qwen-Omni, Qwen3-Embedding, RepLLaMA, RankLLaMA, vLLM, images, audio, video, or asset paths | sub-skills/multimodal-llm/ |
Workflow Order
Most end-to-end retrieval tasks follow this order:
sub-skills/data-preparation/: validate train/query/corpus/rerank records and convert run files when needed.sub-skills/training/: assemble a retriever training command or choose a pretrained checkpoint path.sub-skills/encoding-retrieval/: encode query and corpus embeddings, run FAISS search, and merge shard outputs.sub-skills/reranking/: optionally prepare pairwise candidates and rerank first-stage results.sub-skills/multimodal-llm/: apply when any step uses media fields, Qwen-family processors, LLM retrievers/rankers, or vLLM.
Bundled Root Files
references/repo-provenance.md: read before deciding whether this skill is current for a Tevatron checkout or should be refreshed.references/troubleshooting.md: cross-cutting install/import, optional dependency, backend, data, and command failure guidance.references/repo-routing-metadata.json: structured metadata used byrepo-skills-routerduring DisCo import.scripts/check_tevatron_environment.py: safe dependency/import probe for Tevatron workflows; it reports availability but does not download models or run training.
Installation Guidance
Use a minimal install for inspection, data validation, command building, or format conversion:
pip install tevatron transformers datasets
For local development or a checkout, use editable installation from the checkout root:
pip install -e .
Then add route-specific dependencies only when needed:
- Encoding/search:
faiss-cpufor CPU FAISS; GPU FAISS requires a compatible CUDA/FAISS stack. - PyTorch training, encoding, and reranking:
torch, pluspeftfor LoRA anddeepspeed/acceleratefor distributed or ZeRO runs. - JAX/TPU routes:
jax,flax,optax, and Tevax/Magix dependencies used by the selected experimental driver. - Multimodal/Qwen routes:
Pillow, Qwen utility packages, model processors, and sometimesvllmor FlashAttention.
Avoid installing all optional stacks at once unless the task explicitly needs them. Tevatron workflows are model- and backend-heavy; the safest route is to validate data and commands first, then install the exact backend required by the selected workflow.
Safety and Validation
- Do not run training, model downloads, dataset downloads, BEIR evaluation, or GPU/vLLM/JAX jobs as quick checks unless the user explicitly asked for that execution.
- Use bundled scripts with tiny fixtures for deterministic checks before expensive runs.
- Treat original repository examples as evidence. Do not make runtime plans that depend on source checkout examples or scripts remaining available.
- If an optional dependency is missing, first read the owning sub-skill troubleshooting file and the root
references/troubleshooting.md; do not paper over missing backend packages with unrelated installs.
Common Routing Signals
--dataset_name json,--dataset_path,query_id,docid,positive_document_ids,negative_document_ids:sub-skills/data-preparation/.tevatron.retriever.driver.train,--grad_cache,--lora,--deepspeed,train_distil, SPLADE, UniCOIL, Tevax:sub-skills/training/.tevatron.retriever.driver.encode,--encode_is_query,--encode_output_path,tevatron.retriever.driver.search,--passage_reps,--save_ranking_to:sub-skills/encoding-retrieval/.tevatron.reranker.driver.train,tevatron.reranker.driver.rerank, pairwise JSONL, RankLLaMA scoring:sub-skills/reranking/.query_image,document_image,assets_path, Qwen, ColPali, DSE, RepLLaMA, vLLM encode, FlashAttention, media processors:sub-skills/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).