arXiv:2610.29171cs.CLOct 2026

Manuscript Offprint

arXiv:2610.29171

TrainBridge: Agentic NPU Training Optimization Guided by GPU Compilation Evidence

Yupeng Chen, Kunxiang Zhao, Xingjian Wang, Yue Zhao, Yijing Wu, Ye Liu, Kai Li, Congliang Chen, Ruoyu Sun

Abstract

We study how to improve training efficiency on Ascend NPUs. In the NPU training programs we study, framework-level compilation optimizations such as operator fusion are only partially applied, leaving fragmented computation and avoidable execution overheads. Profiling-guided tuning can address these inefficiencies, but it often requires costly trial and error. To make training on NPUs more efficient, we propose TrainBridge, an agentic approach for transferring GPU optimization guidance to NPU training. TrainBridge uses the highly optimized execution produced by mature GPU compilation stacks as a task-specific reference for NPU tuning. It extracts optimization intents from the GPU training execution to guide NPU program rewrites and further refines the rewritten program through iterative profiling. Our GPU-to-NPU migration experiments show that TrainBridge achieves an average 1.7×1.7\times speedup across four workloads covering LLM pretraining, image classification, and vision-language training, and an average speedup of nearly 2.0×2.0\times across 27 Modded-NanoGPT speedrun records with highly optimized GPU implementations. 1^{1}

1 Introduction

Efficient training on modern accelerators can benefit from framework-level compilation that optimizes computation across operators. Such compilation is mature on NVIDIA GPU backends. However, in the Ascend NPU training programs we study, these optimizations are partially applied by the available compilation stack [Yu, 2026]. As a result, the execution of the training algorithm involves fragmented computation, redundant operations, and materialized intermediates, leaving space for NPU-specific program tuning.

Such NPU-specific tuning is often manual and expert-driven. Providing a tuning agent with task-specific knowledge, such as NPU profiling results [Zhang et al., 2025c, Li et al., 2026a, Zhou et al., 2025], enables it to diagnose bottlenecks and improve the NPU program. However, even with profiling guidance, the agent still needs to iteratively analyze, modify, execute, and validate the program, making the optimization process time-consuming under a limited tuning budget. This motivates us to seek additional guidance that can make the tuning process more efficient.

To provide this additional guidance, we introduce TrainBridge, a two-stage agentic framework for NPU-specific optimization. We observe that the corresponding GPU training programs already benefit from substantial optimization by mature compilation stacks. The differences between the eager and compiled GPU execution reveal optimization decisions already made for the same workload. Therefore, we think

*Equal contribution. Email: {yupengchen1, kunxiangzhao}@link.cuhk.edu.cn

†^{\dagger}Correspondence to: Ruoyu Sun (sunruoyu@cuhk.edu.cn).

1^{1}Our code is available at https://github.com/YChen-zzz/NPU_optimal_reference_skills.

the differences are useful guidance on NPU execution. In Stage 1, TrainBridge extracts the underlying optimization intents from the differences and constructs NPU-specific rewrites when corresponding inefficient computation patterns are present in the NPU program. In Stage 2, it iteratively profiles the updated program to identify remaining bottlenecks, addresses them, and updates the profile.

We evaluate TrainBridge in a GPU-to-NPU migration setting on training workloads spanning LLM pretraining, image classification, and vision-language training.

In addition, we introduce an NPU version of the Modded-NanoGPT speedrun [Jordan et al., 2024], a highly optimized community benchmark for end-to-end language-model pretraining efficiency under a fixed validation target. We adapt its historical GPU implementations to Ascend NPUs and release an open leaderboard 2^{2} and evaluation environment to support further NPU training optimization.

Our contributions are summarized as follows:

  • We identify compilation-related optimization gaps in NPU training programs. To narrow these gaps, we present TrainBridge, a two-stage agentic approach. TrainBridge first extracts optimization intents from the differences between eager and compiled GPU implementations and uses them to guide NPU program rewrites, then iteratively profiles the rewritten program to address residual bottlenecks.

  • We evaluate TrainBridge across multiple NPU training workloads. It achieves average speedups of 1.7×1.7\times across four training workloads and nearly 2.0×2.0\times across 27 historical speedrun records with highly optimized GPU implementations, relative to the initial NPU implementations. On the four additional workloads, it reduces the average NPU-to-GPU training-time ratio from 2.8×2.8\times to 1.5×1.5\times.

References (18)