Skip to content

Treat QoS as a first-class parameter to support flexible Partition/QoS Slurm configurations #383

@tbigot

Description

@tbigot

I'm opening this issue to suggest an improvement regarding the handling of Slurm's Quality of Service (QoS). The current implementation seems to assume that QoS is a secondary parameter, whereas for many cluster configurations, it is as fundamental as the partition itself.

Current State and Limitations

Currently, the plugin's handling of QoS is limited:

  1. The primary method for setting a QoS is via slurm_extra. While functional, this treats it as an arbitrary command-line argument rather than a structured resource that the plugin can reason about for its advanced scheduling logic.
  2. A --slurm-qos command-line option was recently added (PR feat: new flag for SLURM qos #351), but it appears primarily tied to reservation management and does not integrate natively into rule resources or profiles in the same way as partition or mem-mb.
  3. The automatic partition selection feature (PR feat!: proposal for dynamic partition selection #321) is a great step forward, but it is incomplete because it does not consider QoS. However, the maximum allowed walltime is often determined by the partition and/or the QoS, rather than by the partition alone.

Use Case: Flexible Slurm Configurations

In Slurm environments that leverage both partitions and QoS for policy enforcement, like ours, the actual job limits can be complex.

Key scheduling parameters, such as the maximum walltime (MaxWall for a QoS, MaxTime for a partition), preemption rules, or resource limits (GrpTRES), can be defined at the partition level, the QoS level, or both. Consequently, ignoring the QoS can lead to an incorrect assessment of a job's effective limits, often resulting in its rejection by the scheduler.

Concrete example from our cluster:

  • The common partition has several associated QoS:

    • qos=long: unlimited walltime
    • qos=normal: 24-hour limit
    • qos=fast: 2-hour limit (default)
    • qos=ultrafast: 5-minute limit
  • If I submit a Snakemake rule requiring walltime_min: 180 (3 hours), the plugin must specify not only --partition=common but also --qos=normal.

  • If only the partition is specified, the job will inherit the default QoS (fast), and Slurm will immediately reject it for exceeding the 2-hour limit. The current auto-partition selection mechanism would fail here, as it cannot know that by selecting a different QoS, the common partition would become a valid choice.

Proposed Solution

To make the plugin compatible with these more flexible configurations, I would suggest treating QoS as a first-class parameter:

  1. Make qos a standard submission parameter:

    • Allow its definition in a profile via a dedicated option, e.g., --slurm-qos "qos_name".
    • Allow its specification directly within a rule's resources: resources: qos="normal".
    • Snakemake would then build the sbatch command with the --qos={resources.qos} flag.
  2. Integrate QoS into the resource auto-selection logic:

    • The logic introduced in PR feat!: proposal for dynamic partition selection #321 should be extended to search for a valid (partition, qos) combination that satisfies the rule's requirements.
    • This would involve querying Slurm for the limits associated not just with partitions, but also with the QoS allowed on those partitions.

Thank you for your consideration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions