Exa cuts embedding cost per document by 47% on AWS Inferentia2 and Trainium2
Search company Exa describes how it re-embedded 30 billion documents on AWS Inferentia2 and Trainium2, using NKI kernels, a custom fused SwiGLU MLP kernel and shape-specific attention to improve throughput and cost per million documents by about 47%. The…
Why it matters
It is a concrete pattern for letting agents do kernel-level optimization safely: a strict correctness gate plus automated profiling and benchmarks.
What happened
1 min readSearch company Exa describes how it re-embedded 30 billion documents on AWS Inferentia2 and Trainium2, using NKI kernels, a custom fused SwiGLU MLP kernel and shape-specific attention to improve throughput and cost per million documents by about 47%. The optimizations were developed by coding agents inside a harness that checks correctness (0.999 cosine similarity), profiles, and benchmarks each change.
Our analysis
This is a co-marketed AWS customer story, so the comparison is against Exa's own naive baseline rather than against GPUs, and no absolute cost figures are given. The more transferable part is the agent harness: cheap models for compiler-flag grid searches, stronger ones for kernel writing, all held to a numeric correctness check. Most teams will not write custom NKI kernels, but the verify–profile–benchmark loop applies to any agent-driven performance work.