Skip to content

calculating proportionate resources with clusterscope#1797

Open
luccabb wants to merge 3 commits into
mainfrom
clusterscope
Open

calculating proportionate resources with clusterscope#1797
luccabb wants to merge 3 commits into
mainfrom
clusterscope

Conversation

@luccabb

@luccabb luccabb commented Oct 7, 2025

Copy link
Copy Markdown

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
@jrapin

jrapin commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

Hello, sorry I'd rather avoid adding new dependency, but happy to have a paragraph in the documentation to show how it can be used

@meta-cla

meta-cla Bot commented May 27, 2026

Copy link
Copy Markdown

Hi @luccabb!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

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