-
Notifications
You must be signed in to change notification settings - Fork 40
Description
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:
- 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. - A
--slurm-qoscommand-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 aspartitionormem-mb. - 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
commonpartition has several associated QoS:qos=long: unlimited walltimeqos=normal: 24-hour limitqos=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=commonbut 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, thecommonpartition 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:
-
Make
qosa 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
sbatchcommand with the--qos={resources.qos}flag.
- Allow its definition in a profile via a dedicated option, e.g.,
-
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.
- The logic introduced in PR feat!: proposal for dynamic partition selection #321 should be extended to search for a valid
Thank you for your consideration.