Skip to content

Local video generation on Apple Silicon is 2x slower than the hardware permits #191

Closed

Description

@Sabmit

Summary

On my M3 Max, a 5 s, 540p, 24 fps clip with the LTX-2.5 Fast model takes 6 min 50 s.
With two changes I made, the same clip takes 3 min 35 s. The video output does not change.
The changes are in PR #189 and PR #190. This issue collects my measurements and explains the cause of each delay.

Environment

  • LTX Desktop 1.3.1, local generation, streaming mode
  • MacBook Pro M3 Max, 48 GB unified memory, internal SSD
  • macOS 27.0 (Darwin 27.0.0)
  • torch 2.11.0, ltx-core 1.4.1, ltx-pipelines 1.4.1
  • Model: LTX-2.5 Fast (distilled), text to video, 1024x576, 24 fps, 121 frames (5 s) or 73 frames (3 s), seed 42
  • Method: 3 interleaved rounds per build, median reported, output hash compared

Measurements

The 5 s clip (121 frames):

Build Total time Stage 1 Stage 2 VAE decode
main 6 min 50 s 3 min 08 s 1 min 48 s 1 min 37 s
PR #189 only 5 min 42 s (-17 %) 3 min 10 s 1 min 47 s 25 s
PR #190 only 4 min 56 s (-28 %) 1 min 14 s 1 min 42 s 1 min 38 s
PR #189 + PR #190 3 min 35 s (-48 %) 1 min 02 s 1 min 34 s 25 s

The two changes are independent. Their gains add.

The 3 s clip (73 frames), same prompt, seed and method:

Build Total time Stage 1 Stage 2 VAE decode
main 5 min 39 s 3 min 09 s 1 min 19 s 52 s
PR #189 + PR #190 2 min 52 s (-49 %) 1 min 14 s 1 min 06 s 14 s

Stage 1 takes the same time for a 3 s clip and a 5 s clip. The SSD limits it: the transformer streams 37 GB of weights per step, whatever the clip length.

Cause 1: the VAE decoder uses a slow Conv3d path on MPS

PyTorch has no native Conv3d kernel for MPS. It falls back to a generic path that is slow for the decoder's 3x3x3 kernels.
In PR #189 I compute each Conv3d as a sum of per-tap Conv2d calls. The sum rounds to bf16 three times where stock rounds once. The decoded frames agree with stock at 48.7 dB PSNR and 0.991 SSIM, and the output is deterministic.
VAE decode drops from 97 s to 25 s.

Cause 2: block weight reads hold the GIL

In streaming mode the transformer reads 48 weight blocks from disk for each denoising step. The safetensors reader holds the GIL during the copy.
The prefetch thread and the compute thread then wait for each other. The SSD runs at a fraction of its speed.
In PR #190 I read each block with os.preadv on Darwin, which releases the GIL. Stage 1 drops from 188 s to 62 s.

Remaining headroom

After both changes, stage 1 runs at the SSD limit (37 GB of weights per step) and stage 2 runs at the GPU limit (bf16 GEMM at 10 to 11 TFLOPS).
I also found that the VAE decode can save a further 10 s with a one-pass layout when unified memory permits. I do not think this gain justifies the complexity of a new PR. I can add it to PR #189 if you want it.

Request

Could you review PR #189 and PR #190? Both are Darwin-only patches with an install guard and a note on when to remove them, once upstream includes the fix.

Activity

  1. changed the title [-]Local video generation on Apple Silicon is 1.9x slower than the hardware permits[/-] [+]Local video generation on Apple Silicon is 2x slower than the hardware permits[/+] on Nov 2, 2026
  2. bureyburey commented on Nov 11, 2026

    @bureyburey
    Member

    thanks for your contribution Sabbagh Fares (@Sabmit)
    #189 has been implemented and released in v1.3.2
    #190 has not been due to internal changes in libraries (see the PR for my comment in there)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions