Skip to content

Conversation

@luccabb
Copy link

@luccabb luccabb commented Oct 7, 2025

clusterscope has an API to calculate proportionate resource usage in the machine (CPUs / Mem) given the number of GPUs or CPUs.

that is, for GPU requests:

if a slurm partition has nodes with 8 gpus, 80 cpus, 80GB; and a user ask for a single gpu:

>>> resources = clusterscope.job_gen_task_slurm(gpus_per_task=1, partition=...)

clusterscope returns a dict with 10 cpus (1/8 gpus * 80 cpus) and 10GB (1/8 gpus * 80GB) assigned:

>>> resources
{'cpus_per_task': 10, 'memory': '10G', 'tasks_per_node': 1, 'mem_gb': 10', slurm_partition': 'h100', ...}

notice how this dict allocates the proportionate amount of cpus and mem based on the number of gpus in the request.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 7, 2025
@luccabb luccabb requested a review from jrapin October 7, 2025 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants