简体   繁体   English

如何使用Slurm访问群集中不同节点上的GPU?

[英]How to access to GPUs on different nodes in a cluster with Slurm?

I have access to a cluster that's run by Slurm, in which each node has 4 GPUs. 我可以访问由Slurm运行的集群,其中每个节点有4个GPU。

I have a code that needs 8 gpus. 我有一个需要8 gpus的代码。

So the question is how can I request 8 gpus on a cluster that each node has only 4 gpus? 所以问题是如何在群集上请求8 gpus,每个节点只有4 gpus?

So this is the job that I tried to submit via sbatch : 所以这是我尝试通过sbatch提交的工作:

#!/bin/bash
#SBATCH --gres=gpu:8              
#SBATCH --nodes=2               
#SBATCH --mem=16000M              
#SBATCH --time=0-01:00     

But then I get the following error: 但后来我收到以下错误:

sbatch: error: Batch job submission failed: Requested node configuration is not available    

Then I changed my the settings to this and submitted again: 然后我将设置更改为此并再次提交:

#!/bin/bash
#SBATCH --gres=gpu:4              
#SBATCH --nodes=2               
#SBATCH --mem=16000M              
#SBATCH --time=0-01:00  
nvidia-smi

and the result shows only 4 gpus not 8. 结果显示只有4 gpus而不是8 gpus。

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 375.66                 Driver Version: 375.66                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla P100-PCIE...  Off  | 0000:03:00.0     Off |                    0 |
| N/A   32C    P0    31W / 250W |      0MiB / 12193MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   1  Tesla P100-PCIE...  Off  | 0000:04:00.0     Off |                    0 |
| N/A   37C    P0    29W / 250W |      0MiB / 12193MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   2  Tesla P100-PCIE...  Off  | 0000:82:00.0     Off |                    0 |
| N/A   35C    P0    28W / 250W |      0MiB / 12193MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   3  Tesla P100-PCIE...  Off  | 0000:83:00.0     Off |                    0 |
| N/A   33C    P0    26W / 250W |      0MiB / 12193MiB |      4%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Thanks. 谢谢。

Slurm does not support what you need. Slurm不支持​​您的需求。 It only can assign to your job GPUs/node, not GPUs/cluster. 它只能分配给您的作业GPU /节点,而不是GPU /集群。 So, unlike CPUs or other consumable resources, GPUs are not consumable and are binded to the node where they are hosted. 因此,与CPU或其他可消耗资源不同,GPU不是可消耗的,并且绑定到托管它们的节点。

If you are interested in this topic, there is a research effort to turn GPUs into consumable resources, check this paper . 如果您对此主题感兴趣,可以通过研究将GPU转换为可消耗资源,请查看本文 There you'll find how to do it using GPU virtualization technologies. 在那里,您将找到使用GPU虚拟化技术的方法。

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

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