code: def get_slurm_executor_parameters(
      nodes: int,
      num_gpus_per_node: int,
      cluster_type: Optional[ClusterType] = None,
      **kwargs,
  ) -> Dict[str, Any]:
      # create default parameters
      params = {
          "mem_gb": 0,  # Requests all memory on a node, see https://slurm.schedmd.com/sbatch.html
          "gpus_per_node": num_gpus_per_node,
          "tasks_per_node": num_gpus_per_node,  # one task per GPU
          "cpus_per_task": 10,
          "nodes": nodes,
          "slurm_partition": get_slurm_partition(cluster_type),
      }
      # apply cluster-specific adjustments
      cluster_type = get_cluster_type(cluster_type)
      if cluster_type == ClusterType.AWS:
          params["cpus_per_task"] = 12
          del params["mem_gb"]
      elif cluster_type == ClusterType.RSC:
          params["cpus_per_task"] = 12
      # set additional parameters / apply overrides
      params.update(kwargs)
      return params
  
file_path: dinov2/dinov2/utils/cluster.py
imports: from enum import Enum
  import os
  from pathlib import Path
  from typing import Any, Dict, Optional
label_desc: Use image node_id 6 for calling a global function with example usage: get_slurm_executor_parameters(nodes, num_gpus_per_node, cluster_type) and returns: params