LTX-2.5 on Trainium3 can turn out a 10-second clip with sound in 22 to 23 seconds once the models are in memory. A Hugging Face engineer reached that figure after AWS lent the team a trn3.48xlarge machine (64 NeuronCores) for a month. With five days left, the engineer tried video generation, and the benchmark ran on half the machine at 2048×1024.
Why try video on Trainium3
The model is Lightricks’ LTX-2.5, which produces picture and audio in one pass. Two questions drove the test. First, can the diffusers library handle scripted short films on this hardware, instead of the toy clips in its examples? Second, how close can speed get to CUDA or to LTX’s hosted API?
No trustworthy CUDA number exists to compare with. LTX quotes 6.8 seconds for 10 seconds of 720p video on four B200 GPUs, but doesn’t explain the measurement. The hosted API is the fairer yardstick: LTX says it renders 10 seconds of 1080p footage in 23.7 seconds. The Trainium3 run matches that and comes in about a second faster.
Building a film out of shots
A film is a JSON file listing shots. Every entry has a name and a prompt, like a storyboard panel, and optionally a seed so the preferred take can be reproduced. LTX-2.5 follows long prompts better, so each one is a paragraph describing style, subject, motion, camera, lighting and sound.
A prompt can’t carry a character across a cut by itself, so two keys link shots together:
- “from” begins a shot on the final frames of an earlier one. One frame preserves appearance, while the last 25 frames (a second) also preserve movement.
- “to” finishes a shot on the opening frames of a later shot, so it flows into it.
The demo film follows a seal. The author built it the way animators work “pose to pose”: get the key shot right first, then fit the others around it. Here the key shot is an iceberg rolling over and soaking the seal. The napping shot ends on that shot’s first 9 frames. The final shot, where the wet seal shakes itself off, begins on its last 25 frames.
Three diffusers pipelines share the LTX-2.5 weights. One generates shots from text, a second handles shots anchored to other shots’ frames, and a third upscales the latents 2x before the last three steps. Around them sits roughly 160 lines of Python that orders the shots, passes frames along, trims, adds captions, evens out the audio and joins everything. The code is in the dacorvo/video-generation repository.
Getting LTX-2.5 on Trainium3 to perform
At first nothing ran. The transformer is too large for one NeuronCore, and diffusers has no plan to shard it. The first working version spread it over four cores with a few patches and needed about 5 minutes 20 seconds per 10-second clip, while the cores themselves were busy for only 45 seconds of that.
Five days of work changed the picture. Host-side time per clip fell from roughly 280 seconds to roughly 8, about 35 times less. Device time dropped from 45 seconds to 15, and that run produced four times as many pixels and included a second stage the first version couldn’t load. Splitting the sequence across cores lets one clip occupy 32 of the 64 cores, which is what made 2048×1024 fit at all.
A few puzzles stayed unsolved. One size of the transformer returned NaN when compiled as a single graph. The first shot ending on keyframes ran slowly in every fresh process, even with a warm cache. The latent upsampler won’t load beside the transformer, so it runs on the CPU.
Practical lessons
- Validate every model split on the CPU before moving it to the device. That is how a GELU bug turned up.
- Watch graph sizes. Shapes determine whether attention uses the fast kernel, and oversized graphs refuse to load.
- Avoid editing traced code. With the torch-neuronx build used, the cache key contained each op’s file and line, so a small edit could force a recompile taking up to 30 minutes per graph.
- Shoot multiple takes. A goat got odd horns in 3 of 4 takes of one prompt, so each new shot got four takes.
- Keep each shot in one location. When a shot moved a fox from forest to lake, the model dissolved into a different fox.
What a production service would need
A real service would leave its processes running: loading takes about 3 minutes, and the first clip afterwards takes 80 seconds. Given the same film file and code, the output is identical byte for byte.
Part of the workaround list may vanish soon. Diffusers pull request #15420 fixes the LTX-2 pipelines, and #14725 would fold tensor and context parallelism into a single ParallelConfig, with a plan for LTX-2.5 to follow. If both land, running LTX-2.5 on Trainium3 should take fewer patches.
Source: huggingface.co