Running LTX-2.5 Video Generation on Trainium3
Running LTX 2.5 Video Generation on Trainium3 Published November 27, 2026 With access to an AWS machine containing 64 NeuronCores for one month, the team tested Hugging Face mod...
By Software Development Team
Running LTX-2.5 Video Generation on Trainium3
Published November 27, 2026
With access to an AWS trn3.48xlarge machine containing 64 NeuronCores for one month, the team tested Hugging Face models on Trainium3. In the final five days, it used the hardware to generate videos with Lightricks' LTX-2.5, a model that produces video and sound together.
After the models were loaded, a 10-second clip with sound took 22 to 23 seconds to generate on half of the machine. The output resolution was 2048×1024.
Two goals
The project had two objectives:
- Determine how practical video generation with diffusers was on Trainium3, including short films assembled from scripted shots rather than isolated clips.
- Compare performance with CUDA-based systems and LTX's online API.
There was no detailed CUDA benchmark available for a direct comparison. LTX reports 6.8 seconds for a 10-second 720p clip on four B200 GPUs, but the measurement method is not described. The comparison therefore used LTX's online API, which LTX says generates a 10-second 1080p clip in 23.7 seconds.
The Trainium3 setup produced a 10-second, 2048×1024 clip in 22 to 23 seconds after model loading, using half of the machine. This was approximately one second faster than the reported API result, despite limited time for pipeline optimization.
Building a film from shots
The input is a JSON list of shots. Each shot has a name and a prompt, similar to a storyboard. LTX-2.5 performs better with long prompts, so the prompts describe the visual style, subject, movement, camera, lighting, and sound.
A shortened version of the seal film's file looks like this:
[
{"name": "dream", "prompt": "Style: cinematic, realistic, shallow depth of field. A plump seal ... is fast asleep on warm golden sand under palm trees ...",
"seed": 3},
{"name": "nap", "prompt": "Style: cinematic, realistic, wide-angle lens. ... a plump grey seal is fast asleep on a small ice floe ...",
"seed": 1, "to": {"shot": "iceberg", "frames": 9}},
{"name": "iceberg", "prompt": "Style: cinematic, realistic, wide-angle lens. ... the whole iceberg slowly rolls over ... and washes over the seal. ..."},
{"name": "shake", "prompt": "Style: cinematic, realistic, wide-angle lens. ... It slowly shakes its head and body ... and flops down on its belly on the floe, ...",
"from": {"shot": "iceberg", "frames": 25}}
]
The seed selects a repeatable take from multiple generations. Shots can be connected with two keys:
from: starts a shot from the final frames of an earlier shot. Using the final frame maintains the subject's appearance across a cut, while using several final frames also continues the motion.to: ends a shot on the first frames of a later shot, allowing the later shot to continue from it.
Shots can also be trimmed or given captions.
This structure supports two animation workflows. In a straight-ahead workflow, each shot continues the preceding one. In a pose-to-pose workflow, a key shot is created first, and the surrounding shots are generated to lead into or continue from it.
The seal film uses the pose-to-pose approach. The iceberg shot is the payoff: the iceberg rolls over and a wave drenches the seal. The nap shot ends on the first nine frames of iceberg, keeping the seal, floe, and iceberg consistent. The shake shot starts from the final 25 frames of iceberg, showing the wet seal shaking off the water. The dream shot is generated separately and joined with a cut.
The seal film's shot chain uses iceberg as the key shot. nap leads into its first nine frames, while shake continues from its last 25 frames.
Diffusers pipelines
Three diffusers pipelines share the LTX-2.5 models:
LTX2Pipelinegenerates shots from prompts alone.LTX2ConditionPipelinegenerates shots that begin or end on frames from another shot.LTX2LatentUpsamplePipelineupscales the latents by 2 before three final steps.
The first two pipelines follow the model card's two-stage distilled process: eight steps followed by upscaling and three additional steps.
The film-generation layer adds approximately 160 lines of Python around the diffusers pipelines. It reads the film file, orders shots so required keyframes exist before they are referenced, transfers frames between shots, trims clips, adds captions, balances audio levels, and assembles the final film.
The implementation is available in the dacorvo/video-generation repository. The generated films and their JSON files include the seal, fox, and goat examples. The fox film was made straight ahead, with each shot continuing the previous one. The goat film includes two trimmed shots and a caption over its payoff.
Running on Trainium3
The model did not run on NeuronCores without modification. The transformer was too large for one core, and diffusers did not provide a way to split it. An initial implementation, based on the model card's pipeline with the transformer divided across four cores and several patches, required approximately 5 minutes 20 seconds for a 10-second clip. The NeuronCores computed for only about 45 seconds, and the target resolution was not possible.
After five days of optimization, the results were:
| Configuration | NeuronCores | Wall time | Time on NeuronCores |
|---|---|---|---|
| First attempt, 960×544 | 4 | 5 min 20 s | 45 s |
| Optimized, 2048×1024, approximately four times more pixels | 32 | 22 to 23 s | 15 s |
The optimized version used tensor parallelism to split the model weights and sequence parallelism to divide the video tokens across more cores.
The layout uses TP-4 × SP-8 across 32 cores. The weights are split four ways, while the video tokens are split into eight temporal sections.
Making the model work
Most device-side changes addressed parallelism, compilation, numerical behavior, and input handling.
| Problem | Workaround | Result |
|---|---|---|
| The transformer did not fit on one NeuronCore, and diffusers had no tensor-parallel plan. | Added a parallelism plan and an attention processor operating on the heads of one rank. | The transformer ran across four cores. |
| The text encoder could not fit beside the transformer on a NeuronCore. | Pinned the pipeline to the host, moved transformer inputs to the cores, and returned outputs to the host. | The pipeline ran with the transformer on the cores. |
| A transformer compiled as one graph returned NaN at one size, and each process retraced it. | Compiled one repeated block with compile_repeated_blocks. | Outputs became finite, and tracing time fell from 388 seconds to 18 seconds. |
torch-neuronx computed bf16 GELU entirely in bf16. | Computed GELU in fp32. | Transformer error against fp32 fell from 0.297 to 0.158, close to the CPU bf16 value of 0.160. |
| The 2048×1024 block graph split across four ways failed to load. | Added sequence parallelism, splitting video tokens eight ways with custom attention processors. | Stage 2 ran on 4 × 8 = 32 cores at 3.0 seconds per step. |
| A shot starting from frames had a separate timestep for every video token, and its graph failed to load. | Embedded only two timesteps and selected one for each token. | Frame-conditioned shots took approximately as long as prompt-only shots. |
Improving performance
Further changes reduced host overhead, memory usage, decoding time, and transformer execution time.
| Problem | Workaround | Gain |
|---|---|---|
| Every rank ran the full pipeline and encoded the prompt on the CPUs of one socket. | Ran the pipeline only on rank 0 and sent other ranks the arguments for each call. | Prompt encoding fell from approximately 205 seconds to 7.5 seconds. |
The torch-neuronx allocator left most memory segments unused. | Packed parameters into buffers of at most 1 GiB. | Memory per core fell from 22.96 GiB to 10.2 GiB. |
| Attention used plain operations unless the sequence length was a multiple of 128 tokens. | Generated at 1024×512, or 512 tokens per frame, with NEURON_LOGICAL_NC_CONFIG=2. | Transformer step time fell from 4.3 seconds to 3.0 seconds. |
| CPU video decoding was slow, and adding CPU cores did not help. | Decoded on NeuronCores, split work by frame, and transferred frames to rank 0 through shared memory. | Decoding at 2048×1024 fell from 357 seconds to 1.6 seconds. |
| A strided slice copied to the device used a slow device-side copy. | Applied .contiguous() before the copy. | Step time on 16 cores fell from 5.6 seconds to 1.0 second. |
| Rank 0 handled CPU stages while 31 other ranks competed for the node-wide thread pool. | Pinned rank 0's threads to unused CPUs and limited other ranks to their allocated share. | Prompt encoding fell from 7.4 to 3.3 seconds, and Stage 1 step time from 0.9 to 0.6 seconds. |
| The CPU text encoder processed padding up to 1024 tokens. | Encoded only the prompt's actual tokens. | Prompt encoding fell from 3.4 to 1.4 seconds. |
Three issues remained unexplained: a single-graph transformer returned NaN at one size, the first keyframe-ending shot was slow in each new process even with cached graphs, and the latent upsampler could not load beside the transformer and therefore remained on the CPU.
Some related fixes were being developed upstream. The open diffusers#15420 change addresses the LTX-2 pipelines and would remove the need for the second workaround in the earlier table. The still-open diffusers#14725 change combines tensor and context parallelism in one ParallelConfig, with a _tp_plan for LTX-2.5 planned.
Lessons learned
- The host and device both required optimization. Host time for a clip fell from approximately 280 seconds to about 8 seconds, or roughly 35 times faster. NeuronCore time fell from 45 to 15 seconds, a threefold improvement, despite using four times as many pixels and a second stage that the first attempt could not load.
- Sequence parallelism allowed one clip to use more of the machine. Tensor parallelism was required because the transformer did not fit on one core and was limited by the 32 attention heads. Sequence parallelism placed 32 of the 64 NeuronCores on a single clip and made 2048×1024 generation possible by reducing each core's graph size.
- Graph size must be considered on Trainium. Shape choices determine whether attention uses the fast kernel, and graphs that are too large fail to load.
- CPU validation is important. Each model split was checked on the CPU before running on the device. CPU comparison exposed the GELU issue.
- Traced code should remain stable. In the build used for the test, the
torch-neuronxcache key included the file and line of each traced operation. An edit could trigger recompilation of up to 30 minutes per graph. This behavior had been reported inaws-neuron/torch-neuronx#1027, which is now closed. - Films require more than prompts. Prompts alone do not reliably preserve a character or setting between shots. Starting or ending shots on frames from other shots provides that continuity. Shots also need to remain spatially consistent. In an early fox-film version, moving the fox from a forest to a lake caused the model to create a cross-dissolve to another fox.
- Multiple takes are necessary. The model frequently gets details wrong. For example, the same goat prompt produced unusual horns in three of four takes. Four takes were generated for each new shot, with one selected for the final film.
Professional use cases
Once the models are loaded, a 10-second 2048×1024 clip with sound takes 22 to 23 seconds. This is close to LTX's paid API performance while using half of the instance. A production service would keep its processes running because model loading takes about three minutes, followed by approximately 80 seconds for the first clip.
The diffusers implementation supports film drafting. Shots are generated from prompts and can preserve their subjects by starting or ending on frames from other shots. Seeds make takes reproducible, and the film file records the selected take. Re-running the same code with the same film file produces the same film byte for byte.
A shot can also start from an image, such as a storyboard frame or character sheet. The condition pipeline accepts the image in the same way it accepts video frames, although this workflow was not tested as part of a film.
The system remains suited to drafts for several reasons:
- The model can get details wrong, so new shots generally require several takes.
- Each shot generates its own sound. The film can balance the background level, but sound does not carry over between shots.
- A shot can last no more than 20 seconds, which is the model's limit.
From films to world models
LTX describes LTX-2.5 as a world model and identifies robotics as an emerging use. Robots, cars, and drones can learn from videos captured by their cameras, while a world model can generate additional examples, including events that are rare or dangerous to record.
The same film-generation code was tested on real footage. A shot can begin with the first second of a camera clip and generate a possible continuation. A single frame was insufficient because it does not show how quickly objects are moving.
One example used footage from the head camera of a Fourier GR1-T2 humanoid robot, taken from NVIDIA's GR1-100 dataset. In the real six-second clip, the robot's left hand picks up an orange from a plate and drops it into a tray. The model received only the first second, showing the raised hands before movement began, and generated what happened next.
The generated continuation independently produced the grab while maintaining the table, hands, and fruit consistently with the real footage. With the same initial second but a different prompt, another person leaned over, grabbed the orange, and carried it to the tray together with the robot. Five takes were generated, with the real footage placed first.
The person's gestures and timing varied between takes, and the robot's arm adapted to those changes. This illustrates the potential training value of generating a reproducible distribution of possible continuations rather than a single continuation. Each result can be regenerated from its film file and seed.
The robotics examples also include footage from a car's front camera during a snowstorm, sourced from Boreas. In one alternate event, a passing truck throws slush onto the lens. When prompted to make the car accelerate instead, the model kept the car's speed, suggesting that the first second of footage constrained the continuation more strongly than the prompt.
These videos respond to prompts rather than the commands of the robot or car. A training system would need generation conditioned on actions. One approach would be to fine-tune LTX-2.5's pre-trained checkpoint on frames and actions collected from the target robots.
The Trainium3 test demonstrated that LTX-2.5 video generation could run at the reported performance on half of the machine, while the shot-based workflow supported reproducible short-film drafts and exploratory robotics continuations.