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
{{ message }}
Repository navigation
Matmul sharding rule incorrectly allows for contraction dim with inconsistent shard order #166598
Hi @ezyang , I was looking into this to better understand the placement strategies. I propose a fix here #166999 which separates out the StridedShard ("exotic placement") and generates a decomposition strategy which has an explicit cost. I consider it a kind of proof of concept and so am very open to changes.
If we isolate the StridedShard to Shard (based on #167887), here are what will happen:
aten.mm selects the strategy from gen_einsum_strategies as: RS(1),RS(0) --> RP. Note that gen_einsum_strategies currently only produces the Strategy with Shard (no StridedShard).
The tensor B2 with StridedShard placement detects the device order and will be redistributed from _S(0, 2)S(0)[0]->RS(0), because it detects that StridedShard and Shard are different, and we need redistribute!
After the reordering and then matmul, we get the correct output.
Activity
ezyang commentedon Oct 30, 2025
Concretely, I think we should first try making StridedShard NOT report is_shard() and see what the blast radius is.
[DTensor] Fix matmul operations with _StridedShard placement (pytorch…
stmcgovern commentedon Nov 4, 2025
Hi @ezyang , I was looking into this to better understand the placement strategies. I propose a fix here #166999 which separates out the StridedShard ("exotic placement") and generates a decomposition strategy which has an explicit cost. I consider it a kind of proof of concept and so am very open to changes.
I believe it to be in alignment with #156217
Update base for Update on "[In Progress][DTensor] support flatten/unf…
Update on "[In Progress][DTensor] support flatten/unfllaten with _Str…
zpcore commentedon Nov 26, 2025
If we isolate the
StridedShardtoShard(based on #167887), here are what will happen:gen_einsum_strategiesas:RS(1),RS(0) --> RP. Note thatgen_einsum_strategiescurrently only produces the Strategy with Shard (no StridedShard).StridedShardplacement detects the device order and will be redistributed from_S(0, 2)S(0)[0]->RS(0), because it detects that StridedShard and Shard are different, and we need redistribute!Update base for Update on "[In Progress][DTensor] support flatten/unf…
Update on "[In Progress][DTensor] support flatten/unfllaten with _Str…
Update base for Update on "[In Progress][DTensor] support flatten/unf…
Update on "[In Progress][DTensor] support flatten/unfllaten with _Str…
Update base for Update on "[In Progress][DTensor] support flatten/unf…
Update on "[In Progress][DTensor] support flatten/unfllaten with _Str…
Update base for Update on "[In Progress][DTensor] support flatten/unf…
97 remaining items
Update on "[In Progress][DTensor] support flatten/unflatten with _Str…
Update base for Update on "[In Progress][DTensor] support flatten/unf…
Update on "[In Progress][DTensor] support flatten/unflatten with _Str…
Update base for Update on "[In Progress][DTensor] support flatten/unf…
Update on "[In Progress][DTensor] support flatten/unflatten with _Str…
Update base for Update on "[In Progress][DTensor] support flatten/unf…
Update on "[In Progress][DTensor] support flatten/unflatten with _Str…
Update base for Update on "[In Progress][DTensor] support flatten/unf…
Update on "[In Progress][DTensor] support flatten/unflatten with _Str…
Update base for Update on "[In Progress][DTensor] support flatten/unf…
Update on "[In Progress][DTensor] support flatten/unflatten with _Str…
Update base for Update on "[In Progress][DTensor] support flatten/unf…
Update on "[In Progress][DTensor] support flatten/unflatten with _Str…
Update base for Update on "[In Progress][DTensor] support flatten/unf…
Update on "[In Progress][DTensor] support flatten/unflatten with _Str…