Commit 31cf49f
Fix flaky Github test (meta-pytorch#3315)
Summary:
Pull Request resolved: meta-pytorch#3315
`_maybe_compute_stride_kjt` returns `stride = 0` when `len(keys) == 0` or when `stride_per_key_per_rank` has invalid values.
Adding a guard condition `if stride > 0:` before the problematic `lengths.view(-1, stride)` operation in the `dist_init` method. When `stride` is 0 (e.g. indicating empty keys), skip the permutation.
Reviewed By: nipung90
Differential Revision: D80948346
fbshipit-source-id: c881ad4571dbc295ab7517bc9e351872bba3970e1 parent a29e47a commit 31cf49f
1 file changed
+13
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2992 | 2992 | | |
2993 | 2993 | | |
2994 | 2994 | | |
2995 | | - | |
2996 | | - | |
2997 | | - | |
2998 | | - | |
2999 | | - | |
3000 | | - | |
3001 | | - | |
3002 | | - | |
3003 | | - | |
3004 | | - | |
3005 | | - | |
3006 | | - | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
3007 | 3008 | | |
3008 | 3009 | | |
3009 | 3010 | | |
| |||
0 commit comments