我在 gcp 上的 kubernetes 集群上运行tpot和 dask,集群是 24 核 120 gb 内存和 4 个 kubernetes 节点,我的 kubernetes yaml 是
apiVersion: v1
kind: Service
metadata:
name: daskd-scheduler
labels:
app: daskd
role: scheduler
spec:
ports:
- port: 8786
targetPort: 8786
name: scheduler
- port: 8787
targetPort: 8787
name: bokeh
- port: 9786
targetPort: 9786
name: http
- port: 8888
targetPort: 8888
name: jupyter
selector:
app: daskd
role: scheduler
type: LoadBalancer
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: daskd-scheduler
spec:
replicas: 1
template:
metadata:
labels:
app: daskd
role: scheduler
spec:
containers:
- name: scheduler
image: uyogesh/daskml-tpot-gcpfs # CHANGE THIS TO BE YOUR DOCKER HUB IMAGE
imagePullPolicy: Always
command: ["/opt/conda/bin/dask-scheduler"]
resources:
requests:
cpu: 1
memory: 20000Mi # set aside some extra resources for the scheduler
ports:
- containerPort: 8786
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: daskd-worker
spec:
replicas: 3
template:
metadata:
labels:
app: daskd
role: worker
spec:
containers:
- name: worker
image: uyogesh/daskml-tpot-gcpfs # CHANGE THIS TO BE YOUR DOCKER HUB IMAGE
imagePullPolicy: Always
command: [
"/bin/bash",
"-cx",
"env && /opt/conda/bin/dask-worker $DASKD_SCHEDULER_SERVICE_HOST:$DASKD_SCHEDULER_SERVICE_PORT_SCHEDULER --nthreads 8 --nprocs 1 --memory-limit 5e9",
]
resources:
requests:
cpu: 2
memory: 20000Mi
我的数据是 400 万行和 77 列,每当我在 tpot 分类器上运行 fit 时,它都会在 dask 集群上运行一段时间然后崩溃,输出日志看起来像
KilledWorker:
("('gradientboostingclassifier-fit-1c9d29ce92072868462946c12335e5dd',
0, 4)", 'tcp://10.8.1.14:35499')
我尝试按照 dask 分布式文档的建议增加每个工作人员的线程数,但问题仍然存在。我提出的一些意见是:
如果 n_jobs 较少(对于 n_jobs=4,它在崩溃前运行了 20 分钟)则崩溃需要更长的时间,而 n_jobs=-1 会立即崩溃。
它实际上会开始工作并为更少的数据获得优化的模型,10000 个数据它可以正常工作。
所以我的问题是,我需要进行哪些更改和修改才能完成这项工作,我想它是可行的,因为我听说 dask 能够处理比我更大的数据。