AscendCraft: Automatic Ascend NPU Kernel Generation via DSL-Guided Transcompilation

Zhongzhen Wen, Shudi Shao, Zhong Li, Yu Ge, Tongtong Xu +2 more
1/30/2026
cs.DCcs.LGcs.PF

No confident code implementation found for this paper.

Abstract

The performance of deep learning models critically depends on efficient kernel implementations, yet developing high-performance kernels for specialized accelerators remains time-consuming and expertise-intensive. While recent work demonstrates that large language models (LLMs) can generate correct and performant GPU kernels, kernel generation for neural processing units (NPUs) remains largely underexplored due to domain-specific programming models, limited public examples, and sparse documentation.

Show full abstract

Consequently, directly generating AscendC kernels with LLMs yields extremely low correctness, highlighting a substantial gap between GPU and NPU kernel generation. We present AscendCraft, a DSL-guided approach for automatic AscendC kernel generation. AscendCraft introduces a lightweight DSL that abstracts non-essential complexity while explicitly modeling Ascend-specific execution semantics. Kernels are first generated in the DSL using category-specific expert examples and then transcompiled into AscendC through structured, constraint-driven LLM lowering passes. Evaluated on MultiKernelBench across seven operator categories, AscendCraft achieves 98.1% compilation success and 90.4% functional correctness. Moreover, 46.2% of generated kernels match or exceed PyTorch eager execution performance, demonstrating that DSL-guided transcompilation can enable LLMs to generate both correct and competitive NPU kernels. Beyond benchmarks, AscendCraft further demonstrates its generality by successfully generating two correct kernels for newly proposed mHC architecture, achieving performance that substantially surpasses PyTorch eager execution.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wen2026ascendcraft,
  title  = {AscendCraft: Automatic Ascend NPU Kernel Generation via DSL-Guided Transcompilation},
  author = {Zhongzhen Wen and Shudi Shao and Zhong Li and Yu Ge and Tongtong Xu and Yuanyi Lin and Tian Zhang},
  year   = {2026},
  eprint = {2601.22760},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.22760v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.22760.svg)](https://codeofpaper.com/paper/2601.22760)

Discussion