Manuscript Offprint

arXiv:2610.18009

A Distributed View from a Single GPU: RankLens for Distributed Training

Yufan Wang, Yihao Zhang, Yi Liu

Yufan Wang

Beihang University

Beijing, China

yufanwang@buaa.edu.cn

Yihao Zhang

Beihang University

Beijing, China

sy2406433@buaa.edu.cn

Yi Liu

Beihang University

Beijing, China

yi.liu@buaa.edu.cn

Abstract—Modern distributed training is costly to debug, tune, and analyze because faithful analysis often requires repeated target-scale executions. We observe that many analysis tasks depend on the original distributed execution path, but not on full all-rank execution. We present RankLens, a single-rank emulation system that runs one survivor rank on a single GPU while preserving the target job's distributed semantics. The survivor rank executes the original training program and performs real local computation. At communication boundaries, the system replaces real multi-rank communication with task-dependent semantics, selectively restoring recorded communication results and recorded or estimated completion timing while preserving the asynchronous dependencies required for analysis. This enables replay from real executions and supports analysis, debugging, and tuning with existing debuggers and performance analysis tools.

We evaluate the system on DeepSpeed and Megatron-LM across 8–64-GPU target configurations. RankLens achieves 100% training-tensor communication-structure match, keeps emulation timing error below 5%, supports local anomaly reproduction and execution analysis, and reduces the resource requirement of these analyses from target-scale clusters to a single GPU.

Index Terms—Distributed Training, Single-Rank Emulation, Communication Replay, Distributed Debugging, Performance Analysis

I. INTRODUCTION

The rapid scaling of AI models has placed increasing demands on training infrastructure, both in system complexity and resource requirements [1]–[4]. Modern distributed training systems combine data, tensor, and pipeline parallelism and use asynchronous communication to overlap computation with data transfer [5], [6]. These mechanisms introduce complex data dependencies and synchronization constraints across ranks, making the numerical state and execution timing of each rank dependent on its peers [6]. Consequently, debugging and tuning tasks such as inspecting anomalous tensors, analyzing communication waits, and examining the overlap between computation and communication require the relevant distributed execution context, even when the analysis focuses on a single rank [7], [8]. Reproducing and examining these behaviors through actual distributed execution typically requires provisioning the corresponding multi-GPU configuration, while repeated runs to collect additional observations or evaluate changes further increase resource costs. This creates a mismatch between the scope of analysis and its resource requirements: the behavior of interest may be local to a single rank, yet reproducing it remains tied to the full distributed configuration.

A straightforward way to reduce this cost is to simplify distributed training into conventional single-GPU execution. However, this changes the original parallel configuration and communication paths. To reduce reliance on full-cluster execution, prior work has developed performance models for estimating training costs [9]–[13], as well as simulation and trace-based analysis tools for exploring training configurations, hardware designs, and optimizations [8], [14]–[21]. Recent systems further advance low-cost training analysis through execution modeling, framework code reuse, and hybrid emulation [22]–[24]. These systems focus on reproducing target-scale execution behavior and interactions under limited resources, while rank-local debugging and tuning further require identifying which numerical states, timing effects, and execution dependencies must be preserved for direct inspection and evaluation of local changes. We therefore ask: how can the resources required for local analysis be reduced to a single GPU while preserving the numerical behavior, timing effects, and execution dependencies needed to reproduce, directly inspect, and tune the behavior of interest in the target rank's original code?

Our approach builds on a key observation: analyzing a target rank in distributed training does not necessarily require executing all ranks. The effects of remote ranks can be represented at communication boundaries by communication context, result values, and completion timing, while the target rank performs its actual local computation. Different analysis tasks require different subsets of these effects. Given the required communication effects and execution conditions, the target rank's original training code can therefore run on a single GPU, with the necessary communication effects restored to reproduce and analyze its local execution behavior.

Turning this observation into single-rank emulation for debugging and tuning is not as simple as bypassing peer-rank execution. The system must preserve the target rank’s original distributed execution context, restore the required effects at the corresponding communication events, and preserve their asynchronous dependencies with subsequent computation [5]–[7],

This work has been submitted to the IEEE for possible publication. Copyright may be transferred without notice, after which this version may no longer be accessible.

[25]. Distorting any of these properties can cause the replayed execution to diverge from the target execution, undermining its utility for debugging and tuning.

Building on this observation, we present RankLens, a single-rank emulation system for debugging and tuning distributed training. RankLens virtualizes distributed state to preserve the logical context of the target configuration, allowing the original training program to follow the target rank's distributed execution path on a single GPU while executing its local computation. At communication boundaries, RankLens maps collective and point-to-point (P2P) calls to virtual communication events, restores recorded communication results when required, and controls asynchronous completion through substituted Work objects. Communication timing can be restored from recorded executions or estimated from historical communication records when target-scale timing traces are unavailable or when tuning changes introduce communication works not covered by the original trace. The restored results are consumed by the original program, enabling developers to use existing debuggers (e.g., GDB [26] and debugpy [27]) to inspect anomalous tensors and their effects on subsequent computation and control flow. The same execution environment also supports analysis of computation-communication overlap and waiting behavior with Nsight Systems [28], while allowing developers to modify local computation or scheduling and directly observe the resulting timing changes.

Our main contributions are as follows:

• Single-rank distributed emulation. We design and implement RankLens, which decouples the logical distributed configuration from physical GPU resources. RankLens preserves the target rank's logical identity, world size, process groups, and parallel configuration on a single GPU, allowing it to perform real local computation along the original distributed execution path.

• An execution environment for local debugging, analysis, and tuning. We retain real rank-local computation within the original distributed execution path, enabling existing debugging and profiling tools to inspect runtime states and execution behavior. Developers can also modify local computation or scheduling and directly observe the resulting timing changes, providing rapid feedback for tuning without repeatedly running the target-scale job.

• Task-dependent communication semantic substitution. We convert collective and P2P calls into virtual communication events and selectively restore their structural, numerical, and timing effects according to the analysis task, preserving the asynchronous execution dependencies required for analysis without communication with real peer ranks. Timing effects can be obtained from recorded executions or estimated from historical communication records when target-scale timing traces are unavailable.

References (37)