Skip to content

Feature Request: C/C++ code generation backend for embedded deployment #809

@akhodeir

Description

@akhodeir

Hi Hummingbird team,

First of all, thank you for the excellent work on converting tree-based models into tensor / GEMM representations.

I’m currently using Hummingbird to convert XGBoost and decision tree models into GEMM-based implementations for fast inference.

This works very well for CPU/GPU inference, but for embedded systems with limited resources, the current deployment options are difficult to use:
• Torch / TorchScript runtime is too heavy
• saving .pt files is not practical
• ONNX Runtime is also too large for MCU-class targets
• we need deterministic static memory usage
• firmware environments often require pure C/C++ source code

Proposed feature

It would be extremely valuable to add a backend such as:

convert(model, backend="c")
convert(model, backend="cpp")

that generates:
• static const weight matrices
• threshold vectors
• branch masks
• leaf projection matrices
• optional fixed-point quantized arrays
• lightweight GEMM kernels
• pure C/C++ inference functions
• no external runtime dependency

This would allow deployment on:
• ARM Cortex-M
• DSPs
• microcontrollers
• bare-metal firmware
• RTOS systems
• safety-critical embedded environments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions