ReadingResearchRadarInvestment framework
Sign in / Sign up
← Back to reading
NewsMaterial5 min readDisconfirmAI Editorial

A Hugging Face Engineer's Trainium3 Video Generation Log: Why Host-Side Fixes Delivered the Biggest Gains

David Corvoysier describes making LTX-2.5 generate 10-second video clips with sound in 22 to 23 seconds on half an AWS Trainium3 machine, matching LTX's own API claim. The optimization journey reveals that host-side coordination fixes produced a 35× improvement in host time while device compute improved only 3×, and that sequence parallelism (not just tensor parallelism) is what allows a single clip to use 32 cores. He also explains a pose-to-pose filmmaking workflow that maintains character consistency across generated shots by chaining frames between clips.

2026-11-27

David Corvoysier, an engineer at Hugging Face, spent five days at the end of a month-long Trainium3 trial trying to generate videos with LTX-2.5 on AWS's custom accelerator. The result: a 10-second clip with sound in 22 to 23 seconds on half the machine (32 of 64 NeuronCores), matching LTX's own online API, which claims 23.7 seconds for a 10-second 1080p clip. The comparison is imperfect—Corvoysier's output is 2048×1024 rather than 1080p, and LTX's API figure is self-reported—but the engineering journey behind those numbers contains several transferable lessons for anyone deploying large models on non-NVIDIA hardware.

The first lesson is about what actually constrains performance. Corvoysier identifies three categories of work: making the model fit on the cores at all (tensor parallelism, splitting the transformer's weights across 4 cores), splitting the video tokens across more cores so a single clip uses the full machine (sequence parallelism, 8-way), and keeping the host CPU from becoming the bottleneck. The biggest end-to-end savings came from the last category, which he calls "the low-hanging fruit, since that is obviously where the waste was."

The numbers make this concrete. In the first attempt, the whole pipeline ran on 4 cores and took 5 minutes 20 seconds for a 10-second clip at 960×544, but the NeuronCores were only computing for about 45 seconds of that time. After optimization—still on half the machine but now 32 cores, at 2048×1024 (roughly 4× more pixels)—the wall time dropped to 22 to 23 seconds, with 15 seconds actually on the NeuronCores. The host time fell from about 280 seconds to about 8 seconds, a 35× improvement. The device time improved 3×, but the host improvement was more than ten times larger.

Sign in / Sign up
ReadingResearchRadarInvestment framework

Specific host fixes included: running the pipeline only on rank 0 instead of having every rank redundantly encode the prompt on the CPUs (prompt encoding dropped from about 205 seconds to 7.5 seconds); decoding the video on the NeuronCores split by frames rather than on CPU (357 seconds dropped to 1.6 seconds at 2048×1024); pinning rank 0's threads to CPUs that other ranks do not use and capping the other ranks' thread pools (prompt encoding further dropped from 7.4 to 3.3 seconds); and running the text encoder only on actual prompt tokens rather than padding to 1024 (3.4 seconds to 1.4 seconds). Each fix addressed a specific coordination or data-movement waste on the host side, not a fundamental compute limitation on the device.

On the device side, the key architectural insight is that sequence parallelism is what allows a single clip to use many cores. Tensor parallelism is imposed by memory—the transformer does not fit on one NeuronCore—and capped by the 32 attention heads. But splitting the video tokens across 8 cores (TP-4 × SP-8 = 32 cores) is what made 2048×1024 possible at all, by shrinking each core's graph until it loaded. Without sequence parallelism, the block graph at that resolution simply fails to load on 4 cores.

The article also reveals a practical filmmaking workflow that transfers beyond Trainium. Corvoysier explains that prompts alone cannot keep a character consistent from one shot to the next. His solution is shot chaining: a shot can start from the last frames of an earlier shot (the "from" key) or end on the first frames of a later shot (the "to" key). He describes two approaches borrowed from animation: "straight ahead," where each shot continues the one before, and "pose to pose," where you first make the key shot (the payoff), then build shots before it to end on its first frames and shots after it to start from its last frames. For the seal film, the payoff is the iceberg rolling over and drenching the seal; the preceding "nap" shot ends on the iceberg's first 9 frames, and the following "shake" shot starts from its last 25 frames, keeping the seal, floe, and iceberg consistent across cuts.

Corvoysier also tried LTX-2.5 as a world model on real footage. Given the first second of a robot's head-camera video, the model invents the rest of the action, keeping the scene consistent. More interesting for training are the events that did not happen: from the same second of footage, changing only the prompt produces a person helping the robot carry an orange, with five takes showing different gestures and timing. The model adapts the robot's arm to each human action. This demonstrates a distribution of plausible continuations, each reproducible from its film file and seed. However, Corvoysier notes that these videos follow prompts, not the robot's or car's actual commands—a training setup would need generation conditioned on those actions, which requires fine-tuning the pre-trained checkpoint on a team's own robot data.

Several limitations remain. Each shot makes its own sound, and audio does not carry over between shots. A shot lasts at most 20 seconds. The model still gets details wrong—Corvoysier made 4 takes of each new shot and picked one, noting that the same prompt gave a goat funny horns in 3 out of 4 takes. Three issues were never fully explained: the transformer compiled as one graph returned NaN at one size, the first shot ending on keyframes was slow in each new process even with cached graphs, and the latent upsampler fails to load next to the transformer so it stays on CPU. Corvoysier notes that a production service would need to keep processes warm, since loading the models takes about 3 minutes and the first clip after loading takes 80 seconds—costs amortized only by serving many clips from the same loaded instance.

Some of this is being fixed upstream. A diffusers pull request (#15420) would make the text-encoder-on-CPU workaround unnecessary, and another (#14725) brings tensor and context parallelism into a single ParallelConfig, with a plan for LTX-2.5 specifically. The torch-neuronx cache-key issue that could trigger 30-minute recompiles per graph after any code edit has been closed.

Sources

  • huggingface.co↗
Continue researching →