Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Matrix-Game-3: all multi-GPU runs fail with TypeError - attention() called with fa_version= instead of version=

オープン 初心者向け
#80 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
88/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python, pytorch

調査の方向性

Matrix-Game-3/wan/distributed/ulysses.py:63-70 から始め、attention() のキーワードと wan/modules/attention.py:176 のシグネチャを比較します。提供されているマルチGPU再現手順または Matrix-Game-3/test.sh を実行します。--ulysses_size が 1 より大きい、ドキュメントに記載されたパスで unexpected-keyword TypeError が発生しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Summary

Every run with --ulysses_size > 1 crashes immediately in the first DiT block with a TypeError. This includes the configuration in the repo's own Matrix-Game-3/test.sh (which uses --ulysses_size 7/8), so the documented multi-GPU path does not run as shipped.

Tested at commit 71c3cd7f741311f8100f6cf9cde942b6c1378d11.

Error

File "Matrix-Game-3/wan/distributed/ulysses.py", line 63, in distributed_attention
    x = attention(
TypeError: attention() got an unexpected keyword argument 'fa_version'

Cause

wan/distributed/ulysses.py:63-70 calls attention() with fa_version=:

from ..modules.attention import attention
x = attention(
    q, k, v,
    k_lens=seq_lens,
    window_size=window_size,
    fa_version=fa_version,   # <-- wrong keyword
)

but the parameter in wan/modules/attention.py:176 is named version:

def attention(
    q, k, v,
    ...
    version=None,
):

Only this call site is affected. The other fa_version=fa_version call sites (sequence_parallel.py:307,364 and model.py:591,596,613,615,678,1015,1027) target functions that do declare fa_version, so they are correct.

Fix

One word, in wan/distributed/ulysses.py:69:

-        fa_version=fa_version,
+        version=fa_version,

Reproduce

torchrun --nproc_per_node=2 generate.py \
  --size 704*1280 --ckpt_dir Matrix-Game-3.0 \
  --image demo_images/001/image.png --prompt "..." \
  --ulysses_size 2 --dit_fsdp --t5_fsdp \
  --num_iterations 3 --num_inference_steps 3 --use_int8

Fails identically regardless of --fa_version, GPU model, or whether FlashAttention is installed — the TypeError is raised before any attention backend is selected.

Environment

2x RTX 5090 (sm_120), torch 2.11.0+cu128, Python 3.12, WSL2 Ubuntu 22.04. The bug is hardware-independent.

Related minor issues

Happy to open these separately if you'd prefer — noting them here since they came up while getting the model running on 2 GPUs:

  1. WAN_VAE_SEGMENT_SIZE is undocumented. inference_pipeline.py:643 reads it (default 4), and it decides whether inference fits in 32 GB. At 4 the VAE decode exhausts VRAM at 704x1280 even with --use_int8, --t5_cpu and --lightvae_pruning_rate 0.5; at 1 the same run completes. A README note or a --vae_segment_size flag would help.

  2. stream_decode swallows exceptions. wan/modules/vae2_2.py:1349 catches Exception, logs one line, and returns None. That None then surfaces ~200 lines away as AttributeError: 'NoneType' object has no attribute 'cpu' (inference_pipeline.py:652), hiding the real CUDA/OOM error. Adding traceback.format_exc() there would make debugging much easier.

Thanks for open-sourcing the weights and code — the one-word fix above got 2-GPU inference working end to end for us.

主要言語
Python
スター
2.4k
フォーク
257
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SkyworkAI/Matrix-Game のほかの issue

SkyworkAI/Matrix-Game の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。