Dask是一个数据分析的并行计算的框架。
已经集成了现有的框架,比如:numpy,pandas,scikit-learn,xgboost,lightGBM等
API与已有框架的API一致
可以扩展到上千个节点,也可以在笔记本上使用
有低阶API可供用户定制化
Familiar:数据结构一致
Flexible:提供了一个任务调度接口,可以定制化的集成其它算法
Native:纯python环境
Fast:减少了工作量,增加了并行计算,速度更快
Scales up:可以扩展到1000+cores
Scales down:可以在laptop上使用
Responsive:有诊断系统,反馈更及时
有一个Task Graph,与spark的类似
Dask有两种task scheduler
Single machine scheduler:
默认 scheduler,不用设置调用compute()方法,使用默认scheduler示例 import dask.dataframe as dd df = dd.read_csv(...) df.x.sum().compute() # This uses the single-machine scheduler by defaultDistributed scheduler
需要设置一个Client示例from dask.distributed import Client client = Client(...) # Connect to distributed cluster and override default df.x.sum().compute() # This now runs on the distributed system分为两类:
Collection example:单机处理Large Numpy/Pandas/list,类似于spark。目前80+%的Dask用户是使用这种类型。Custom example:自定义任务调度(Custom task scheduler),类似于Luigi,Airflow,Celery或Makefiles