distributed-execution
Choose and debug img2dataset distributed execution, throughput tuning, logging, and large-scale operations.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- distributed-execution
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Choose and debug img2dataset distributed execution, throughput tuning, logging, and large-scale operations.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/distributed-execution.md8.5 KB
- 参考文档references/performance-tuning.md8.7 KB
- 参考文档references/troubleshooting.md7.2 KB
- 脚本scripts/check_distributed_backends.py10.6 KB
- 脚本scripts/pyspark_download_template.py8.4 KB
03 SKILL.md 正文
distributed-execution
Use this sub-skill when an img2dataset task depends on execution scale rather than on URL-table schema, image transforms, or core downloader options: choosing a distributor, preparing PySpark or Ray, tuning throughput, reading speed/status logs, enabling W&B, or debugging slow and failed distributed shards.
Triggers
- The user asks which
--distributorto use. The supported values are exactlymultiprocessing,pyspark, andray. - The user mentions PySpark, SparkSession, Java, Spark clusters, Ray clusters, or distributed workers.
- The user needs to tune
processes_count,thread_count,subjob_size,number_sample_per_shard, ormax_shard_retryfor a large run. - The user has low images/sec, many failed shards, W&B/account issues, DNS bottlenecks, object-store filesystem questions, or wants to interpret stats and status logs.
Route elsewhere
- Core command construction, HTTP retries, SSL, hash verification, incremental mode, user-agent, and X-Robots-Tag handling: route to
../core-download/SKILL.md. - Input formats, URL/caption/additional columns, output layouts, shard metadata schemas, and TFRecord writer details: route to
../input-output-formats/SKILL.md. - Resize modes, encoding, interpolation, image filters,
skip_reencode,disable_all_reencoding, and bbox blurring: route to../image-processing/SKILL.md.
Short workflow
- Confirm the target scale and runtime: single host, Spark cluster, or Ray cluster. If optional backends are uncertain, run
python scripts/check_distributed_backends.py --jsonfrom this sub-skill directory. - Choose one exact distributor value using
references/distributed-execution.md. - Size local work with
processes_countandthread_count; size PySpark dispatch withsubjob_size; choose a retry policy withmax_shard_retryand a restartable output folder. - Prefer
webdatasetfor large datasets unless another sibling sub-skill's format contract requires a different output format. - Enable observability deliberately: stats files are always written;
--enable_wandb=Trueadds W&B metrics/status tables when account or anonymous logging is acceptable. - If throughput or failures are poor, use
references/performance-tuning.mdfirst, thenreferences/troubleshooting.mdfor backend-specific errors.
Critical gotchas
- PySpark requires
pysparkand a Java runtime. If no activeSparkSessionexists, img2dataset creates a local session withlocal[processes_count]and stops it afterward; if a session already exists, img2dataset uses it and leaves ownership to the caller. - Ray is optional. In the current implementation, missing Ray can make the Ray distributor a no-op, so verify Ray before selecting
--distributor ray. - Avoid outdated Ray
local_mode=Trueguidance; use currentray.init(...)patterns such asray.init(num_cpus=1)for a short local smoke orray.init(address="auto")for a cluster. max_shard_retryis an end-of-run shard retry loop for multiprocessing and PySpark. The current Ray path does not apply that retry loop.
References and scripts
references/distributed-execution.md— mode decision tree, PySpark/Ray/SparkSession behavior, self-contained command templates.references/performance-tuning.md— process/thread/shard sizing, bottleneck diagnosis, W&B/stat usage, filesystem and benchmark guidance.references/troubleshooting.md— missing optional dependencies, Java/Spark/Ray/W&B/DNS/filesystem failure modes.scripts/pyspark_download_template.py— dry-run-first PySpark download template; only imports Spark/img2dataset for--runor--check-backends.scripts/check_distributed_backends.py— safe optional-backend checker for PySpark, Java, Ray, TensorFlow/TFIO, W&B, and fsspec.
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).