Fabric as code, part 1: an AI back-end network from one YAML file
AI training clusters live or die on the back-end network. Every GPU node needs a lossless, high-bandwidth path to every other node, and the fabric that provides it is built from hundreds of near-identical switch configs. Hand-editing those does not scale, so this series builds the whole thing as code, from first commit to simulation.
The idea
One file, fabric.yml, describes the design: two spines, four leaves, two tenants (GPU compute and storage) and a lossless RoCEv2 flag. A generator turns it into per-switch NVIDIA Cumulus Linux (NVUE) configs, an Ansible inventory and a topology file for NVIDIA's DSX Air simulator.
spines: [spine01, spine02]
leaves: [leaf01, leaf02, leaf03, leaf04]
tenants:
- { name: gpu-compute, vrf: GPU, vlan: 10, vni: 10010, l3vni: 4001 }
- { name: storage, vrf: STOR, vlan: 20, vni: 10020, l3vni: 4002 }
Design choices
- BGP unnumbered underlay. No point-to-point addressing to manage; each leaf peers with every spine over its uplinks and gets its own ASN.
- EVPN-VXLAN overlay. Tenants are separated by VNI, with a layer 3 VNI per VRF.
- Lossless QoS profile. RoCEv2 needs priority flow control and ECN, so it is switched on from the same source of truth rather than bolted on per device.
Tests before switches
The generator validates the design first and refuses to emit configs if it finds duplicate loopbacks, duplicate leaf ASNs, a port used twice, repeated VNIs, or an L2 VNI that collides with an L3 VNI. Eight unit tests cover those checks and the shape of the output, and CI runs them on a self-hosted runner so builds cost nothing in hosted minutes.
What is not proven yet
The generated NVUE has not run on a real Cumulus node. Part 2 loads the topology into DSX Air, deploys with Ansible using an automatic rollback window, and fixes whatever the switches reject. Expect a post about the mismatches, because there will be some.
Status: generator, validation and tests done. Next: simulation, then post-deploy checks for BGP sessions and EVPN routes.