TLDRocket
Sign in

Tools & Coding

975 summarised stories in Tools & Coding, each linking back to the original source. Browse all topics →

Wednesday, 27 July 2022

Faster Text Generation with TensorFlow and XLA

Hugging Face 4 years ago 42

TensorFlow text generation compiled with XLA now runs up to 100x faster than the uncompiled version, with performance exceeding PyTorch equivalents on GPU or TPU hardware. The optimization requires a single line of code (`jit_compile=True`) but introduces a tradeoff where the first call with a new tensor shape or type triggers slow recompilation, while subsequent calls with identical shapes reuse the compiled binary. Users must pad inputs to consistent lengths and accept initial overhead when using different generation options to maintain the speed benefits.

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads all relevant sources, removes duplicate coverage, and summarises the day in two minutes. Follow companies and topics for alerts, or get the briefing in Slack. Free, no spam, unsubscribe anytime.