How yasp Cuts LLM Inference Cost on AWS Trainium3 by up to 35%
%401x.png)
Summary
yasp serves up to 55% more tokens per second on AWS Trainium3 and cuts cost per token by up to 35%, with the same model on the same instance.
The Challenge: Serving Open Models at Scale on Trainium3
Inference is where AI budgets go once a model is in production. Every output token has a price, and that price is set by how many tokens a single accelerator instance can produce per second while still answering users quickly.
AWS Trainium3 gives teams a purpose-built option for that workload. But a new chip generation does not automatically run every model at its full potential. Stock serving stacks use generic kernels that leave throughput on the table, especially as concurrency rises.
We wanted to know how much headroom a model has on Trainium3 when its execution is rebuilt for the chip. So we kept everything else fixed: same model, same weights, same instance. The only thing yasp changes is how the model runs on the hardware.
Benchmark Setup
All measurements ran on one trn3.48xlarge instance with 16 Trainium3 devices. The model is GPT-OSS-20B with MXFP4 expert weights, the same format AWS uses for this model.
| Stock Trainium3 | yasp-optimized Trainium3 | |
|---|---|---|
| Instance | trn3.48xlarge, 16 devices | trn3.48xlarge, 16 devices |
| Serving stack | Unmodified AWS container | Neuron SDK 2.33, vLLM 0.30.0 with the yasp-vllm plugin |
| Topology | 8 replicas, tensor-parallel across 8 cores each | 16 replicas, one per device |
| Kernels | Stock | Rebuilt by yasp’s kernel optimization agents Kronos and Gaia |
Table 1: Benchmark setup, stock vs. yasp-optimized Trainium3
Load was generated with GuideLLM using closed-loop requests, synthetic prompts and no prefix caching. Each request is a chat-style workload with 1,024 input and 1,024 output tokens. Throughput is output tokens per second for the whole instance.
The stock baseline is a single run of the unmodified AWS container. Because results on synthetic workloads vary with the benchmark setup, we report the load levels where the difference is clear: 256, 512 and 1,024 concurrent users.
Results
yasp’s build serves 37% to 55% more tokens per second than the stock setup between 256 and 1,024 concurrent users, and the gap widens as load grows.
| Concurrent users | Stock (tok/s) | yasp (tok/s) | Throughput gain | Lower cost per token | p95 TTFT stock | p95 TTFT yasp |
|---|---|---|---|---|---|---|
| 256 | 12,983 | 17,741 | +37% | 27% | 6.6 s | 0.5 s |
| 512 | 16,946 | 24,051 | +42% | 30% | 12.9 s | 0.6 s |
| 1,024 | 19,399 | 30,052 | +55% | 35% | 26.4 s | 0.2 s |
Table 2: Throughput, cost per token and time to first token, stock vs. yasp
Throughput
At 1,024 concurrent users, the optimized build produces 30,052 output tokens per second, against 19,399 for the stock configuration. Comparing each configuration at its own peak, yasp reaches 31,925 tokens per second and the stock setup 20,128, a 59% increase.

Time to First Token Under Load
Throughput only matters if users still get fast answers. With the stock setup, p95 time to first token rises from 6.6 seconds at 256 users to 26.4 seconds at 1,024 users as requests queue up. The yasp build keeps p95 time to first token between 0.2 and 0.6 seconds across the same range.

Interactivity per User
Customers rarely size a deployment by concurrency alone. They set a target for how fast each user’s answer should stream, then ask how many users one instance can serve at that speed. Read that way, the optimized build serves twice as many users at a comparable per-user speed: 1,024 users at about 29 output tokens per second each, against 512 users at about 33 with the stock setup.
Per-user speed here is output throughput divided by concurrent requests, so it includes the wait for the first token.

Cost per Token
Both configurations run on the same instance, so higher throughput translates directly into lower cost per token. The saving grows from 27% at 256 users to 35% at 1,024 users, and reaches 37% peak to peak.

