We have a cluster with different kinds on nodes, such as GPU nodes, high-memory nodes, and regular CPU nodes. With PBS I can mix say 2 GPU and 3 CPU nodes using “+” in the select line, like this #PBS -l select=2:ncpus=28:ngpus=1+3:ncpus=28
I believe this will depend entirely on how your site has configured Slurm. At our site, GPU nodes and CPU nodes are put into separate ‘partitions’, and I am pretty sure that you cannot combine nodes from two partitions.
I also think that GPUs can be treated instead as requestable from withing a single partition, possibly via a ‘qos’ or just as ‘gpus’, in which case you may be able to do so.
This is almost certainly going to be site-dependent and configuration dependent, and you should ask your site/Slurm managers.