Skip to content

Conversation

@luccabb
Copy link
Member

@luccabb luccabb commented Oct 4, 2025

Summary

showing on the CLI --gpus-per-task and --cpus-per-task as mutually exclusive

Test Plan

$ cscope job-gen task slurm --help
Usage: cscope job-gen task slurm [OPTIONS]

  Generate job requirements for a task of a Slurm job based on GPU or CPU per
  task requirements.

Options:
  --partition TEXT                Partition to query  [required]
  --tasks-per-node INTEGER        Number of tasks per node to request
  --format [json|sbatch|srun|submitit|salloc]
                                  Format to output the job requirements in
  GPU or CPU Job Request: [mutually_exclusive, required]
                                  Only one of --gpus-per-task or --cpus-per-
                                  task can be specified. For GPU requests, use
                                  --gpus-per-task and cpus-per-task will be
                                  generated automatically. For CPU requests,
                                  use --cpus-per-task.
    --gpus-per-task INTEGER RANGE
                                  Number of GPUs per task to request  [x>=1]
    --cpus-per-task INTEGER RANGE
                                  Number of CPUs per task to request  [x>=1]
  --help                          Show this message and exit.
$ cscope job-gen task slurm --gpus-per-task=4 --partition=h200
{
  "cpus_per_task": 96,
  "memory": "999G",
  "tasks_per_node": 1,
  "slurm_partition": "h200",
  "gpus_per_task": 4,
  "mem_gb": 999
}
$ cscope job-gen task slurm --gpus-per-task=4 --cpus-per-task=2 --partition=h200
Usage: cscope job-gen task slurm [OPTIONS]
Try 'cscope job-gen task slurm --help' for help.

Error: Mutually exclusive options from 'GPU or CPU Job Request' option group cannot be used at the same time:
  '--gpus-per-task'
  '--cpus-per-task'
$ cscope job-gen task slurm --cpus-per-task=2 --partition=h200
{
  "cpus_per_task": 2,
  "memory": "20G",
  "tasks_per_node": 1,
  "slurm_partition": "h200",
  "mem_gb": 20
}

@luccabb luccabb requested review from gunchu and skalyan as code owners October 4, 2025 01:12
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 4, 2025
Copy link

@gunchu gunchu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully this doesn't mess with dependencies for codebases that include clusterscope!
🤞

@skalyan
Copy link
Contributor

skalyan commented Oct 6, 2025

Hopefully this doesn't mess with dependencies for codebases that include clusterscope! 🤞

What are the possible risks?

@luccabb
Copy link
Member Author

luccabb commented Oct 6, 2025

@skalyan @gunchu

What are the possible risks?

the environment has to satisfy click-option-group requirements, which may trigger updates if click is below 6 on the environment for example:

dependencies = [
    'Click>=7.0',
]

7.0 was released in 2018, seems ok

@luccabb luccabb merged commit 8c80e2c into main Oct 6, 2025
17 checks passed
@luccabb luccabb deleted the exc_cli branch October 6, 2025 20:43
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 Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants