Ticket 16769

Summary: how to allow cpu-only jobs to run on gpu node
Product: Slurm Reporter: Amy Wang <amy.wang>
Component: ConfigurationAssignee: Director of Support <support>
Status: RESOLVED INFOGIVEN QA Contact:
Severity: 4 - Minor Issue    
Priority: --- CC: benny
Version: 21.08.5   
Hardware: Linux   
OS: Linux   
Site: MicroGenDX Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---
Attachments: slurm.conf
gres.conf

Description Amy Wang 2023-05-18 13:43:11 MDT
Hello Support Team,

We are running Slurm version 21.08.5 on our RockyLinux v8 cluster. We would like to tune our Slurm configurations to allow users to run CPU-only jobs on the GPU node. The following are what we have regarding the GPU node/partition. 

In slurm.conf we have:

DebugFlags=Gres
GresTypes=gpu,mps
NodeName=gpu[1] NodeAddr=10.1.1.101 Gres=gpu:v100:1,mps:200 CPUs=64 Boards=1 SocketsPerBoard=2 CoresPerSocket=16 ThreadsPerCore=2 RealMemory=63884 Feature=gpu,v100
PartitionName=gpu Nodes=gpu[1] Default=NO MaxTime=INFINITE State=UP AllowAccounts=root,default,clinical_acct

In gres.conf we have:
NodeName=gpu[1] AutoDetect=nvml Name=gpu Type=v100 File=/dev/nvidia0

Please advise what we can do to modify Slurm configurations and use what options with sbatch to be able to run CPU-only jobs on the GPU node and not to affect regular GPU job submissions.

Thanks in advance!

Amy
Comment 1 Benny Hedayati 2023-05-19 05:07:34 MDT
Hi,

If I understand correctly, you wish to submit jobs to GPU partition with only cpu requirements?  If a job requests memory, you wish to reject this job from submission?

Thanks for clarifying
Comment 2 Amy Wang 2023-05-19 07:47:01 MDT
Thanks Benny for your reply.

To your questions,

----If I understand correctly, you wish to submit jobs to GPU partition with only cpu requirements?  

Yes, we are trying to submit CPU-only jobs to the GPU partition

----If a job requests memory, you wish to reject this job from submission?

No, jobs to submit will require memory.

Thanks much for your help on this!

Regards,
Amy
Comment 3 Benny Hedayati 2023-05-19 07:55:22 MDT
Ok, thanks for the clarification.  Can you supply a job submit request that you wish to deny?  I just want to be sure as to the best way to guide you towards a solution.

Thanks
Comment 4 Amy Wang 2023-05-19 08:33:11 MDT
Hi Benny,

Here is a test job submission script that we used but it cannot be scheduled based on the current Slurm configurations.

#!/bin/bash
#SBATCH --job-name=testjob-serial
#SBATCH --output=%x.o%j
#SBATCH --partition=gpu
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --gres-flags=disable-binding
#SBATCH --mem-per-cpu=500MB  
module load gnu9
./testrun

When submitting this test job, it returned the following errors.

sbatch: error: The 'gpu' partition requires a minimum of one GPU/Gres per node: [-G,--gpus,--gress,--gpus-per-node]
sbatch: error: Batch job submission failed: Job size specification needs to be provided

Please let me know if you need other info. Thanks again for your help!


Amy
Comment 5 Benny Hedayati 2023-05-19 08:51:33 MDT
Ok thanks, I am just confused as to what you mean by "CPU-only jobs on the GPU node.".  If you can clarify this, it would be quite helpful.  Also, so I can get a full picture of your current configuration, can you please attach your current slurm.conf and gres.conf.

Thanks
Comment 6 Amy Wang 2023-05-19 09:19:25 MDT
Created attachment 30375 [details]
slurm.conf
Comment 7 Amy Wang 2023-05-19 09:21:13 MDT
Created attachment 30376 [details]
gres.conf

Please find the attached slurm.conf and gres.conf files.

The cpu-only job means the job only require CPU cores to run, not GPU.

Thanks,
Amy
Comment 8 Benny Hedayati 2023-05-19 09:25:26 MDT
Ok, I see.  Thanks again for sharing that information.  Do you have a job_submit filter in place by any chance?  If so, can you please share that as well?

Thanks
Comment 9 Benny Hedayati 2023-05-19 11:22:39 MDT
One option you have is to make one of your existing partitions include the GPU node, or create a separate partition that has the GPU node that is specifically for cpu-only jobs to use the GPU node when it's idle and then you can configure preemption for it to insure that GPU jobs have a priority.  

If you're not familiar with Slurm preemption, here is some documentation to get you started:

https://slurm.schedmd.com/preempt.html

If you decide to go down this path, I can explain more thoroughly how you could set this up but, for now, I just wanted to give you an introduction.

Another option is to set MaxTime in your "cpu-only" partition to allow so that it only allows short running jobs.  This way the main GPU partition never wait too long.

Please let me know if you have any questions regarding this.

Thanks
Comment 10 Amy Wang 2023-05-19 11:46:18 MDT
Hi Benny,

Thanks very much for your advice! Sounds good, I'll try to create a separate partition to allow CPU-only jobs. Then setup for the preemption. Will let you know if I end up with issues. 

Thanks,
Amy
Comment 11 Benny Hedayati 2023-05-19 12:08:41 MDT
You're welcome.  Let me know if you have any issues.

Thanks
Comment 12 Benny Hedayati 2023-05-31 07:39:13 MDT
Hi,

Just for completeness of this ticket, I will go ahead and close.  If you have any further questions or concerns please don't hesitate to re-open and we will be happy to assist you further.

Thanks