mini-npu-stack is a small C project for learning AI accelerator system
software. It begins as a user-space runtime simulator with a minimal API and
command-line tool. It does not perform neural network inference.
The project is intended to grow in small, testable stages while keeping the boundary between applications, the runtime, and a future device interface clear.
Requirements:
- GCC
- Make
make
./tools/mininpu_run
./examples/add_relu_demo
make testUse make clean to remove generated files.
Include mininpu.h to use the runtime:
struct mininpu_ctx *ctx = NULL;
int32_t a[] = {1, -2};
int32_t b[] = {3, 4};
int32_t output[2];
if (mininpu_open(&ctx) == 0) {
mininpu_execute(ctx, MININPU_OP_ADD, a, b, output, 2);
mininpu_close(ctx);
}mininpu_opencreates an opaque runtime context. It returns0on success or a negative error code for invalid arguments or allocation failure.mininpu_closereleases a context. PassingNULLis allowed.mininpu_versionreturns the runtime version as a static string.mininpu_executerunsADDorRELUover plainint32_tbuffers.
The context internals and operator table are private to the runtime implementation.
include/: public runtime APIsrc/: runtime implementationtools/: command-line programsexamples/: small runtime examplestests/: runtime testsdocs/: design notes and roadmap
- Establish a C11 user-space runtime skeleton and test harness.
- Model a small simulated device, command queue, and memory buffers.
- Add deterministic command execution and error handling.
- Define a user/kernel interface suitable for a character driver.
- Optionally implement a Linux pseudo accelerator driver.
See docs/roadmap.md for scope and progression.