Skip to content

[Bug] WAN 2.2 generates black output when TP=2 and SP=2 are enabled simultaneously on XPU #1336

Description

@qiuxin2012

Description

I tested Wan2.2-TI2V-5B on Intel XPU(B70) with multi-GPU execution. Both Tensor Parallelism (TP=2) and Ulysses Sequence Parallelism (SP=2) work correctly when enabled separately. However, when TP=2 and SP=2 are used together, the generated result is entirely black.

Steps to Reproduce

Infer script:

#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
REPO_ROOT=$(cd -- "${SCRIPT_DIR}/../.." && pwd)

lightx2v_path=${LIGHTX2V_PATH:-${REPO_ROOT}}
model_path=${MODEL_PATH:-/llm/models/Wan2.2-TI2V-5B}
config_json=${CONFIG_JSON:-${lightx2v_path}/configs/dist_infer/wan22_ti2v_t2v_tp_ulysses.json}
output_path=${OUTPUT_PATH:-${lightx2v_path}/save_results/output_wan22_ti2v_t2v_tp2_ulysses2.mp4}
num_processes=${NUM_PROCESSES:-4}

# Use the normal rank-to-device mapping. This overrides the 0/1 swap used by
# the MiniMax-H3 physical-device diagnostic script.
export PLATFORM=intel_xpu
export LIGHTX2V_XPU_DEVICE_MAP=${LIGHTX2V_XPU_DEVICE_MAP:-0,1,2,3}
export PYTHONFAULTHANDLER=${PYTHONFAULTHANDLER:-1}
export PYTHONPATH=${PYTHONPATH:-}

source "${lightx2v_path}/scripts/base/base.sh"
mkdir -p "$(dirname -- "${output_path}")"

torchrun --standalone --nproc_per_node="${num_processes}" -m lightx2v.infer \
  --model_cls wan2.2 \
  --task t2v \
  --model_path "${model_path}" \
  --config_json "${config_json}" \
  --prompt "${PROMPT:-Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage}" \
  --negative_prompt "${NEGATIVE_PROMPT:-色调艳丽,过曝,静态,细节模糊不清,字幕,低质量,JPEG压缩残留,畸形,多余的手指,杂乱的背景}" \
  --seed "${SEED:-42}" \
  --save_result_path "${output_path}"

Config:

{
    "infer_steps": 50,
    "text_len": 512,
    "target_video_length": 120,
    "target_height": 704,
    "target_width": 1280,
    "cpu_offload": true,
    "offload_granularity": "phase",
    "t5_cpu_offload": true,
    "vae_cpu_offload": true,
    "num_channels_latents": 48,
    "vae_stride": [
        4,
        16,
        16
    ],
    "self_attn_1_type": "torch_sdpa",
    "cross_attn_1_type": "torch_sdpa",
    "cross_attn_2_type": "torch_sdpa",
    "sample_guide_scale": 5.0,
    "sample_shift": 5.0,
    "enable_cfg": true,
    "fps": 24,
    "rope_type": "torch_real_rope",
    "parallel": {
        "seq_p_size": 2,
        "seq_p_attn_type": "ulysses",
	"tensor_p_size": 2,
        "cfg_p_size": 1
    }
}

Expected Result

A normal video

Actual Result

A black video

Environment Information

  • Operating System: [Ubuntu 24.04.4]
  • Python Env: [python 3.12.3, torch 2.10.0+xpu, torchaudio 2.10.0+xpu, torchvision 0.25.0+xpu]
  • Commit ID: [cb8d588] + qiuxin2012@877a73e

Log Information

Additional Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions