简体   繁体   English

插入:选择并行后端的正确核心数

[英]caret: Choosing the correct number of cores in parallel backend

I am trying to use caret to cross-validate an elastic net model using the glmnet implementation on an Ubuntu machine with 8 CPU cores & 32 GB of RAM. 我正在尝试使用caret在Ubuntu机器上使用glmnet实现来交叉验证弹性网络模型,该机器具有8个CPU内核和32 GB RAM。 When I train sequentially, I am maxing out CPU usage on one core, but using 50% of the memory on average. 当我顺序训练时,我在一个核心上最大化CPU使用率,但平均使用50%的内存。

  • When I use doMC(cores = xxx) , do I need to worry about only registering xxx = floor(100/y) cores, where y is the memory usage of the model when using a single core (in %), in order to not run out of memory? 当我使用doMC(cores = xxx) ,我是否需要担心只注册xxx = floor(100 / y)内核,其中y是使用单个内核(以%为单位)时模型的内存使用量,以便没有内存不足?

  • Does caret have any heuristics that allow it to figure out the max. caret是否具有允许其计算出最大值的任何启发式方法。 number of cores to use? 要使用的核心数量?

  • Is there any set of heuristics that I can use to dynamically adjust the number of cores to use my computing resources optimally across different sizes of data and model complexities? 是否有任何启发式方法可用于动态调整内核数量,以便在不同大小的数据和模型复杂性中最佳地使用我的计算资源?


Edit: 编辑:

FWIW, attempting to use 8 cores made my machine unresponsive. FWIW,尝试使用8个核心使我的机器没有响应。 Clearly caret does not check to see if the spawning xxx processes is likely to be problematic. 显然, caret不会检查产生xxx进程是否可能存在问题。 How can I then choose the number of cores dynamically? 然后,我如何动态选择核心数?

Clearly caret does not check to see if the spawning xxx processes is likely to be problematic. 显然,插入符号不会检查产生xxx进程是否可能存在问题。

True; 真正; it cannot predict future performance of your computer. 它无法预测您计算机的未来性能。

You should get an understanding of how much memory you use for modeling use when running sequentially. 您应该了解在顺序运行时用于建模的内存量。 You can start the training and use top or other methods to estimate the amount of ram used then kill the process. 您可以开始训练并使用top或其他方法来估计使用的ram数量然后终止该过程。 If sequentially you use X GB of RAM sequentially, running on M cores will require X(M+1) GB of ram. 如果按顺序依次使用X GB的RAM,则在M核上运行将需要X(M + 1) GB的RAM。

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

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