Inferensys

Glossary

Application Binary Interface (ABI)

An Application Binary Interface (ABI) is a low-level system interface specification that defines how binary software components interact, covering details such as calling conventions, data type representation, register usage, and object file formats.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
DEPLOYMENT AND RUNTIME OPTIMIZATION

What is Application Binary Interface (ABI)?

A foundational specification for binary-level software interaction, critical for deploying optimized code on hardware accelerators like NPUs.

An Application Binary Interface (ABI) is a low-level contract that defines how binary machine code interacts with an operating system, libraries, and other compiled components. It specifies critical details like calling conventions, data type representation, register usage, and object file formats. For NPU acceleration, a stable ABI allows compiled kernels and runtime libraries from different vendors to interoperate, ensuring that optimized binaries can execute correctly on target hardware without recompilation.

In the context of Neural Processing Unit (NPU) deployment, the ABI governs how the host CPU invokes accelerated kernels, passes tensor data, and manages memory across the heterogeneous system. It sits below higher-level APIs, enabling Ahead-of-Time (AOT) compilation and linking against vendor-specific runtime libraries. A consistent ABI is essential for binary portability and stable performance across different compiler versions and system updates, forming the bedrock of a deployable, optimized inference pipeline.

DEPLOYMENT AND RUNTIME OPTIMIZATION

Key Components of an ABI

An Application Binary Interface (ABI) is the foundational contract between compiled software components and the underlying hardware or operating system. It defines the low-level rules for interoperability, ensuring that independently compiled modules can work together.

01

Calling Convention

The calling convention is a core ABI rule that specifies how function calls are made at the machine level. It dictates:

  • Register usage: Which CPU registers are used to pass arguments, hold return values, and must be preserved (callee-saved) across calls.
  • Stack management: How arguments are pushed onto and cleaned from the call stack, and the alignment of stack frames.
  • Return value handling: The mechanism for returning simple values, structs, or floating-point numbers.

Examples include the System V AMD64 ABI used on Linux and macOS, and the Microsoft x64 calling convention on Windows. For NPUs, a vendor-specific calling convention defines how kernels are launched and how data is passed between the host CPU and the accelerator.

02

Data Representation & Alignment

This component defines how fundamental data types are represented in memory and registers, ensuring consistent interpretation. Key aspects include:

  • Size and layout: The exact byte size of types like int, long, double, and complex structures.
  • Alignment requirements: Rules that data addresses must be multiples of certain values (e.g., a 64-bit integer aligned to an 8-byte boundary) for optimal memory access. Misalignment can cause severe performance penalties or crashes on some architectures.
  • Endianness: The byte order (big-endian or little-endian) for multi-byte values.
  • Padding: The insertion of unused bytes within structures to satisfy alignment rules.

For NPU programming, this extends to defining the layout of tensors in memory (e.g., NCHW vs. NHWC format) and the alignment of data buffers for direct memory access (DMA).

03

Object File Format

The ABI specifies the standard object file format used for compiled code, libraries, and executables. This format defines the structure for:

  • Sections: Segments like .text (code), .data (initialized data), .bss (uninitialized data), and symbol tables.
  • Relocation records: Instructions for the linker on how to patch addresses when combining multiple object files.
  • Debugging information: The format for embedding source code mappings and variable data.

The dominant format for Unix-like systems is the Executable and Linkable Format (ELF). A stable ABI ensures that object files and shared libraries (.so files on Linux, .dylib on macOS) produced by one compiler can be linked with those from another. For NPU kernels, the object format contains the binary code and metadata for the target accelerator.

04

Name Mangling (Symbol Decoration)

Name mangling (or name decoration) is a compiler technique that encodes function and variable names with additional type and namespace information into a single unique string (symbol) in the object file. This enables:

  • Function overloading: Distinguishing between functions with the same name but different parameter types (e.g., print(int) vs. print(float)).
  • Namespace support: Encoding C++ namespaces and class hierarchies.
  • Type-safe linking: Preventing accidental linking of mismatched function signatures.

Mangling schemes are compiler and ABI-specific. The Itanium C++ ABI (used by GCC and Clang) and the Microsoft Visual C++ mangling schemes are incompatible. This is a critical consideration when linking C++ libraries across compiler toolchains.

05

Exception Handling & Runtime Support

The ABI defines the mechanism for exception handling and the interface to language runtime libraries. This includes:

  • Unwinding tables: Data structures that allow the stack to be unwound when an exception is thrown, calling destructors for local objects (in C++) and finding the appropriate catch block.
  • Runtime library integration: How programs interact with standard libraries (like libc or libc++) for operations such as dynamic memory allocation (malloc/free), thread-local storage, and startup/teardown routines.
  • Personality routines: Specific functions that frame the exception handling logic for a given programming language.

For systems programming and high-performance computing, understanding these low-level details is essential for debugging complex crashes and writing interoperable code.

06

System Call Interface

While sometimes distinguished from the pure compiler-level ABI, the system call interface is a crucial low-level contract. It defines how user-space programs request services from the operating system kernel, including:

  • System call numbers: The unique identifier for each kernel operation (e.g., read, write, mmap).
  • Argument passing: The registers used to pass parameters to the kernel.
  • Return and error conventions: How success values and error codes are returned.

This interface is architecture and OS-specific (e.g., Linux on x86_64 vs. ARM64). For NPU deployment, system calls are used to map device memory, schedule DMA transfers, and interact with the driver managing the accelerator hardware.

DEFINITION

How ABI Works in NPU and AI Deployment

An Application Binary Interface (ABI) is the critical low-level contract that ensures compiled AI models and runtime libraries can execute correctly on specialized Neural Processing Unit (NPU) hardware.

An Application Binary Interface (ABI) is a low-level system specification that defines the exact binary-level contract between compiled software components, including calling conventions, register usage, data structure layout, and system call mechanisms. In NPU deployment, the ABI ensures that a compiled neural network kernel—generated by a vendor SDK—can correctly interface with the NPU's driver and runtime libraries, enabling deterministic execution. This binary-level compatibility is essential for ahead-of-time (AOT) compilation and deploying a single, optimized executable across a fleet of identical NPU accelerators.

For AI workloads, the ABI governs how tensor data is passed between host CPU memory and NPU device memory, and how kernel arguments are marshaled. A stable, well-defined ABI allows for the separation of model compilation from deployment, enabling continuous integration pipelines to produce binaries that are hardware-portable within a chip generation. It sits below higher-level APIs (like ONNX Runtime's execution provider interface) and is foundational for performance reproducibility and deterministic binary deployment in production MLOps environments, linking the compiler toolchain directly to the NPU's instruction set architecture (ISA).

APPLICATION BINARY INTERFACE

Frequently Asked Questions

An Application Binary Interface (ABI) is a critical low-level specification that defines how binary software components interact. These questions address its role in deployment, particularly for hardware-accelerated machine learning workloads on NPUs.

An Application Binary Interface (ABI) is a low-level system interface specification that defines how binary software components interact at the machine code level. It is the contract between separately compiled modules, such as an application and a shared library, or a kernel and a driver. Unlike a higher-level Application Programming Interface (API), which defines source-level compatibility, the ABI ensures binary compatibility, meaning compiled code can link and execute correctly without recompilation. It specifies details like calling conventions (how function arguments are passed and values returned), data type representation (size, alignment, and endianness), register usage, stack frame layout, system call numbers, and object file formats like Executable and Linkable Format (ELF). For NPU acceleration, the ABI defines how a compiled neural network kernel interacts with the NPU's driver and runtime libraries.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.