Tools

TrnRT Brings GLM-5.3 Inference to AWS Trainium

RunAnywhere developed and open-sourced TrnRT in three weeks, enabling GLM-5.3 Flash to run on AWS Trainium. The project reports 3.57M TPM, two instances per host, cache-aware routing, and fused NKI kernels, with clear limits on what those results establish.

Font size

RunAnywhere developed and open-sourced TrnRT in three weeks, enabling GLM-5.3 Flash to run on AWS Trainium. The project reports 3.57M TPM, two instances per host, cache-aware routing, and fused NKI kernels, with clear limits on what those results establish.

Project repository: https://github.com/RunanywhereAI/trnrt

What TrnRT Solved First

Running inference on hardware other than NVIDIA involves more than loading a model.

A model used for online inference must also handle weight formats, operator mapping, KV cache, request scheduling, and hardware kernels. Installing an inference framework is rarely enough.

RunAnywhere announced TrnRT on Hacker News through Show HN and open-sourced it as an LLM inference engine for AWS Trainium. The project took roughly three weeks from kickoff to release. It supports GLM-5.3 Flash at FP8 precision on an AWS trn2.48xlarge instance.

The first public model was GLM-5.3 Flash rather than a smaller demo model that would be easier to optimize. The goal was to demonstrate that the runtime could handle a real workload.

The project team disclosed the following deployment conditions:

  • Model: GLM-5.3 Flash
  • Precision: FP8
  • Hardware: one AWS trn2.48xlarge instance
  • Number of instances: 2
  • Scheduling component: cache-aware router

These conditions need to be considered together. Without the hardware model, precision, and concurrency configuration, simply claiming support for a particular model says little.

Two Instances on One trn2.48xlarge

TrnRT can currently serve two GLM-5.3 Flash instances from a single trn2.48xlarge instance, paired with a cache-aware router.

The instance count is only part of the story. Request placement matters just as much.

If each instance maintains its own KV cache, the router tries to send requests to an instance that already holds the relevant prefix. This reduces repeated prefills and minimizes cache misses caused by switching between instances.

For Agents, long-context workloads, and multi-turn conversations, cache hit rates affect time to first token and total computation. Cache-aware routing is better suited than simple round-robin scheduling when multiple requests share a system prompt, tool definitions, or historical context.

It is not a free lunch.

Routing performance depends on sufficient prefix overlap between requests. If traffic is entirely random and cache hit rates are low, the router may add scheduling overhead without delivering a meaningful benefit. Too many instances can also fragment the KV cache and reduce reuse.

TrnRT's gains therefore cannot be attributed to Trainium hardware alone. The hardware, runtime, caching strategy, and scheduler work as one system.

The README provides the following minimal launch command:

python -m trnrt.serve \
  --model zai-org/GLM-5.3-Flash \
  --instance-count 2 \
  --host 0.0.0.0 \
  --port 8000

Exact parameters should still be checked against the repository's current README and the AWS environment configuration.

How the 3.57M TPM Figure Was Measured

The project team says TrnRT reached 3.57M TPM on SemiAnalysis's AgentX benchmark, or 3.57 million tokens per minute.

TPM is a throughput metric. It shows how many tokens a system can process in one minute, but it does not directly answer two more common questions:

  1. How long does an individual request take to receive its first token?
  2. How much does it ultimately cost to process the same number of tokens?

High TPM may result from larger batches, higher cache hit rates, or more aggressive operator fusion. It does not imply low latency or automatically translate into lower cost.

The AgentX benchmark has characteristics associated with Agent workloads. Tool calls, growing context, and multi-turn requests may increase cache reuse, but they can also add scheduling and memory pressure.

The 3.57M TPM result should therefore be evaluated alongside input length, output length, concurrency, request distribution, and hardware cost.

The public materials do not currently provide cost conclusions that can be extrapolated directly to all workloads. The result is better viewed as evidence that TrnRT can drive a high-throughput path, rather than proof that Trainium has caught up with other hardware across the board.

Fusing NKI Kernels with Sparse Attention

Another part of TrnRT's work takes place in the decoding kernels.

The project team says the decoding phase uses one NKI kernel per half layer. NKI, or AWS Neuron Kernel Interface, lets developers write and optimize kernels for Neuron instead of leaving every computation to a higher-level framework.

When the model includes sparse attention, the execution path can be merged further. For the 11 sparse-attention layers in this model, TrnRT fuses the corresponding computations.

Why use a half layer?

A Transformer layer typically includes attention, normalization, a feed-forward network, and a residual stage. Placing mergeable computations in the same kernel reduces the need to write intermediate tensors to memory and read them back, while also reducing kernel launch overhead. These costs are especially important during decoding.

Decoding traverses the model for every generated token. Small savings per kernel can accumulate across many layers and requests.

Fusing sparse-attention layers reduces additional scheduling within the existing boundaries. This approach works only when the hardware supports the relevant operators and the fused version does not lose the gains through increased register or memory usage.

This is what distinguishes TrnRT from a conventional model-adaptation script. An adapter generally makes a model run. An inference engine must also decide where to place weights, how to manage caches, how to divide kernels, and how to schedule requests.

Editorial Perspective

TrnRT is worth watching not only because of its 3.57M TPM result, but because non-NVIDIA inference is beginning to have a reusable engineering solution. The project moved from adapting a model from scratch to open source in three weeks. AWS Neuron supplies the low-level interfaces, TrnRT provides the model runtime and scheduling, and GLM-5.3 Flash offers a sufficiently complex real-world workload.

My assessment is that the barrier to adopting Trainium will continue to fall, but deployment will not be as simple as installing a package for CUDA. The more hardware differs and the more complex model structures and request distributions become, the more valuable the runtime layer becomes. The cache-aware router also shows that inference optimization is no longer only a competition between kernels. Scheduling strategies directly affect hardware utilization.

What sets this project apart is that its creators did more than demonstrate compatibility. They placed throughput, instance count, and kernel-fusion details in the public repository. The evidence remains limited, however. The published results cover one model, FP8 precision, and a single Trainium instance type, and the 3.57M TPM figure does not establish low latency or low cost on its own. More models, long-context tests, and billing data reproduced with realistic request distributions are still needed.

Source: https://github.com/RunanywhereAI/trnrt