You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To reproduce this issue, run the follow script using torchrun:
importtorch.distributed.tensor.debugimporttorch.distributed.tensorasdtimporttorch.distributedasdistimportosrank=int(os.getenv("RANK", "0"))
defrender(t, msg):
ifrank==0:
print(msg)
dt.debug.visualize_sharding(t, use_rich=False)
m=dist.init_device_mesh("cuda", (4,))
t=dt.distribute_tensor(torch.ones(4), m, [dt.Shard(dim=0)])
dt.debug.visualize_sharding(t, use_rich=True)
t=dt.distribute_tensor(torch.ones(4), m, [dt.Replicate()])
dt.debug.visualize_sharding(t, use_rich=True)
The first call to visualize_sharding would fail with
[rank0]: Traceback (most recent call last):
[rank0]: File "/root/w/l/s.py", line 17, in <module>
[rank0]: dt.debug.visualize_sharding(t, use_rich=True)
[rank0]: File "/root/w/pytorch/torch/distributed/tensor/debug/_visualize_sharding.py", line 201, in visualize_sharding
[rank0]: (offset[1], offset[1] + shape[1] - 1),
[rank0]: ~~~~~~^^^
[rank0]: IndexError: tuple index out of range
Versions
# pip list | grep torch
torch 2.8.0a0+git730a077 /root/w/pytorch
π Describe the bug
To reproduce this issue, run the follow script using torchrun:
The first call to
visualize_sharding
would fail withVersions
cc @H-Huang @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @tianyu-l @XilunWu
The text was updated successfully, but these errors were encountered: