Skip to content
AI Learning Ground Start learning

News ·

Beyond the KV cache: Training and serving i14’s Laplace 3B linear attention model on AWS Trainium2 with native PyTorch

i14 trained and served its Laplace 3B linear attention model on AWS Trainium2 using native PyTorch, avoiding the transformer KV cache with a fixed 29.5 MB recurrent state per sequence.

Beyond the KV cache: Training and serving i14’s Laplace 3B linear attention model on AWS Trainium2 with native PyTorch
Image: Amazon Web Services

i14 trained and served Laplace 3B, a linear attention model, on AWS Trainium2 using native PyTorch, according to AWS. The write-up covers both the training and serving aspects of the model on Trainium2 hardware.

Unlike transformer models, which carry a key-value cache that grows as context length increases, Laplace 3B uses a recurrent state that stays fixed at 29.5 MB per sequence regardless of how long the context gets. This removes the growing KV cache entirely and keeps serving memory predictable.

For builders, the key benefit is predictable memory usage at inference: serving costs and capacity planning no longer scale with context length the way they do for transformers. The work also shows that linear attention models can be trained and served on Trainium2 with native PyTorch rather than custom frameworks.

References

Read the full story at Amazon Web Services ↗Like, save or discuss on Buzz

#infrastructure #products