Token导航 LogoToken导航

Agent Skill · 研究检索

dask-optimization(DASK 优化)

dask-optimization 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

dask-optimization 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 64,379。

总安装 303周安装 13GitHub Stars 9下载 106核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dask-optimization(DASK 优化)
来源仓库:https://github.com/tondevrel/scientific-agent-skills
仓库路径:skills/dask-optimization
安装命令:
npx skills add https://github.com/tondevrel/scientific-agent-skills --skill dask-optimization
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tondevrel/scientific-agent-skills --skill dask-optimization

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

dask-optimization 针对分布式计算场景优化 Dask 作业性能和资源利用率。重点解决通信开销和网络 I/O 瓶颈,避免“KilledWorker”或内存溢出错误。当 Dask Dashboard 显示大量 red(通信)或 gray(空闲)时间时适用。

适用于处理远大于集群总内存的数据集,需权衡计算与数据传输成本。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/dask-optimization

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/tondevrel/scientific-agent-skills --skill dask…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

dask-optimization 怎么安装?

在终端执行 npx skills add https://github.com/tondevrel/scientific-agent-skills --skill dask-optimizat…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

dask-optimization 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

dask-optimization 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

dask-optimization 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

dask-optimization 用的人多吗?

公开数据是累计安装 303 次,近一周安装 13 次,下载 106 次,GitHub 9 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

dask-optimization 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
dask-optimization

DASK 优化 · 本页

3039需要联网未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Dask - Advanced Optimization & Cluster Tuning

Parallel computing is not "free". In a distributed environment, the cost of moving data (network I/O) and scheduling tasks can often exceed the computation time. This guide focuses on minimizing overhead and maximizing throughput.

When to Use

  • Your Dask jobs are failing with "KilledWorker" or "OutOfMemory" errors.
  • The Dask Dashboard shows a lot of "red" (communication) or "gray" (idle) time.
  • You need to process datasets that are 10x-100x larger than the total RAM of your cluster.
  • You are building custom distributed algorithms using dask.delayed or Futures.
  • You need to optimize resource allocation (CPU vs. Threads) for specific workloads.

Reference Documentation

Core Principles

1. Communication is the Killer

The fastest distributed task is the one that doesn't need data from another machine. Aim for data locality.

2. The Goldilocks Chunk Size

  • Too small: Scheduler is overwhelmed by millions of tiny tasks (Task Overhead).
  • Too large: Tasks don't fit in memory, causing disk spilling or worker crashes.
  • Target: 100MB - 300MB per chunk for most numeric data.

3. Computation vs. Serialization

Every object sent to a worker must be serialized (pickled). Large Python objects (like complex dicts) passed as arguments can slow down the cluster significantly.

Quick Reference: Performance Profiling

from dask.distributed import Client, performance_report

client = Client("tcp://scheduler-address:8786")

# Generate a detailed HTML report of the computation
with performance_report(filename="dask-report.html"):
    result = big_computation.compute()

# Tip: Check the "Task Stream" for gaps. Gaps mean workers are idle
# waiting for the scheduler or network.

Critical Rules

✅ DO

  • Use client.scatter - If multiple tasks need the same large piece of data, send it to workers once.
  • Prefer map_partitions - In DataFrames, this allows you to run a single optimized pandas operation per chunk instead of row-wise logic.
  • Use persist() for branching - If you use the same intermediate result in two different computations, persist() it in memory to avoid re-calculating the entire graph twice.
  • Profile with the Dashboard - Watch the "Memory" and "Task Stream" tabs in real-time.
  • Match Threads to Workload - Use many threads for I/O bound tasks (web scraping, reading files) and 1 thread per worker for CPU-bound tasks (NumPy math, ML training) to avoid Global Interpreter Lock (GIL) issues.

❌ DON'T

  • Don't use compute() in loops - This pulls data to the local machine and destroys parallel efficiency.
  • Don't pass Large Data as Arguments - Instead of delayed(func)(large_df), use large_future = client.scatter(large_df) then delayed(func)(large_future).
  • Don't ignore Data Skew - If one worker has 10GB of data and others have 100MB, the cluster is only as fast as the slowest worker. Use repartition or rechunk.
  • Don't use list(dask_collection) - This forces an immediate compute of all elements into local memory.

