topology.yaml(5)
π NAME π
topology.yaml β the Slurm config file for the topology plugins, aka the glow-up your cluster's network layout deserves π
β¨ DESCRIPTION β¨
Okay bestie, so topology.yaml is a YAML-formatted configuration file that defines multiple network topologies for optimizing job resource allocation in Slurm. Yes, it's a lot of words, but the vibe is: it tells Slurm how your nodes are wired together so it stops being messy about where it puts your jobs π¦
The file must be located in the same directory as slurm.conf. No exceptions, no "but I put it somewhere cute". Same directory. Periodt.
Any text following a # in this file is treated as a comment through the end of that line. So go off, annotate your heart out π¬
Additional details are available in topology.conf(5) and in the Topology Guide:
https://slurm.schedmd.com/topology.html
π NOTE: Slurm will first check fortopology.yaml. If this file exists,topology.confwill be ignored. Like, fully ghosted. So don't leave a stale one lying around, iykyk π
π PARAMETERS π
Each topology contains the following attributes:
topologyβ the unique name of the topology. It gets used to identify it on partition configurations. This one must be the first attribute. Front of the line, main character energy πcluster_defaultβ the first topology defined withcluster_default: truegets used for partitions without an explicitly specified topology, plus cluster-wide operations not tied to a partition (e.g., slurmctld-to-slurmd communication). Defaults tofalse.
Each topology must also define exactly one of the following topology types:
blockβ this topology will use thetopology/blockplugin. Must contain additional fields, see below.flatβ if set totrue, this topology will use thetopology/flatplugin, which is the default if noTopologyPluginortopology.yamlis specified. May also be set to a dictionary of options, see "Flat definitions" below.ringβ this topology will use thetopology/ringplugin. Must contain additional fields, see below.torus3dβ this topology will use thetopology/torus3dplugin. Must contain additional fields, see below.treeβ this topology will use thetopology/treeplugin. Must contain additional fields, see below.
π§± Block definitions π§±
Each block topology contains the following attributes:
block_sizesβ list of the planning base block size, alongside any higher-level block sizes that would be enforced. SuccessiveBlockSizesmust be a power of two larger than the prior values. Math is math, bestie π’blocksβ list of blocks available in this topology. Each block contains the following attributes:blockβ the name of a block. This name is internal to Slurm and arbitrary. Each block should have a unique name. This field must be specified.nodesβ child nodes of the named block.
π³ Tree definitions π³
Each tree topology contains the following attribute:
switchesβ list of switches available in this topology. Each switch contains the following attributes:switchβ the name of a switch. This name is internal to Slurm and arbitrary. Each switch should have a unique name. This field must be specified and cannot be longer than 64 characters. Keep it snappy πchildrenβ child switches of the named switch.nodesβ child nodes of the named leaf switch.
π Ring definitions π
Each ring topology contains the following attribute:
ringsβ list of rings available in this topology. Each ring contains the following attributes:ringβ the name of a ring. This name is internal to Slurm and arbitrary. Each ring should have a unique name. This field must be specified.nodesβ ordered list of child nodes in the ring. A maximum of 16 nodes can be specified per ring. Sixteen. Not seventeen. Not "like eighteen". Sixteen π«Ά
π© Torus3d definitions π©
Each torus3d topology contains the following attribute:
torusesβ list of 3D torus definitions. Each torus contains the following attributes:nameβ the name of the torus. This name is internal to Slurm and arbitrary. Each torus should have a unique name. This field must be specified.dimsβ the dimensions of the torus as an object withx,y, andzfields (each a positive integer). The productx*y*zdefines the total number of coordinate cells in the torus.nodesβ child nodes of the torus. Nodes are mapped to coordinates in x-major order (xvaries fastest). Mutually exclusive withregions.regionsβ list of regions within the torus that map subsets of coordinates to nodes. Mutually exclusive withnodes. Each region contains the following attributes:anchorβ starting coordinate of the region as an object withx,y, andzfields.dimsβ size of the region as an object withx,y, andzfields. The region covers coordinates fromanchortoanchor + dims - 1. The region must fit within the torus dimensions (no wrap-around). No sneaking past the edge, babes π«nodesβ nodes to place in the region, mapped in x-major order within the region's coordinate range.
placementsβ list of allowed placement shapes for this torus. Jobs requesting a number of nodes matching a placement size will be allocated as a contiguous sub-cube that may wrap around torus boundaries. Jobs that don't match any placement size will not receive an allocation. So if your job size isn't in the listβ¦ it's giving nothing, it's getting nothing π Each placement contains the following attributes:dimsβ dimensions of the placement shape as an object withx,y, andzfields. The productx*y*zdefines the placement size (number of nodes).anchor_seedβ optional starting coordinate offset for the anchor grid as an object withx,y, andzfields. Shifts the entire anchor grid by the given offset. Defaults to{0, 0, 0}.anchor_spacingβ optional spacing between placement anchors as an object withx,y, andzfields. Controls how anchor positions are generated across the torus. Defaults to the placementdimsif not specified.
π¦ Flat definitions π¦
Each flat topology may contain the following attribute:
alpha_step_rankβ if set totrue, sort the job's allocated nodes alphabetically by name when picking step nodes and laying out tasks. By default the order follows the internal node table index, which for dynamically registered nodes reflects registration order rather than name order. So like, it's not alphabetical by default, it's registration order. A little chaotic, but that's the lore π
π EXAMPLE π
Here's a whole mood board of topologies, copy away:
---
- topology: topo1
cluster_default: true
tree:
switches:
- switch: sw_root
children: s[1-2]
- switch: s1
nodes: node[01-02]
- switch: s2
nodes: node[03-04]
- topology: topo2
cluster_default: false
block:
block_sizes:
- 4
- 16
blocks:
- block: b1
nodes: node[01-04]
- block: b2
nodes: node[05-08]
- block: b3
nodes: node[09-12]
- block: b4
nodes: node[13-16]
- topology: topo3
cluster_default: false
flat: true
- topology: topo3a
cluster_default: false
flat:
alpha_step_rank: true
- topology: topo4
cluster_default: false
ring:
rings:
- ring: ring0
nodes: node[01-08]
- ring: ring1
nodes: node[09-16]
- topology: topo5
cluster_default: false
torus3d:
toruses:
- name: pod1
dims:
x: 4
y: 4
z: 2
nodes: node[01-32]
placements:
- dims:
x: 2
y: 2
z: 1
- dims:
x: 2
y: 2
z: 2
- dims:
x: 4
y: 4
z: 2
π COPYING π
Copyright (C) 2025 SchedMD LLC.
This file is part of Slurm, a resource management program. For details, see:
https://slurm.schedmd.com/
Slurm is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Slurm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
π SEE ALSO π
slurm.conf(5), topology.conf(5)
Slurm 26.05 Β· Slurm Configuration File
And that's the whole page, bestie π«Ά Go forth and configure your topology, you absolute icon. Slay, allocate, repeat. πβ¨
π¦ where this page comes from
- arch rolling: slurm-llnl 26.05.5.1-1 Β· GPL-2.0-or-later
- epel 10: slurm 26.05.5-1.el10_3 Β· GPL-2.0-or-later AND BSD-2-Clause AND BSD-1-Clause
- nixpkgs unstable: slurm 26-05-5-1
- ubuntu stonking: slurm-client 26.05.4-1ubuntu1 Β· GPL-2.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms