RunanywhereAI/trnrt
The open LLM inference engine for AWS Trainium: NKI megakernels, 1M-token context, OpenAI-compatible API. By RunAnywhere.
What it solves
TrnRT provides a high-performance, open-source inference engine specifically optimized for running large language models on AWS Trainium2 hardware. It addresses the complexity of deploying models on specialized cloud chips by offering an OpenAI-compatible API, efficient prefix caching, and custom-tuned kernels that maximize throughput and minimize latency.
How it works
The engine uses an offline compilation pipeline to prepare models before they are deployed to the server. During operation, it splits the hardware into two independent engines, each using tensor parallelism across 32 logical NeuronCores. It employs "NKI megakernels"—fused, highly optimized code blocks—to handle the heavy lifting of model decoding, while a radix-tree-based prefix cache manages memory to speed up repeated requests.
Who it’s for
This project is for developers and engineers working with AWS Trainium2 infrastructure who need to serve large language models at scale. It is ideal for those who require production-ready performance, such as high tokens-per-minute throughput for agentic workloads, and want to integrate with standard OpenAI-style API tooling.
Highlights
- NKI megakernels: Custom fused kernels for decode operations that keep data within the chip's high-speed memory.
- OpenAI API compatibility: Supports standard chat, completion, streaming, and tool-calling interfaces.
- Prefix caching: Uses a radix tree to store and reuse KV pages across both device and host memory.
- Offline compilation: Pre-builds model graphs to ensure the serving environment remains lightweight and avoids runtime compilation delays.
- 1M-token context: Supports large context windows through sparse and linear attention mechanisms.
Related
- Project
- Project
- Project
- Project