简体   繁体   English

可以在Google Datalab中使用多个CPU核心吗?

[英]Can multiple CPU cores be used in Google Datalab?

If the answer is yes, what will be a simple example to test this capability? 如果答案是肯定的,那么测试此功能的简单示例是什么?

I have tried to use the multiprocessing capabilities of SFrame and implicit. 我试图使用SFrame的多处理功能和隐式。 But the CPU utilization is always below 10% of a n1-highmem-32 (32 vCPUs, 208 GB memory) instance. 但CPU利用率始终低于n1-highmem-32(32个vCPU,208 GB内存)实例的10%。

import os
os.environ['OMP_NUM_THREADS'] = "25"
import sframe
sframe.set_runtime_config('GRAPHLAB_DEFAULT_NUM_PYLAMBDA_WORKERS', 25)


import implicit
item_factors, user_factors = implicit.alternating_least_squares(train, 2)

Sorry about the delay in answering. 对于延迟回答感到抱歉。 Jupyter Python kernel itself is single threaded. Jupyter Python内核本身是单线程的。 I am not certain about the specific sframe library but this is not something where Datalab does anything special either way. 我不确定具体的sframe库,但这不是Datalab以任何方式做任何特殊事情的事情。 We use the standard Python kernel in Jupyter. 我们在Jupyter中使用标准的Python内核。 Perhaps you could tag your question as an sframe one? 也许你可以将你的问题标记为sframe一个?

We have seen some customers use n CPUs for a team so that separate kernels can run on separate CPUs. 我们已经看到一些客户为团队使用n个CPU,以便单独的内核可以在不同的CPU上运行。 However, in general, high-mem options are a better bet than multi-CPU VMs for a single user. 但是,通常,对于单个用户,高内存选项比多CPU虚拟机更好。

Separately, we have released a beta refresh that will let you run Datalab locally with an option to run the kernel in GCE. 另外,我们发布了一个测试版刷新版,可让您在本地运行Datalab,并提供在GCE中运行内核的选项。 If you are interested, please take a look at: https://cloud.google.com/datalab/docs/quickstarts/ 如果您有兴趣,请查看: https//cloud.google.com/datalab/docs/quickstarts/

Thanks. 谢谢。 Dinesh Kulkarni Product Manager, Datalab & Cloud ML Dinesh Kulkarni Datalab和Cloud ML产品经理

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM