NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

QiMeng-Xpiler: Transcompiling Tensor Programs for Deep Learning Systems with a Neural-Symbolic Approach

Shouyang Dong, Jun Bi, Di Huang, Jiaming Guo, Jianxing Xu, Ruibai Xu, Xinkai Song, Yifan Hao, Ling Li, Xuehai Zhou, Tianshi Chen, Qi Guo, Yunji Chen

Introduction

The rapid evolution of deep learning has led to a highly fragmented hardware landscape. Developers must navigate a variety of specialized backends, including NVIDIA GPUs (CUDA), AMD GPUs (HIP), Intel CPUs (VNNI), and Cambricon MLUs (BANG). Achieving high performance across these platforms typically requires "writing once and optimizing everywhere," a process that is manually intensive and error-prone due to differences in memory hierarchies and instruction sets.

Existing transcompilation methods face a trilemma of scalability, accuracy, and human effort. Rule-based systems require extensive manual engineering. Symbolic synthesis ensures correctness but fails to scale to complex programs like attention mechanisms. Pure Large Language Model (LLM) approaches offer flexibility but often "hallucinate" critical indexing details, leading to functional failures.

QiMeng-Xpiler bridges the gap between scalability and accuracy while minimizing human effort compared to rule-based and symbolic methods.

Methodology: Neural-Symbolic Synthesis

QiMeng-Xpiler introduces a neural-symbolic framework that combines the generative capabilities of LLMs with the formal rigor of Satisfiability Modulo Theories (SMT) solvers. The system decomposes full-program translation into a series of manageable, verifiable transformation passes.

LLM-Assisted Transformation and RAG

Rather than attempting an end-to-end translation, QiMeng-Xpiler utilizes a chain of 11 specialized transformation passes, such as loop reordering, memory hierarchy conversion, and hardware-specific tensorization. To handle unfamiliar hardware targets like Cambricon's BANG C, the system employs Retrieval-Augmented Generation (RAG). A BM25-based search engine retrieves relevant snippets from hardware programming manuals, which are then integrated into meta-prompts to guide the LLM in generating accurate code sketches.

Symbolic Repair and Auto-Tuning

When generated code fails unit tests, the system initiates a symbolic repair process. It first performs bug localization—a binary search-like technique to identify the specific erroneous code segment. An SMT solver (Z3) is then used to mathematically derive the correct loop bounds or indexing logic, ensuring functional correctness.

To optimize performance, QiMeng-Xpiler employs a hierarchical auto-tuning strategy. It uses Monte Carlo Tree Search (MCTS) for inter-pass auto-tuning to find the optimal sequence of transformations, while intra-pass tuning uses brute-force search for parameters like tiling sizes.

The QiMeng-Xpiler workflow integrates LLM-based annotation and transformation with SMT-based repair and hierarchical auto-tuning.

Evaluation and Results

The framework was evaluated using 21 diverse deep learning operators (e.g., MatMul, Convolution, Self-Attention) across 168 test cases. Benchmarking spanned four major hardware platforms: NVIDIA A100, AMD MI200, Cambricon MLU, and Intel Gold 6348.

Key Findings

  • High Accuracy: QiMeng-Xpiler achieved an average computation accuracy of 95%. In straightforward translation tasks like CUDA to HIP, it reached 100% accuracy.
  • Superior Performance: The translated programs frequently outperformed vendor-optimized libraries (e.g., cuDNN, oneDNN), achieving up to a 2.0× speedup in specific kernels.
  • Productivity Boost: The system significantly reduced the human effort required for cross-platform porting. For complex operators like Deformable Attention, it demonstrated a 96.0× productivity boost over manual optimization by human coders.

Conclusion

QiMeng-Xpiler demonstrates that a hybrid neural-symbolic approach can overcome the limitations of traditional transcompilers. By leveraging LLMs for high-level structural transformations and SMT solvers for low-level mathematical correctness, it provides a scalable and accurate solution for the heterogeneous hardware era. Future work will focus on improving the handling of complex control flows and irregular nested loops to further expand the system's reach.

Summary updated

BibTeX
@inproceedings{dong2025qimeng,
  author = {Shouyang Dong and Jun Bi and Di Huang and Jiaming Guo and Jianxing Xu and Ruibai Xu and Xinkai Song and Yifan Hao and Ling Li and Xuehai Zhou and Tianshi Chen and Qi Guo and Yunji Chen},
  title = {{QiMeng-Xpiler: Transcompiling Tensor Programs for Deep Learning Systems with a Neural-Symbolic Approach}},
  booktitle = {OSDI},
  year = {2025},
  doi = {10.48550/arxiv.2505.02146},
}
Figure