evaluation
Evaluate FlagEmbedding embedders and optional rerankers on local retrieval data or supported benchmarks.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- evaluation
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Evaluate FlagEmbedding embedders and optional rerankers on local retrieval data or supported benchmarks.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/cli-reference.md11.2 KB
- 参考文档references/data-formats.md4.4 KB
- 参考文档references/troubleshooting.md4.8 KB
- 脚本scripts/create_tiny_retrieval_dataset.py3.3 KB
03 SKILL.md 正文
FlagEmbedding Evaluation
Use this sub-skill when a task needs FlagEmbedding evaluation commands, custom retrieval JSONL preparation, metric/output selection, or benchmark routing for MTEB, BEIR, MSMARCO, MIRACL, MLDR, MKQA, AIR-Bench, or BRIGHT.
Do not use this sub-skill for low-level embedder or reranker API details; route those to sibling inference. Do not use it for training or fine-tuning data preparation; route those to sibling fine-tuning. Broad package install, backend, or import troubleshooting belongs to the root troubleshooting reference.
First Decision
- For local retrieval data with
corpus.jsonl,<split>_queries.jsonl, and<split>_qrels.jsonl, preferpython -m FlagEmbedding.evaluation.custom. - For local data stored in multiple subdirectories, run the custom module once per subdirectory with its own
--dataset_dir,--output_dir,--corpus_embd_save_dir, and--eval_output_path. The custom loader reports no dataset names, so do not use--dataset_namesfor this case. - For official benchmark names or languages, choose the benchmark module from
references/cli-reference.mdand confirm network, model-cache, and compute approval before running. - If the user wants only schema validation or a smoke fixture, create a tiny dataset with
scripts/create_tiny_retrieval_dataset.pybefore building a model command.
Operating Procedure
- Confirm dependencies for the selected path. All dense retrieval evaluation paths import
faissandpytrec_eval; the focused CPU dependency set isfaiss-cpupluspytrec_eval. - Check the data layout against
references/data-formats.md. For custom evaluation, use the generic IR schema with corpusid, optionaltitle,text; queryid,text; qrelsqid,docid,relevance. - Build the command from
references/cli-reference.md. Always make output paths explicit:--output_dir,--eval_output_path, and, when reusing corpus embeddings,--corpus_embd_save_dir. - Decide
--ignore_identical_idsdeliberately. Use it when query ids and document ids share an id namespace and self-hits are invalid; leave it false for datasets where identical ids are meaningful or when unsure. - If adding a reranker, set
--reranker_name_or_path, choose--reranker_model_classfor custom checkpoints, and keep--rerank_top_kno larger than--search_top_k. - After execution, inspect both raw search result JSON under
--output_dirand the aggregate file at--eval_output_path.
Verification Hooks
- Safe help check:
python -m FlagEmbedding.evaluation.custom --help. - Loader fact check:
CustomEvalDataLoader.available_dataset_names()returns[];available_splits()returns["test"]. - Fixture check:
python scripts/create_tiny_retrieval_dataset.py --helpand a run that writescorpus.jsonl,test_queries.jsonl, andtest_qrels.jsonl. - Official benchmark shell flows are reference candidates only. Treat them as network and compute dependent, not safe defaults.
References
references/cli-reference.md: module commands, shared arguments, and benchmark-specific notes.references/data-formats.md: local JSONL schema and output structure.references/troubleshooting.md: dependency, layout, cache, metrics, reranker, and identical-id issues.scripts/create_tiny_retrieval_dataset.py: tiny self-contained custom retrieval fixture generator.
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).