sdk-pipelines
Guides DataChain ingestion, UDF pipelines, datasets, exports, LLM operations, and optional ML integration workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- sdk-pipelines
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Guides DataChain ingestion, UDF pipelines, datasets, exports, LLM operations, and optional ML integration workflows.
- disable-model-invocation
- true
02 资源文件 7
- 参考文档references/api-reference.md7.1 KB
- 参考文档references/data-models-and-files.md4.0 KB
- 参考文档references/llm-operations.md5.2 KB
- 参考文档references/troubleshooting.md6.0 KB
- 参考文档references/workflows.md5.9 KB
- 脚本scripts/delta_retry_smoke.py4.5 KB
- 脚本scripts/local_io_smoke.py4.0 KB
03 SKILL.md 正文
SDK Pipelines
Use this sub-skill when the user asks for Python DataChain SDK code: reading
files or structured data, building lazy chains, writing UDFs, saving versioned
datasets, exporting outputs, using datachain.llm, or debugging checkpoint,
delta, retry, File, and DataModel behavior.
Trigger Phrases
Load this sub-skill for prompts containing or implying:
read_storage,read_csv,read_json,read_parquet,read_database,read_pandas,read_records,read_values,read_hf, orread_zarr;map,gen,agg,setup,Mapper,Generator,Aggregator, return type,params=,output=, multiprocessing, cache, prefetch, or checkpoints;.save(),.persist(),read_dataset, dataset versioning, namespace, project, metrics, parameters, delta, retry, or multi-stage pipelines;to_pandas,to_csv,to_json,to_jsonl,to_parquet,to_database,to_storage,to_pytorch,to_values, orto_list;File,ImageFile,TextFile,AudioFile,VideoFile, nested Pydantic models,DataModel, schema flattening from user return types;datachain.llm.complete,classify,score,embed, model selection, usage columns, retries/fallbacks, provider credentials, or LLM caching;- optional extras such as
datachain[torch],datachain[hf],datachain[video],datachain[vector], and failure messages from those optional imports.
First Decision
- Need API signatures or parameter rules → read api-reference.
- Need an end-to-end SDK recipe → read workflows. Start from saved datasets when reusable; use raw storage only when no existing dataset covers the input.
- Need typed files, nested outputs, or UDF parameter binding → read data-models-and-files.
- Need LLM or embedding operations → read llm-operations. LLM calls are UDF-like, expensive, cached, and should normally be saved before task-specific filters.
- Need failure diagnosis → read troubleshooting, then run local_io_smoke.py or delta_retry_smoke.py only as tiny local checks.
Core Operating Rules
- Prefer
import datachain as dc. Importmodelor Pydantic types only when needed for annotations or schemas. - A chain is lazy. Terminal operations such as
.save(),.show(),.to_values(),.to_pandas(), and file/database exports trigger execution. - Chain operations return a new chain. Assign or continue chaining the return
value; do not assume
filter,map,mutate, orselectmutates the receiver. - Any pipeline stage that runs a Python UDF, model, LLM, or expensive I/O should
end with
.save("descriptive_name"). Reuse it later withdc.read_dataset. - Save full expensive results before applying problem-specific filters; filters after the saved stage preserve compute for later tasks.
- Every UDF must have a known output type. Prefer a named function with a return
annotation; use
output=for non-strlambdas or callables you cannot annotate. - Use
params=["file.path"]or other nested column paths for metadata-only UDFs so DataChain does not download file contents just to inspect metadata. - Use
setup()for heavy resources such as models or clients. Avoid module-level lazy globals in parallel workers. - Use Query Engine operations for column math, grouping, filtering, and ranking;
reroute to sibling
query-enginefor details.
Boundaries and Reroutes
- This sub-skill owns Python SDK pipeline authoring, UDFs, saves, exports, File/DataModel types, checkpoints/delta/retry, and LLM operation usage.
- For native SQL-like operations, function families, schema/backend divergence,
or vector ranking once embeddings already exist, read
query-engine. - For
datachaincommand-line usage, Studio auth/jobs/pipelines, or environment variables as CLI behavior, readcli-and-studio. - For bundled DataChain coding-agent skills, target install layouts, or
dc-knowledge/, readagent-harness. - For source edits, nox, focused tests, or backend-sensitive contributor
invariants, read
repo-development.
Native Verification Candidates Owned Here
- Base import without optional torch dependencies: optional dependency guidance
should match the
Missing dependencies for torchimport error. - Local read/write fixtures: CSV boolean inference, nested model CSV flattening,
read_values+map/setupsmoke, and tiny save/read_dataset flows. - Delta/retry examples should be verified with synthetic tiny fixtures rather than cloud buckets or long-running examples.
- LLM examples require provider credentials and should be tested as guidance or parser contracts unless explicit credentials and budget are supplied.
Safety Rules
- Do not use original repository examples or tests as runtime dependencies. This subtree contains distilled recipes and tiny bundled helpers.
- Do not print cloud credentials, Studio tokens, LLM API keys, or local environment paths in generated code or answers.
- Do not run cloud, Studio, model-download, GPU, or credentialed examples unless the user explicitly provides access and approves the cost/side effects.
- Do not treat a local CPU smoke as proof that optional cloud, Studio, GPU, or provider-backed workflows are verified.
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).