Skip to content

fix(ltx2): move tensor-parallel weight slices to the device before send - #1717

Open
klin-amd wants to merge 1 commit into
ModelTC:mainfrom
klin-amd:dev/klin/ltx2-tp-load-device
Open

klin-amd wants to merge 1 commit into
ModelTC:mainfrom
klin-amd:dev/klin/ltx2-tp-load-device

Conversation

@klin-amd

@klin-amd klin-amd commented Nov 15, 2026 •

Copy link
Copy Markdown

Problem

LTX-2 tensor parallel (configs/ltx2/ltx2_tp.json, tensor_p_size: 2) fails while loading the model. Rank 0 loads the checkpoint on the CPU, and LTX2Model._load_weights_from_rank0 sends each rank its TP weight slice with dist.send over the NCCL TP group without moving it to the device:

RuntimeError: No backend type associated with device type cpu

Rank 0 then waits in destroy_process_group while rank 1 waits in dist.recv, so the run hangs with both GPUs idle and the error is not printed (see #1712).

Fix

Move the slice to the device before dist.send, as the non-TP path in the same function and the Wan and Flux.2 TP loaders already do.

Test

LTX-2 19B dev, t2av, ltx2_tp.json (TP2) with 512x768, 97 frames and flash_attn3, 40 steps, seed 42, H100, compared with a single-GPU run of the same config:

main This PR
TP2 hangs at model load runs
Final video vs. single GPU, per-frame PSNR - 42.6 dB mean / 42.2 dB min, no visible difference

pre-commit run passes on the changed file.

In tensor parallel, rank 0 loads the checkpoint on the CPU and sends
each rank its weight slice with dist.send over the NCCL TP group, which
cannot send CPU tensors:

    RuntimeError: No backend type associated with device type cpu

Rank 0 then waits in destroy_process_group while rank 1 waits in recv,
so the run hangs without printing the error. Move the slice to the
device first, as the non-TP path and the Wan and Flux.2 loaders do.

LTX-2 19B dev, t2av, ltx2_tp.json (TP2) at 512x768, 97 frames, 40
steps: loads and runs; final video vs. single GPU per-frame PSNR
42.6 dB mean (bf16 reduction order), no visible difference.

Signed-off-by: Lin, KuanTing <Kuanting.Lin@amd.com>
@klin-amd
klin-amd marked this pull request as ready for review November 15, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant