Latest
Hugging Face generates 10-second AI video clips in 22 seconds on AWS Trainium3
Image: Hugging Face

Hugging Face generates 10-second AI video clips in 22 seconds on AWS Trainium3

Hugging Face engineers have run Lightricks’ LTX-2.5 video model on AWS Trainium3 hardware, generating a 10-second clip with sound at 2048×1024 in 22 to 23 seconds once the models were loaded. The team said the setup used half of a trn3.48xlarge machine.

Hugging Face got access to the 64-NeuronCore machine for a month through its partnership with AWS. David Corvoysier, who wrote the report with Jingya Huang and Sayak Paul, spent the final five days trying video generation with the diffusers library.

A seal asleep on an ice floe, a frame from a short film generated with LTX-2.5 on AWS Trainium3
Image: Hugging Face

Matching a commercial API

LTX-2.5 generates video and sound together. Corvoysier said no reliable CUDA figure was available for comparison. LTX has claimed 6.8 seconds for a 10-second 720p clip on four B200 GPUs, but without detail on how it was measured. He compared against LTX’s online API instead, which LTX says produces a 10-second 1080p clip in 23.7 seconds. The Trainium3 setup matched that and beat it by about a second, he said.

The first working attempt took about 5 minutes 20 seconds for a 10-second clip at 960×544, with the NeuronCores computing for only about 45 seconds of that. The optimized version uses 32 cores at roughly four times the pixels. Corvoysier reported a 14-fold improvement in wall time.

What it took

The transformer does not fit on one NeuronCore, so the team split it across four cores with tensor parallelism. To reach the target resolution, they also split the video tokens eight ways using sequence parallelism, for 32 cores per clip.

A seal asleep on an ice floe, a frame from a short film generated with LTX-2.5 on AWS Trainium3
Image: Hugging Face

Much of the gain came from the host side. Running the pipeline on one process instead of every rank cut prompt encoding from about 205 seconds to 7.5 seconds. Moving video decoding to the NeuronCores cut it from 357 seconds to 1.6 seconds at 2048×1024. Further changes to thread handling and prompt padding brought prompt encoding down to 1.4 seconds.

The team also hit problems in torch-neuronx, including a bf16 GELU precision issue and memory allocation waste. It worked around both and reported them upstream. Three behaviours were never explained, including NaN outputs when the transformer was compiled as one graph.

Making short films

The team built a roughly 160-line Python layer on top of diffusers that reads a JSON “film” file of named shots with prompts and seeds. Shots can start from the last frames of an earlier shot or end on the first frames of a later one, which keeps a subject consistent across cuts. The code is published as dacorvo/video-generation.

Corvoysier said the model still gets details wrong, so he made four takes of each new shot and picked one. Each shot generates its own sound, which does not carry over between shots, and shots are capped at 20 seconds.

A service would keep processes running, he said, since loading the models takes about 3 minutes and the first clip another 80 seconds.

Tests with robot and car footage

The team also fed the model the first second of real camera footage, including a clip from the head camera of a Fourier GR1-T2 humanoid taken from NVIDIA’s GR1-100 dataset. With only the prompt changed, the model generated alternate events, such as a person helping the robot carry an orange. A car-camera clip from the Boreas dataset showed a similar pattern, though asking the car to accelerate did not change its speed.

Corvoysier noted that the videos follow prompts rather than robot or vehicle commands. Training use would need action-conditioned generation, which a team could build by fine-tuning the LTX-2.5 checkpoint on its own data.

Some fixes are moving upstream. A pull request for the LTX-2 pipelines in diffusers is open, and tensor and context parallelism support is under discussion, with a tensor-parallel plan for LTX-2.5 planned.

Source: Hugging Face Blog