serialization-storage
Serialize, persist, stream, and route DocArray BaseDoc, DocList, DocVec, file store, S3, and FastAPI payload workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- serialization-storage
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Serialize, persist, stream, and route DocArray BaseDoc, DocList, DocVec, file store, S3, and FastAPI payload workflows.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/serialization-reference.md11.0 KB
- 参考文档references/storage-reference.md8.2 KB
- 参考文档references/troubleshooting.md8.8 KB
- 脚本scripts/roundtrip_smoke.py11.4 KB
03 SKILL.md 正文
DocArray serialization and storage
Use this sub-skill when a task needs to move DocArray objects across process, file, tabular, web, or object-store boundaries.
Route here for
- Choosing JSON, protobuf, bytes, base64, binary file, CSV, or DataFrame formats for
BaseDoc,DocList, andDocVec. - Preserving or deliberately changing
DocVectensor backend withtensor_type=...during deserialization. - Saving and loading
DocListorDocVecbinaries, including streaming-safe single-document protocols. - Using
DocList.push(),DocList.pull(),push_stream(), andpull_stream()withfile://stores. - Documenting S3
DocListstore requirements and constraints before credentials or network access are available. - Returning DocArray documents and JSON payloads from FastAPI with
DocArrayResponse. - Diagnosing missing
proto,pandas,web, orawsextras and protocol mismatch failures.
Route elsewhere
- Schema design, predefined documents, nested document modeling, and tensor field choices before serialization: use sibling
document-modeling. - Vector indexes, nearest-neighbor search, document indexes, or vector database backends: use sibling
vector-indexing. - Live S3 operations that require credentials, buckets, endpoints, or network access: verify those separately in the future task before relying on them.
Read these bundled references
- Start with Serialization reference for the protocol matrix, exact method names,
DocVec tensor_typebehavior, CSV/DataFrame caveats, and FastAPI response routing. - Use Storage reference for
file://and S3DocListstore behavior, streaming, list/delete operations, path requirements, and optional service constraints. - Use Troubleshooting when optional extras, protobuf unions, CSV tensor fields, file namespace paths,
local_cache, S3 credentials, or FastAPI imports fail.
Safe bundled helper
Run roundtrip_smoke.py in any environment where DocArray is installed to exercise safe local round-trips without external services:
Run these commands from this sub-skill root (the directory containing this SKILL.md):
python scripts/roundtrip_smoke.py --help
python scripts/roundtrip_smoke.py
python scripts/roundtrip_smoke.py --skip-protobuf --skip-dataframe --skip-file-store
The verified minimum scope is CPU with DocArray base plus proto, pandas, and web extras. Optional S3/AWS services and optional tensor frameworks are documented as boundaries, not verified defaults.
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).