Compiling AscendNPU IR

The bishengir-compile tool can compile AscendNPU IR into a binary file that can be executed on the Ascend AI Processor.

Compilation Options

Common compilation options are described as follows.

Option

Required (Yes/No)

Description

--help

No

Displays the help information.

-o <file>

No

Specifies the name and location of the output file.

--enable-triton-kernel-compile

No

Enables Triton-related compilation optimization. The input IR must be the MLIR converted by the triton-shared tool.

--enable-hfusion-compile

No

Enables HFusion dialect-level compilation optimization.

--enable-hivm-compile

Yes

Enables HIVM dialect-level compilation optimization. This option is enabled by default.

--enable-auto-multi-buffer

No

Enables automatic ping pong buffer optimization of the Ascend AI Processor on-chip buffer.

Compile Command

During compilation, the input.mlir file is compiled and optimized by the HFusion and HIVM dialects to generate the binary file outputFile.o.

The compile command is as follows:

1
bishengir-compile --enable-hfusion-compile=true --enable-hivm-compile=true input.mlir -o outputFile