TrainBridge: Agentic NPU Training Optimization Guided by GPU Compilation Evidence
Organizations: Shenzhen Loop Area Institute · The Chinese University of Hong Kong, Shenzhen, China · Autokernel
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.7x speedup across four workloads covering LLM pretraining, image classification, and vision-language training, and an average speedup of nearly 2.0x across 27 Modded-NanoGPT speedrun records with highly optimized GPU implementations.
Figures & tables
| Implementation | Training time (s) | Relative time |
| GPU, compiled | 128 | |
| GPU, eager | 338 | |
| NPU, initial port | 563 |
| Implementation | Latency (ms) | Speedup |
| Original NPU implementation | 2.604 | |
| GPU-compilation-evidence-guided agent rewrite | 0.508 |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Record | GPU (s) | Initial NPU (s) | Tuned NPU (s) | NPU speedup | NPU/GPU before after |
| 50 | 128 | 563 | 257 | ||
| 49 | 129 | 569 | 278 | ||
| 48 | 130 | 574 | 277 | ||
| 47 | 132 | 542 | 278 | ||
| 46 | 132 | 574 | 309 | ||
| 45 | 134 | 579 | 293 |