Grafy News
Try Grafy free

Optimizing LTX-2.5 Video Generation on AWS Trainium3

Researchers successfully optimized LTX-2.5 video generation on AWS Trainium3 hardware, achieving speeds that rival commercial APIs. Learn how they did it.

Illustration for the news story: Optimizing LTX-2.5 Video Generation on AWS Trainium3Source: Hugging Face Blog

Researchers have demonstrated that high-resolution video generation using the LTX-2.5 model can be highly optimized for AWS Trainium3 hardware. By implementing advanced parallelism techniques, they achieved generation speeds for 10-second clips that match or even exceed existing commercial API performance.

Embedded video from the source story. Open the video
Embedded video from the source story. Open the video
Embedded video from the source story. Open the video
Embedded video from the source story. Open the video

How was LTX-2.5 optimized for Trainium3?

According to a report from the Hugging Face blog, the initial attempt to run LTX-2.5 on Trainium3 was inefficient, taking over five minutes to generate a 10-second clip at a lower resolution. To solve this, researchers employed two primary types of parallelism. First, they used tensor parallelism to split the transformer model across four NeuronCores, as the model was too large to fit on a single core. Second, they implemented sequence parallelism to split video tokens across eight additional cores.

This combination, referred to as TP-4 ×\times SP-8, allowed the system to utilize 32 NeuronCores for a single clip. This optimization enabled the generation of high-resolution video at 2048×10242048 \times 1024, which was previously out of reach. Once optimized, the generation time for a 10-second clip with sound dropped to between 22 and 23 seconds.

What are the performance benchmarks?

When comparing the optimized Trainium3 setup against other benchmarks, the results were competitive. While the researchers noted a lack of specific CUDA benchmarks, they compared their results to the LTX online API. According to the Hugging Face blog, LTX's API takes approximately 23.7 seconds to generate a 10-second 1080p clip. The optimized Trainium3 setup matched this performance and even beat it by about a second, producing a 2048×10242048 \times 1024 clip in 22 to 23 seconds.

In terms of raw efficiency on the hardware, the improvements were significant. The "wall time" for the process was reduced drastically, and the actual time spent on the NeuronCores improved from 45 seconds in the first attempt to 15 seconds in the optimized version, even while handling four times as many pixels.

How does the video generation workflow function?

To move beyond simple clips and toward actual filmmaking, the researchers used a JSON-based storyboard approach. Each shot in the film is defined by a name and a detailed prompt covering style, subject, motion, camera, light, and sound. To maintain visual consistency across different shots, the system uses two specific keys: from and to.

The from key allows a shot to start from the last frames of a previous shot, which helps maintain the appearance of a subject or the continuity of motion. The to key ensures a shot leads smoothly into a subsequent one. This method allows for "pose to pose" animation, where a key payoff shot is created first, and then the preceding and following shots are generated to connect to it.

Examples of these workflows include a film about a seal [https://huggingface.co/buckets/dacorvo/video-generation/resolve/entertainment/seal.mp4], a fox walking in the snow [https://huggingface.co/buckets/dacorvo/video-generation/resolve/entertainment/fox.mp4], and a goat film that includes trimmed shots and captions [https://huggingface.co/buckets/dacorvo/video-generation/resolve/entertainment/goat.mp4].

What technical challenges were overcome?

Beyond parallelism, several host-side and device-side bottlenecks required intervention. On the device side, researchers had to address issues where the transformer returned NaN (Not a Number) values during compilation. They also had to compute GELU activations in fp32fp32 to avoid errors encountered when using bf16bf16.

On the host side, significant time was wasted by every rank attempting to encode the prompt on the CPUs. By restricting prompt encoding to a single rank (rank 0) and passing arguments to others, encoding time dropped from 205 seconds to 7.5 seconds. Additionally, the video decoding process, which was slow on the CPU, was moved to the NeuronCores by splitting frames and using shared memory, reducing decoding time at 2048×10242048 \times 1024 from 357 seconds to just 1.6 seconds.

What does this mean for AI video creators?

This development suggests that specialized AI hardware like Trainium3 can become a viable, high-performance alternative for professional video production workflows. The ability to run complex, multi-shot video generation pipelines with high temporal consistency through structured shot chaining brings AI video closer to traditional animation and film drafting processes.

For creators looking to apply these concepts of structured, multi-shot storytelling, Grafy's Film Studio provides a workspace designed for planning and assembling AI-driven documentaries and short films. While the specific Trainium3 optimizations are hardware-level, the logic of chaining shots and managing cinematic prompts is central to modern AI film production.

Frequently asked questions

How fast can LTX-2.5 generate a 10-second video on Trainium3?

Once the models are loaded and the pipeline is optimized, the system can generate a 10-second clip at a resolution of 2048×10242048 \times 1024 in approximately 22 to 23 seconds. This performance is comparable to, and slightly faster than, the official LTX online API.

What parallelism techniques were used to optimize the model?

Researchers used tensor parallelism to split the large transformer model across 4 NeuronCores so it could fit in memory. They also implemented sequence parallelism to split the video tokens across 8 additional cores, allowing for much higher resolution outputs.

How is visual consistency maintained between different video shots?

Consistency is maintained through a shot-chaining system in a JSON storyboard. By using "from" and "to" keys, a new shot can start from the final frames of a previous shot, which preserves the appearance of characters and the continuity of motion across cuts.


Source: Hugging Face Blog — Taking Trainium3 to the Track: Generating Videos with LTX-2.5