Taking Trainium3 to the Track: Generating Videos with LTX-2.5

In one sentence

The author shares their experience and performance optimizations for generating videos with sound using the LTX-2.5 model and diffusers on AWS Trainium3.

Key points

  • Using an AWS Trainium3 machine, the author ran Lightricks' LTX-2.5 model via the diffusers library to generate short videos with sound.
  • After five days of optimization, generating a 10-second 2048×1024 clip on half the machine (32 NeuronCores) took 22 to 23 seconds, beating LTX's online API by about a second.
  • To create coherent short films, the author designed a JSON-based storyboard script that chains shots together using keyframes to maintain subject and motion continuity.
  • Performance optimizations focused on tensor parallelism to run the model on NeuronCores, sequence parallelism to scale across cores, and resolving host-side bottlenecks.

In depth

An AI-written overview of the original article, not the article itself.

Through a partnership with AWS, a Hugging Face author gained access to a Trainium3 machine for a month. According to the article, in the final five days, the author used Lightricks' LTX-2.5 model with diffusers to generate short films with sound. Once loaded, half of the machine produced a 10-second 2048×1024 clip in 22 to 23 seconds, matching and slightly beating LTX's paid API.

Performance Gains and Optimizations

The initial run was slow. According to the article, generating a 10-second 960×544 clip on 4 NeuronCores took about 5 minutes and 20 seconds, with most time wasted on the host. Five days later, running on 32 cores produced a 2048×1024 clip with four times the pixels in 22 to 23 seconds, a 14× speedup that beat the 23.7 seconds of LTX's 1080p API.

The gains came from both device and host fixes. On the device, the author combined tensor and sequence parallelism across 32 cores, compiled single blocks, and computed GELU in fp32. On the host, running the pipeline on rank 0 only, packing parameters into 1 GiB buffers, and moving video decoding to NeuronCores cut decode time from 357 seconds to 1.6 seconds.

Script-Based Filmmaking Workflow

To mimic real filmmaking, the author used a JSON storyboard listing each shot's name, detailed prompt, and seed. Because prompts alone cannot keep subjects consistent across cuts, shots are chained with from and to keys, starting from an earlier shot's last frames or ending on a later shot's first frames.

The films were built pose-to-pose, starting with the key payoff shot before extending backward and forward. Three diffusers pipelines handle generation and 2× latent upscaling, while about 160 lines of Python code order shots, trim frames, add captions, and even out the audio.

Current Limitations

Despite the speed, the setup remains suited for drafting rather than final production. The article notes that models take about 3 minutes to load, and the first clip takes 80 seconds. Moreover, the model still makes detail errors, such as giving a goat funny horns in three out of four takes, requiring multiple takes per shot.

Read originalOpens huggingface.co

This summary was generated by AI from the original article and may contain errors; the original is authoritative. Copyright belongs to the original author.

Recent stories from this source