Matrix-Game icon indicating copy to clipboard operation
Matrix-Game copied to clipboard

Bug: Error: only integer tensors of a single element can be converted to an index

Open wangmiaowei opened this issue 8 months ago • 1 comments

My num_gpus is 6: and test with the command:

torchrun --nproc_per_node=$NUM_GPUS generate.py --size 704*1280 --dit_fsdp --t5_fsdp --ckpt_dir Matrix-Game-3.0 --fa_version 3 --use_int8 --num_iterations 12 --num_inference_steps 3 --image demo_images/001/image.png --prompt "A colorful, animated cityscape with a gas station and various buildings." --save_name test --seed 42 --compile_vae --lightvae_pruning_rate 0.5 --vae_type mg_lightvae --output_dir ./output

ank4]: Traceback (most recent call last): [rank4]: File "/mnt/group/miaoweiwang/survey/Matrix-Game/Matrix-Game-3/generate.py", line 193, in [rank4]: generate(args) [rank4]: File "/mnt/group/miaoweiwang/survey/Matrix-Game/Matrix-Game-3/generate.py", line 172, in generate [rank4]: pipeline.generate( [rank4]: File "/mnt/group/miaoweiwang/survey/Matrix-Game/Matrix-Game-3/pipeline/inference_pipeline.py", line 602, in generate [rank4]: latents = test_scheduler.step( [rank4]: ^^^^^^^^^^^^^^^^^^^^ [rank4]: File "/mnt/group/miaoweiwang/survey/Matrix-Game/Matrix-Game-3/wan/utils/fm_solvers_unipc.py", line 697, in step [rank4]: model_output_convert = self.convert_model_output( [rank4]: ^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank4]: File "/mnt/group/miaoweiwang/survey/Matrix-Game/Matrix-Game-3/wan/utils/fm_solvers_unipc.py", line 323, in convert_model_output [rank4]: x0_pred = sample - sigma_t * model_output [rank4]: ~~~~~~~~^~~~~~~~~~~~~~ [rank4]: TypeError: only integer tensors of a single element can be converted to an index

wangmiaowei avatar Apr 03 '26 22:04 wangmiaowei

The command is detailed, but the stack trace points to one rank and likely a shape/indexing path under FSDP + multi-GPU settings. Could you include the full first exception frame above the repeated rank logs, plus whether the same command works with --nproc_per_node=1 or without --dit_fsdp/--t5_fsdp? That would help separate a distributed-sharding issue from an input/config issue in the generation path.

hiSandog avatar Jun 27 '26 16:06 hiSandog