[distributed][tensor] AssertionError: AssertionError not raised : Placement (Shard(dim=2),) in test/distributed/tensor/test_attention.py
@LuFinch is already working on this.
Since Jun 8, 2026.
- Dominant language
- Python
- Stars
- 113
- Forks
- 129
- Avg merge
- 5d 9h
- Merged PRs (30d)
- 112
Description
### 🐛 Describe the bug
please get whls from https://github.com/intel/torch-xpu-ops/actions/runs/23637238144 or use or use gh download
```
gh run download 23637238144 --repo intel/torch-xpu-ops --name Torch-XPU-Wheel-1826-23637238144-1 --dir path --pattern "*.zip"
git clone -b distributed_2.11 https://github.com/daisyden/pytorch.git
cd pytorch
pip install -r requirements.txt
pip install pytest expecttest
pytest -v test/distributed/tensor/test_attention.py::TestSharding::test_attention_shard_without_cp
pytest -v test/distributed/tensor/test_attention.py::TestShardingWithLocalTensor::test_attention_shard_without_cp
```
```
Traceback (most recent call last):
File "/home/sdp/miniforge3/envs/xccl_test/lib/python3.10/site-packages/torch/testing/_internal/common_distributed.py", line 986, in run_test
getattr(self, test_name)()
File "/home/sdp/miniforge3/envs/xccl_test/lib/python3.10/site-packages/torch/testing/_internal/common_distributed.py", line 833, in wrapper
fn()
File "/home/sdp/miniforge3/envs/xccl_test/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3365, in wrapper
method(*args, **kwargs)
File "/home/sdp/miniforge3/envs/xccl_test/lib/python3.10/site-packages/torch/testing/_internal/common_distributed.py", line 241, in wrapper
return func(*args, **kwargs)
File "/home/sdp/miniforge3/envs/xccl_test/lib/python3.10/site-packages/torch/testing/_internal/distributed/_tensor/common_dtensor.py", line 902, in wrapper
raise e
File "/home/sdp/miniforge3/envs/xccl_test/lib/python3.10/site-packages/torch/testing/_internal/distributed/_tensor/common_dtensor.py", line 899, in wrapper
func(self, *args, **kwargs) # type: ignore[misc]
File "/home/sdp/xiangdong/pytorch/test/distributed/tensor/test_attention.py", line 922, in test_attention_shard_without_cp
self.assertNotEqual(
File "/home/sdp/miniforge3/envs/xccl_test/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 4371, in assertNotEqual
with self.assertRaises(AssertionError, msg=msg):
File "/home/sdp/miniforge3/envs/xccl_test/lib/python3.10/unittest/case.py", line 226, in __exit__
self._raiseFailure("{} not raised".format(exc_name))
File "/home/sdp/miniforge3/envs/xccl_test/lib/python3.10/unittest/case.py", line 163, in _raiseFailure
raise self.test_case.failureException(msg)
AssertionError: AssertionError not raised : Placement (Shard(dim=2),)
```
### Versions
https://github.com/daisyden/pytorch/tree/distributed_2.11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.