Toward Co-adapting Machine Learning Job Shape and Cluster Topology

Shawn Shuoshuo Chen, Daiyaan Arfeen, Minlan Yu, Peter Steenkiste, Srinivasan SeshanarXiv 2025 · DOI

Abstract

Modern machine learning (ML) workloads require massive computational resources, often deployed in clusters with torus topologies. However, scheduling these jobs efficiently is difficult due to network contention and resource fragmentation. This paper presents RFold, a novel resource allocation scheme that co-adapts the physical network topology and the logical shape of ML jobs. By leveraging optical circuit switches (OCSes) for reconfiguration and "folding" job communication patterns into homomorphic geometric shapes, RFold significantly enhances cluster efficiency. Experimental results demonstrate a 57% increase in cluster utilization and up to an 11x reduction in job completion times compared to traditional scheduling methods.

1. Introduction

As AI models grow in scale, data centers are increasingly adopting torus topologies, such as Google’s TPU v4, for their cost-effectiveness and scalability. In these networks, accelerators (XPUs) are directly connected to their neighbors. While efficient for neighbor-centric communication patterns like AllReduce, this architecture introduces significant scheduling challenges. Rigidly placing jobs in contiguous blocks leads to fragmentation, where idle XPUs become stranded and unusable. RFold addresses this "Tetris problem" by making both the network and the jobs flexible through co-adaptation.

2. The Fragmentation Problem in Torus Topologies

Traditional schedulers face a trade-off between performance and utilization. "First-Fit" policies maintain high performance by keeping jobs in perfect contiguous shapes but suffer from low utilization due to fragmentation. Conversely, "Best-Effort" policies increase utilization but often place XPUs far apart, leading to network contention and slowed training. In a static torus environment, First-Fit may only successfully schedule approximately 10.4% of jobs due to these shape mismatches.

3. RFold: Co-adaptation of Network and Job Shapes

RFold introduces two primary techniques to overcome fragmentation:

  1. Topology Reconfiguration: Using Optical Circuit Switches (OCSes), RFold can physically rewire connections between blocks of XPUs (e.g., 4x4x4 cubes) at runtime, effectively "stitching" together fragmented resources.
  2. Job Folding: RFold exploits the fact that ML communication graphs are often rearrangeable. A job's logical communication pattern can be "folded" into a snake-like shape across a 3D grid, provided the mapping is homomorphic. This allows jobs to fit into available physical slots without sacrificing performance.
Job folding allows communication patterns to be mapped onto non-contiguous or non-standard shapes within the 3D torus.

RFold employs a heuristic that prioritizes placing the most rigid jobs (3D) first and minimizes the use of reconfigurable OCS links to maintain cluster flexibility for future requests.

4. Evaluation Methodology

Due to the lack of public torus-based cluster traces, evaluation was conducted using a custom discrete-event simulator modeling a 4096-node 3D torus. The workload was derived from the Microsoft Philly GPU cluster trace, with job sizes sampled from a truncated exponential distribution (1 to 4096 XPUs). Job shapes (1D, 2D, or 3D) were assigned based on typical parallelization strategies for various job sizes.

5. Results and Discussion

RFold significantly outperforms standard scheduling policies across multiple metrics. It achieved a 100% job completion rate (JCR) when using 4x4x4 reconfigurable cubes, compared to just 10.4% for static First-Fit. Furthermore, RFold improved absolute cluster utilization by 57% over static methods and 20% over reconfiguration-only policies.

RFold achieves significantly higher cluster utilization compared to FirstFit and reconfiguration-only baselines.

In terms of speed, RFold reduced median Job Completion Time (JCT) by up to 11x compared to reconfiguration-only baselines. This improvement is largely attributed to the elimination of long queuing delays caused by fragmentation. The results highlight that ML jobs are "graph-flexible," and exploiting this flexibility is key to efficient large-scale resource management.

6. Conclusion and Future Work

RFold demonstrates that co-adapting network topology and job shapes can resolve the long-standing fragmentation issues in torus-based clusters. Future work includes evaluating RFold in real-world environments to account for OCS reconfiguration overheads, integrating more advanced scheduling policies like preemption, and exploring scalability in higher-dimensional topologies (4D or 5D).

Summary updated

BibTeX
@misc{chen2025toward,
  author = {Shawn Shuoshuo Chen and Daiyaan Arfeen and Minlan Yu and Peter Steenkiste and Srinivasan Seshan},
  title = {{Toward Co-adapting Machine Learning Job Shape and Cluster Topology}},
  year = {2025},
  eprint = {2510.03891},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.03891},
}
Figure