Hugging FaceDavid Corvoysier, Jingya Huang, Sayak PaulBenchmark
Taking Trainium3 to the Track: Generating Videos with LTX-2.5
Summary
The author tested LTX-2.5, a video and sound generation model from Lightricks, on an AWS Trainium3 instance (trn3.48xlarge) with 64 NeuronCores. After optimizing the diffusers pipelines with tensor parallelism (TP-4) and sequence parallelism (SP-8), a 10-second 2048x1024 clip with sound generated in 22 to 23 seconds on 32 cores, matching LTX’s paid API. The film-making approach chains shots using ‘from’ and ‘to’ keys to maintain subject consistency across cuts, and supports multiple takes with seeds. Optimizations reduced wall time from 5 minutes 20 seconds to 22-23 seconds, with host-side improvements providing the largest gains. The author also explored using LTX-2.5 as a world model for robotics, generating continuations of real camera footage.
Context
The post describes the author’s experience generating videos with LTX-2.5 on an AWS Trainium3 instance (trn3.48xlarge, 64 NeuronCores) over a month. It focuses on performance optimization and a film-making workflow that chains shots from prompts, comparing results to LTX’s paid API. The author also explores using LTX-2.5 as a world model for robotics by generating continuations of real camera footage.
Approach / What changed
The approach used diffusers pipelines (LTX2Pipeline, LTX2ConditionPipeline, LTX2LatentUpsamplePipeline) with custom tensor parallelism (TP-4) and sequence parallelism (SP-8) to split the transformer over 32 NeuronCores. A Python script reads a film file (JSON list of shots with prompts, seeds, and chaining keys) and orders shots so keyframes exist before dependent shots. Shots are chained using ‘from’ (start from last frames of another shot) and ‘to’ (end on first frames) to maintain subject consistency. Optimizations included compiling blocks with compile_repeated_blocks, computing GELUs in fp32, and host-side improvements to reduce overhead.
Takeaways
LTX-2.5 on Trainium3 generates a 10-second 2048x1024 clip with sound in 22-23 seconds on 32 NeuronCores, rivaling LTX’s paid API.
Shot chaining with ‘from’ and ‘to’ keys maintains subject consistency across cuts, enabling multi-shot films from prompts.
Optimizations including tensor parallelism, sequence parallelism, and host-side improvements reduced generation time from 5 min 20 s to 22-23 s.
FAQ
How long does video generation take on Trainium3?
Once models are loaded, a 10-second 2048x1024 clip with sound takes 22 to 23 seconds on 32 NeuronCores, matching LTX's paid API which claims 23.7 seconds for a 10-second 1080p clip.
How do you maintain subject consistency across shots?
Shots are chained using 'from' (start from last frames of another shot) and 'to' (end on first frames) keys, so the subject's appearance and motion continue across cuts. This allows multi-shot films where each shot maintains consistency with the previous or next shot.
What optimizations were needed to run LTX-2.5 on Trainium3?
Tensor parallelism (TP-4) splits weights across 4 cores, sequence parallelism (SP-8) splits video tokens across 8 chips, and host-side improvements reduce overhead. These optimizations cut wall time from 5 minutes 20 seconds to 22-23 seconds.
Source and freshness
- Source
- huggingface.co
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.