Data Locality & Communication

Using scatter and Futures

# ❌ BAD: Large object sent to every task (High Overhead)
large_lookup = load_heavy_dict()
results = [delayed(process)(x, large_lookup) for x in data]

# ✅ GOOD: Scatter once, use reference
[large_future] = client.scatter([large_lookup], broadcast=True)
results = [delayed(process)(x, large_future) for x in data]

Memory Management Tuning

Fighting the "KilledWorker"

Worker memory has thresholds:

  • Target (0.6): Dask tries to stay below this.
  • Spill (0.7): Dask starts moving data to disk.
  • Pause (0.8): Worker stops accepting new tasks.
  • Terminate (0.95): OS or Dask kills the worker.
# Adjusting worker limits via config (distributed.yaml or code)
import dask
dask.config.set({"distributed.worker.memory.target": 0.45})
dask.config.set({"distributed.worker.memory.spill": 0.55})

Task Graph Optimization

Fusing Operations

Dask automatically "fuses" many operations into one task to reduce scheduler overhead.

# Multiple operations on a DataArray
da = da + 1
da = da * 2
da = da.sum()

# When computing, Dask optimizes the graph
# You can inspect it:
da.visualize(filename='graph.pdf', optimize_graph=True)

Practical Workflows

1. Optimizing Large Joins (Shuffling)

Joins are expensive because they require moving data between workers (shuffling).

def optimized_join(left_ddf, right_ddf):
    # 1. Ensure right side is small enough to be broadcasted
    # or ensure both are partitioned by the join key.

    # If one DF is small (e.g. < 100MB)
    # result = left_ddf.map_partitions(lambda df: df.merge(small_df_local, on='key'))

    # 2. If both are large, set the index first (triggers a shuffle once)
    left_ddf = left_ddf.set_index('key')
    right_ddf = right_ddf.set_index('key')

    # 3. Subsequent joins will be "locally aligned" (Zero communication)
    return left_ddf.merge(right_ddf, left_index=True, right_index=True)

2. High-Throughput I/O with Parquet

def fast_save(ddf, path):
    # 1. Categorical columns save massive space
    ddf = ddf.categorize()

    # 2. Write with efficient compression
    # 'snappy' is usually the best balance for speed
    ddf.to_parquet(path, engine='pyarrow', compression='snappy',
                   write_metadata_file=True)

3. Managing a Long-running Cluster

# Prevent a "dirty" cluster from slowing down
def clean_cluster_state():
    client.cancel(list(client.futures)) # Clear all references
    client.restart() # Hard reset all workers
    import gc
    gc.collect() # Local cleanup

Advanced Configuration

Resource Tagging

Tell Dask to run specific tasks only on specific workers (e.g., those with a GPU).

# Start worker with: dask-worker ... --resources "GPU=1"

# Submit task requesting resource
future = client.submit(my_gpu_function, data, resources={'GPU': 1})

Common Pitfalls and Solutions

The "Zombie Worker" (serialization error)

If your task requires a library that isn't installed on the workers, the task will fail repeatedly.

# ✅ Solution: Use pip_install or conda_install via client
from dask.distributed import PipInstall
client.register_plugin(PipInstall(packages=["scikit-learn"]))

Unmanaged Memory

Python's garbage collector isn't immediate. Sometimes workers appear full because "Unmanaged Memory" hasn't been freed.

# ✅ Solution: Manually trigger GC on workers
def worker_gc():
    import gc
    return gc.collect()

client.run(worker_gc)

Too Many Partitions

If you have 10,000 partitions for a 1GB dataset, you'll spend more time scheduling than calculating.

# ✅ Solution: Repartition to fewer pieces
ddf = ddf.repartition(npartitions=20)

Dask Optimization is the art of balancing resources. By understanding the flow of data through the network and the mechanics of worker memory, you can scale Python logic to planetary-scale datasets with industrial reliability.

平台分布

Codex

35.07%
按下载量换算37

Claude

32.21%
按下载量换算34

Cursor

20.97%
按下载量换算22

Gemini CLI

9.42%
按下载量换算10

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills