persistence-and-evaluation
The persistence-and-evaluation sub-skill routes Faiss index storage, clustering, ground-truth evaluation, and bounded operating-point experiments.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- persistence-and-evaluation
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- The persistence-and-evaluation sub-skill routes Faiss index storage, clustering, ground-truth evaluation, and bounded operating-point experiments.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md10.4 KB
- 参考文档references/troubleshooting.md10.3 KB
- 参考文档references/workflows.md11.3 KB
- 脚本scripts/smoke_persistence.py7.9 KB
03 SKILL.md 正文
Persistence and evaluation
Use this branch when the task involves write_index/read_index, byte
serialization, cloning, mmap or on-disk inverted lists, merging, vector
reconstruction/codes, Kmeans, exact ground truth, recall/precision, or
ParameterSpace operating points.
First checks
- Establish
d, row count, float32 contiguous(n, d)arrays, metric, and preprocessing before comparing any result. For cosine, normalize both query and database arrays and use inner product consistently. - Treat an index file or serialized byte array as untrusted input. Bound its size before reading, use Faiss deserialization limits where available, and never deserialize in a privileged or production process without a separate trust decision. See troubleshooting.
- Prefer bytes for a bounded in-process handoff and a temporary file followed by an atomic rename for a durable artifact. Keep an mmap-backed index alive only while its backing file remains present and unchanged.
Route the work
- Choose the index family and search parameters in index-selection-and-search.
- Choose codecs,
sa_encode/sa_decode, and compression constraints in training-and-compression. - Route ID maps, selectors, refinement, shards, replicas, and ownership to composition-and-filtering.
- Route GPU ground truth, CPU/GPU transfer, and backend interoperability to accelerated-and-interoperable.
Operating sequence
- Build an exact
IndexFlatbaseline with the same metric and preprocessing. - Train and populate the candidate only with a bounded, representative
sample; record
d, metric, factory/configuration,ntotal, and tuning parameters alongside results. - Measure recall against the exact baseline before and after every operating point. Do not use a downloaded benchmark or an unbounded driver for a smoke test.
- Test both
serialize_index/deserialize_indexandwrite_index/read_indexwhen the artifact may cross a process boundary. - For a compressed index, distinguish search distance from reconstruction
error; reconstruction is generally approximate. Use
clone_indexfor a deep independent CPU copy only after checking that the index type supports cloning. - Use mmap/OnDisk only when the memory and file-lifetime trade-off is intentional. OnDisk additions are slow; build ordinary inverted lists and merge them for bulk construction.
The bundled scripts/smoke_persistence.py performs a deterministic, tiny CPU
round trip and exact-vs-IVF comparison without downloads or repository paths.
Detailed API facts, recipes, formats, and failure recovery are in the linked
references.
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).