How Slurm HRES Plugins Integrate Quantum Processors into Supercomputing Scheduling: Why Traditional Resource Models Fail to Adapt to QPUs
Quantum processors are being installed in supercomputing centers worldwide, running alongside high-performance computing systems. For scientists in fields such as chemistry, weather modeling, and engineering simulation, the QPU is simply another accelerator—like CPUs and GPUs—that they wish to request, reserve, and execute using familiar methods. However, prior to Slurm 26.11, the scheduler lacked a native way to model QPUs as schedulable resources. Integration solutions at each site were repeatedly customized, users faced different interfaces depending on the site, administrators struggled to maintain proprietary code that was difficult to upgrade, and QPU vendors had to rebuild integrations for every customer.
The root of the problem lies in the structural mismatch between the physical attributes of QPUs and Slurm's existing resource models. QPUs are typically cluster-wide accelerators and do not belong to any single compute node. Slurm's Generic Resource (GRES) mechanism, used for GPUs, binds devices to specific nodes—if that node fails, the QPU becomes unreachable until an administrator reconfigures the cluster. Another common approach combines licenses with SPANK plugins: while licenses represent cluster-wide resources, SPANK only intervenes after a node has been allocated, meaning a job can hold compute nodes idle while waiting for the QPU. Furthermore, multiple SPANK plugins for different QPUs compete for the same command-line options, and many rely on Slurm's internal APIs, creating a risk of breakage with every upgrade. Crucially, Slurm itself cannot detect whether a QPU is undergoing calibration or is offline, leading it to launch jobs that cannot utilize the device.
The Hierarchical Resources (HRES) plugin interface introduced in Slurm 26.11 addresses these gaps. HRES was added to Slurm 25.05 as a test feature and represents an evolution of licenses. Like a license, an HRES is a count of a cluster-level resource that does not belong to any single node; unlike a license, this count is associated with a specific set of nodes—the ones permitted to use the resource. Sites describe the QPU as a cluster-level HRES in resources.yaml, specify which nodes can access the device, and point to a short Lua script for the resource logic. This division of labor, with resources.yaml holding site-specific endpoints and policies and the Lua plugin handling device logic, allows the plugin to be written once and reused across sites.
The core capabilities of the plugin manifest during key callbacks in the job lifecycle. The maintenance callback queries middleware for QPU status at set intervals, setting or clearing disable_layer flags to stop or resume allocation. The controller job prerun callback performs admission checks after a job is scheduled but before nodes are allocated, ensuring that jobs do not hold idle nodes while waiting for the QPU. Because the prerun holds the controller's job lock, time-consuming reservation operations are placed in an optional asynchronous prerun, with the payload sent by Slurm to the job nodes. If a job fails to start, a revoke callback cancels the reservation, and a controller epilog callback releases the resources upon job completion.
Quellen:NVIDIA Technical Blog