Model Quality
Optimization must not change what the model says. We measure top-1 agreement: the share of token positions where the Trainium3 build picks the same next token as the unmodified reference model. The yasp build scores 96.4% and the stock configuration 95.9%. Quality is preserved, within normal run-to-run variation.
How yasp Optimizes Models for Trainium3
The gains come from a system, not from hand-tuning one model. This benchmark was part of a four-week effort in which we optimized five open models for Trainium3 with the same workflow.
Kronos: Record, Validate, Rebuild
Kronos is yasp’s continual learning system for model optimization. It works in five steps:
1. Record: Kronos runs the stock model in vLLM and records every kernel it launches, with real inputs and outputs. It also records whole-model generations that every optimized version must reproduce.
2. Lift to PyTorch: Each recorded kernel becomes a validated unit: a PyTorch reference implementation checked against its recording, bit-exact or within a stated tolerance.
3. Convert to NKI: An agent translates each unit into an NKI kernel for Trainium and checks it first against a CPU reference, then on the device.
4. Optimize: The agent profiles the served model, ranks kernels by measured time and expected impact, and tests techniques such as fusion, quantization and parallelism. A change is kept only if it wins in a served benchmark, because isolated kernel speed can mislead. Accuracy is checked at every step.
5. Assemble: The kept kernels are packaged into one native library per model and served through vLLM with the yasp-vllm plugin.
Gaia: Agent-Generated NKI Kernels
Gaia is yasp’s coding agent for kernel optimization. It takes a PyTorch program and generates optimized PyTorch and NKI code without human intervention, within correctness constraints set by the user. Inside Kronos, other agents call Gaia on demand, and Gaia can revisit parts of earlier optimization runs to improve them further. Gaia can be used with the Neuron Agentic Development workflows.
What’s Next
We are continuing to work with AWS on running customer workloads efficiently on Trainium. That includes porting and optimizing customer models for Trainium2 and Trainium3, and packaging the optimized versions as container images that teams can deploy in their own environments.
The same approach works for training. We have ported a customer’s reinforcement-learning training workload to Trainium2, keeping the original recipe, hyperparameters and FP32 precision.
With the AWS Neuron team, we are taking the Gaia integration from proof of concept into Neuron’s agentic development tools, so that Trainium developers can use Gaia as a specialized engine for generating and optimizing NKI kernels.
yasp is an optimization partner of Annapurna Labs in the AWS Trainium partner ecosystem.
Key Takeaways
- Same chip, same model, same weights. yasp changes only how GPT-OSS-20B runs on Trainium3 and gets up to 59% more throughput from one trn3.48xlarge.
- Up to 35% lower cost per token. Because both setups run on the same instance, every throughput gain lowers the cost of each token served.
- The advantage grows with load. The cost saving rises from 27% at 256 concurrent users to 35% at 1,024.
- Fast answers at scale. p95 time to first token stays between 0.2 and 0.6 seconds, where the stock setup reaches 6.6 to 26.4 seconds.
- Quality preserved. Token-level agreement with the reference model stays within normal run-to-run variation.
- Systematic, not hand-tuned. Kronos and Gaia rebuild a model's kernels for Trainium3 and keep only changes that win in a served benchmark.
Run Your Models Faster on AWS Trainium
Serving open models on Trainium, or planning to? yasp optimizes your model for the chip and hands it back ready to serve in vLLM, with accuracy checked at every step. Tell us which model and workload you run, and we will show you the headroom.
See it live at AWS re:Invent. In his lightning talk, yasp CTO Reza Rahimi shows yasp’s optimization running live on Trainium3, with tokens per second updating in real time.
FAQ
Does the optimization change the model’s answers?
No meaningful change. We compare the optimized build token by token against the unmodified reference model. Top-1 agreement was 96.4% for the yasp build and 95.9% for the stock setup, within normal run-to-run variation.
Is the optimized build faster at every load level?
No. At low concurrency (64 users) the stock configuration was faster in our runs. The advantage appears as load grows: 37% more throughput at 256 users and 55% more at 1,024.
Do I need to change my serving stack?
The optimized model is served through vLLM with the yasp-vllm plugin, which connects vLLM to a native library that runs the model on Trainium3.
Which models did yasp optimize for Trainium3?
In this project we optimized five open models: GPT-OSS-20B, Qwen3.5-35B-A3B, Qwen3.8-27B, Nemotron 3 Nano 30B-A3B and GLM-4.7-Flash. We use the same workflow to port and optimize customer models for Trainium. Further results are published here and in our model catalog.
What hardware was used for the benchmark?
One trn3.48xlarge instance with 16 Trainium3 devices, running a chat workload with 1,024 input and 1,024 output tokens per request.
Does yasp work with AWS Neuron’s agentic development tools?
Yes. Gaia ran as a kernel optimization engine alongside the agents introduced in Neuron SDK 2.33. For gpt-oss-20b on a single Trainium3 device, its NKI kernels raised throughput by 19.6% over the vLLM-Neuron baseline, with accuracy preserved.



