processing-streaming
Transform map-style and iterable datasets with map/filter/batching, formatting, caching, combining, and streaming-aware workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- processing-streaming
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Transform map-style and iterable datasets with map/filter/batching, formatting, caching, combining, and streaming-aware workflows.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md8.1 KB
- 参考文档references/processing-workflows.md8.0 KB
- 参考文档references/troubleshooting.md6.1 KB
- 脚本scripts/processing_smoke.py4.4 KB
03 SKILL.md 正文
Processing and Streaming
Use this sub-skill when a task is about preparing an already-loaded Dataset, IterableDataset, DatasetDict, or IterableDatasetDict for analysis, training, export, or further processing.
For initial loading from local files or the Hub, route to ../loading-local-hub/SKILL.md. For schema declarations, feature casting, and modality feature types, route to ../features-formats/SKILL.md. For persistent cache locations, offline settings, and CLI environment concerns, route to ../sharing-cli-cache/SKILL.md.
What This Covers
- Map-style transforms:
map,filter,select,shuffle,sort,shard,train_test_split,flatten_indices, andto_iterable_dataset. - Iterable/streaming transforms: lazy
map,filter,shuffle,skip,take,shard,reshard,set_epoch, and framework iteration. - Batching and multiprocessing: batched row-count changes,
remove_columns,features,num_proc,with_indices, andwith_rank. - Formatting and conversions:
set_format,with_format, framework formatters,iter,to_pandas,to_polars, and TensorFlow/PyTorch handoff patterns. - Dataset composition:
concatenate_datasets,interleave_datasets, map-style versus iterable shard behavior. - Cache/fingerprint behavior for Arrow-backed processing and why iterable processing does not reuse map-style cache files.
Reference Routing
- Read
references/processing-workflows.mdfor practical decision trees and end-to-end patterns for map-style, streaming, batching, framework handoff, and combining datasets. - Read
references/api-reference.mdfor concrete parameter guidance, return semantics, and method differences acrossDataset,IterableDataset, and dictionary containers. - Read
references/troubleshooting.mdwhen processing fails with Arrow length/schema errors, multiprocessing pickling issues, cache reuse surprises, shuffle limitations, formatter dependency errors, or mixed type failures. - Run
scripts/processing_smoke.py --helpto see a self-contained smoke check. Run it without arguments to verify localdatasetsprocessing behavior without downloading data.
Quick Guidance
Prefer map-style Dataset when you need random access, exact length, deterministic splits, cached Arrow transforms, or repeated inspection. Prefer IterableDataset when data is too large to materialize, when streaming from files or the Hub, or when fast approximate shuffling is sufficient for training.
For batched map, every returned column must have the same length within a batch. If the function changes row counts, overwrite existing columns or pass remove_columns for columns whose old length no longer matches. If the output type should be stable, pass explicit features; for mixed Python types, review on_mixed_types in references/api-reference.md.
Use with_format(...) for non-mutating formatting and set_format(...) for in-place formatting. Framework formatters may require optional packages such as PyTorch, TensorFlow, JAX, pandas, polars, image, or audio extras; do not assume those are installed.
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).