Complete AI Training
Start for Free

Your job's AI kit

Get your AI kit

Tell us who you are and what you do. We show you your kit right away and email you the link: skills, prompts, AI agents, MCP servers and courses for your job.

500+ jobs ready, and we make a kit for any other job. No payment needed to look.

Share

AI news ·

Hugging face generates video on aws trainium3 at speeds rivaling commercial APIs

A 10-second 2048×1024 video with audio generates in 22-23 seconds on half an AWS Trainium3 instance, matching a paid GPU API. The team used frame chaining instead of prompts alone to keep characters and objects consistent across shots.

David Corvoysier, Jingya Huang, and Sayak Paul from Hugging Face spent a month with an AWS Trainium3 machine (*trn3.48xlarge*, 64 NeuronCores). With five days left, they aimed to generate videos using the LTX-2.5 model from Lightricks, which produces video and sound together. The result: a 10-second clip with audio at 2048×1024 resolution took 22 to 23 seconds to generate on half the machine's cores, matching and slightly beating LTX's own paid API speed.

This matters because it puts high-speed, professional-grade video generation on specialized AI hardware, not just NVIDIA GPUs. For studios and creators drafting films or generating training data, it opens a new cost-performance option.

How the film generation works

The team built a system that takes a JSON storyboard of shots. Each shot has a name, a detailed prompt, and optional chaining keys. Prompts alone cannot keep a character or object consistent across cuts. The solution: shots can start from the last frames of a previous shot (from) or end on the first frames of a later shot (to). This keeps the subject's look and motion continuous.

The workflow mirrors animation techniques. The key "payoff" shot is made first. Earlier shots end on its opening frames, and later shots begin from its closing frames. For the seal film, the payoff is an iceberg rolling over and drenching the seal. All surrounding shots chain into or out of this moment. The diffusers library runs the generation through three pipelines: one for standalone shots, one for conditioned shots, and one for latent upscaling.

Making the model run on Trainium3

Out of the box, the transformer did not fit on a single NeuronCore, and diffusers had no plan to split it. The first working attempt took 5 minutes and 20 seconds for a 10-second clip, with the cores computing for only 45 seconds of that time. Five days of optimization brought that down to 22-23 seconds, with the cores busy for 15 seconds.

Three categories of work were required. First, tensor parallelism split the transformer across 4 cores because it was too large for one. Second, sequence parallelism split the video tokens across 8 cores, letting 32 cores work on a single clip and making the target resolution possible. Third, host-side bottlenecks were eliminated: prompt encoding was deduplicated across ranks, CPU thread pools were pinned to avoid starvation, and video decoding was moved onto the NeuronCores.

Several hardware-specific issues needed patching. A bf16 GELU operation computed entirely in low precision returned inaccurate results until forced to fp32. Memory allocation wastage was fixed by packing parameters into 1 GiB buffers. A slow strided copy was resolved with a .contiguous() call before the transfer.

Lessons from the project

"Sequence parallelism is how one clip uses the machine," the team found. Tensor parallelism was forced by memory limits and capped by the 32 attention heads. Splitting the sequence over more cores shrank each core's graph until it loaded, which was essential for higher resolutions.

Checking model splits against CPU before deploying to the device caught the GELU precision error. Keeping traced code stable avoided recompilation penalties of up to 30 minutes per graph. And for filmmaking, prompts alone were never enough: chaining shots to specific frames was what kept a fox or a mountain consistent from one cut to the next.

Professional use cases and limitations

Once models are loaded, the 22-23 second generation time rivals LTX's paid API on half the instance. A production service would keep processes warm, as loading takes about 3 minutes and the first clip takes 80 seconds. The diffusers pipeline supports drafting a movie: shots chain together, seeds make takes reproducible, and a shot can start from an image like a storyboard frame.

The model still gets details wrong, so multiple takes per shot are necessary. Sound does not carry over between shots-each generates its own audio. And shots are limited to 20 seconds, the model's maximum.

World models and robotics training

The team also tested LTX-2.5 as a world model for robotics. Given the first second of real footage from a robot's head camera, the model invented plausible continuations of the scene. From a clip of a GR1-T2 humanoid picking an orange, the model generated the grab on its own, keeping the table, hands, and fruit consistent.

More interesting was the ability to generate alternate events. From the same opening second, a prompt change produced a person helping the robot carry the orange. Five takes showed different gestures and timing, with the robot's arm adapting in each. "That is the appeal for training: not one continuation of a clip, but a distribution of them, each reproducible from its film file and seed," the team said.

These videos follow prompts, not robot commands. A training setup would need generation conditioned on specific actions. Teams can fine-tune the pre-trained LTX-2.5 checkpoint on frames and actions from their own robots. The same approach worked for a car camera in a snowstorm, though the model would not override implied speed from the opening footage when asked to accelerate.

Why this matters for creatives and developers

The project demonstrates that specialized AI accelerators can now handle video generation at speeds competitive with GPU-based cloud APIs. For teams building video pipelines, this means hardware choice is no longer limited to CUDA. The storyboard-to-film workflow, with reproducible takes and frame-level shot chaining, is directly applicable to pre-visualization, content drafting, and synthetic data generation. Those exploring these techniques can find structured learning paths through Text to Video AI Courses and AI Video Creation Courses.

Share