Repository navigation
Back out "[pytorch] Vectorize indexFuncLargeIndex for contiguous tensors (#175760)" (#182693) - #182693
Back out "[pytorch] Vectorize indexFuncLargeIndex for contiguous tensors (#175760)" (#182693)#182693AlbertDachiChen wants to merge 1 commit into
Conversation
|
This appears to be a diff that was exported from phabricator, but the PR author does not have sufficient permissions to run CI. @AlbertDachiChen, please do step 2 of internal wiki to get write access so you do not need to get CI approvals in the future. If you think this is a mistake, please contact the Pytorch Dev Infra team. |
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/182693
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 19650e4 with merge base cdae8ab ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@AlbertDachiChen has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104098792. |
This PR needs a
|
86b83c8 to
7c8a225
Compare
…ors (pytorch#175760)" (pytorch#182693) Summary: D94314062 introduced a VecSize=4 fast path in indexFuncLargeIndex that amortizes divmod and index lookup by having each thread process consecutive elements. On uniform-random workloads this gives a ~1.8-2.0x speedup. However, when the index distribution is heavy-tailed (e.g. zipf, or skewed where a few hot rows receive millions of writes), the fast path issues 4 atomicAdds back-to-back from the same warp into consecutive cache lines of the same destination row. The L2 atomic queue cannot drain between the unrolled rounds, and the resulting serialization causes a 4.7x slowdown on fp32 zipf inputs (and ~2x on bf16). Measured on a B200 with dst=[1.72M,128] and nIdx=7.77M: {F1989310065} Proposal https://fb.workplace.com/groups/482605989533128/permalink/1656067795520269/ exhibits highly skewed behavior and saw a regression with the diffs We back the current implementation out temporarily and will be following the approach of pytorch#182675 instead and address the contention problem Test Plan: CI Reviewed By: yjhao Differential Revision: D104098792
|
|
7c8a225 to
1c0f242
Compare
…ors (pytorch#175760)" (pytorch#182693) Summary: D94314062 introduced a VecSize=4 fast path in indexFuncLargeIndex that amortizes divmod and index lookup by having each thread process consecutive elements. On uniform-random workloads this gives a ~1.8-2.0x speedup. However, when the index distribution is heavy-tailed (e.g. zipf, or skewed where a few hot rows receive millions of writes), the fast path issues 4 atomicAdds back-to-back from the same warp into consecutive cache lines of the same destination row. The L2 atomic queue cannot drain between the unrolled rounds, and the resulting serialization causes a 4.7x slowdown on fp32 zipf inputs (and ~2x on bf16). Measured on a B200 with dst=[1.72M,128] and nIdx=7.77M: {F1989310065} Proposal https://fb.workplace.com/groups/482605989533128/permalink/1656067795520269/ exhibits highly skewed behavior and saw a regression with the diffs We back the current implementation out temporarily and will be following the approach of pytorch#182675 instead and address the contention problem Test Plan: CI Reviewed By: yjhao Differential Revision: D104098792
…ors (pytorch#175760)" (pytorch#182693) Summary: D94314062 introduced a VecSize=4 fast path in indexFuncLargeIndex that amortizes divmod and index lookup by having each thread process consecutive elements. On uniform-random workloads this gives a ~1.8-2.0x speedup. However, when the index distribution is heavy-tailed (e.g. zipf, or skewed where a few hot rows receive millions of writes), the fast path issues 4 atomicAdds back-to-back from the same warp into consecutive cache lines of the same destination row. The L2 atomic queue cannot drain between the unrolled rounds, and the resulting serialization causes a 4.7x slowdown on fp32 zipf inputs (and ~2x on bf16). Measured on a B200 with dst=[1.72M,128] and nIdx=7.77M: {F1989310065} Proposal https://fb.workplace.com/groups/482605989533128/permalink/1656067795520269/ exhibits highly skewed behavior and saw a regression with the diffs We back the current implementation out temporarily and will be following the approach of pytorch#182675 instead and address the contention problem Test Plan: CI Reviewed By: yjhao Differential Revision: D104098792
1c0f242 to
19650e4
Compare
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
This PR needs a
|
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
This PR needs a
|
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
This PR needs a
|
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
This PR needs a
|
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
This PR needs a
|
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
This PR needs a
|
|
@pytorchbot merge -f 'This has been landed internally' |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…ors (pytorch#175760)" (pytorch#182693) (pytorch#182693) Summary: D94314062 introduced a VecSize=4 fast path in indexFuncLargeIndex that amortizes divmod and index lookup by having each thread process consecutive elements. On uniform-random workloads this gives a ~1.8-2.0x speedup. However, when the index distribution is heavy-tailed (e.g. zipf, or skewed where a few hot rows receive millions of writes), the fast path issues 4 atomicAdds back-to-back from the same warp into consecutive cache lines of the same destination row. The L2 atomic queue cannot drain between the unrolled rounds, and the resulting serialization causes a 4.7x slowdown on fp32 zipf inputs (and ~2x on bf16). Measured on a B200 with dst=[1.72M,128] and nIdx=7.77M: {F1989310065} Proposal https://fb.workplace.com/groups/482605989533128/permalink/1656067795520269/ exhibits highly skewed behavior and saw a regression with the diffs We back the current implementation out temporarily and will be following the approach of pytorch#182675 instead and address the contention problem Test Plan: CI Reviewed By: yjhao Differential Revision: D104098792 Pull Request resolved: pytorch#182693 Approved by: https://github.com/drisspg
…ors (pytorch#175760)" (pytorch#182693) (pytorch#182693) Summary: D94314062 introduced a VecSize=4 fast path in indexFuncLargeIndex that amortizes divmod and index lookup by having each thread process consecutive elements. On uniform-random workloads this gives a ~1.8-2.0x speedup. However, when the index distribution is heavy-tailed (e.g. zipf, or skewed where a few hot rows receive millions of writes), the fast path issues 4 atomicAdds back-to-back from the same warp into consecutive cache lines of the same destination row. The L2 atomic queue cannot drain between the unrolled rounds, and the resulting serialization causes a 4.7x slowdown on fp32 zipf inputs (and ~2x on bf16). Measured on a B200 with dst=[1.72M,128] and nIdx=7.77M: {F1989310065} Proposal https://fb.workplace.com/groups/482605989533128/permalink/1656067795520269/ exhibits highly skewed behavior and saw a regression with the diffs We back the current implementation out temporarily and will be following the approach of pytorch#182675 instead and address the contention problem Test Plan: CI Reviewed By: yjhao Differential Revision: D104098792 Pull Request resolved: pytorch#182693 Approved by: https://github.com/drisspg
…ors (pytorch#175760)" (pytorch#182693) (pytorch#182693) Summary: D94314062 introduced a VecSize=4 fast path in indexFuncLargeIndex that amortizes divmod and index lookup by having each thread process consecutive elements. On uniform-random workloads this gives a ~1.8-2.0x speedup. However, when the index distribution is heavy-tailed (e.g. zipf, or skewed where a few hot rows receive millions of writes), the fast path issues 4 atomicAdds back-to-back from the same warp into consecutive cache lines of the same destination row. The L2 atomic queue cannot drain between the unrolled rounds, and the resulting serialization causes a 4.7x slowdown on fp32 zipf inputs (and ~2x on bf16). Measured on a B200 with dst=[1.72M,128] and nIdx=7.77M: {F1989310065} Proposal https://fb.workplace.com/groups/482605989533128/permalink/1656067795520269/ exhibits highly skewed behavior and saw a regression with the diffs We back the current implementation out temporarily and will be following the approach of pytorch#182675 instead and address the contention problem Test Plan: CI Reviewed By: yjhao Differential Revision: D104098792 Pull Request resolved: pytorch#182693 Approved by: https://github.com/drisspg
…ors (pytorch#175760)" (pytorch#182693) (pytorch#182693) Summary: D94314062 introduced a VecSize=4 fast path in indexFuncLargeIndex that amortizes divmod and index lookup by having each thread process consecutive elements. On uniform-random workloads this gives a ~1.8-2.0x speedup. However, when the index distribution is heavy-tailed (e.g. zipf, or skewed where a few hot rows receive millions of writes), the fast path issues 4 atomicAdds back-to-back from the same warp into consecutive cache lines of the same destination row. The L2 atomic queue cannot drain between the unrolled rounds, and the resulting serialization causes a 4.7x slowdown on fp32 zipf inputs (and ~2x on bf16). Measured on a B200 with dst=[1.72M,128] and nIdx=7.77M: {F1989310065} Proposal https://fb.workplace.com/groups/482605989533128/permalink/1656067795520269/ exhibits highly skewed behavior and saw a regression with the diffs We back the current implementation out temporarily and will be following the approach of pytorch#182675 instead and address the contention problem Test Plan: CI Reviewed By: yjhao Differential Revision: D104098792 Pull Request resolved: pytorch#182693 Approved by: https://github.com/drisspg
Summary:
D94314062 introduced a VecSize=4 fast path in indexFuncLargeIndex that amortizes divmod and index lookup by having each thread process consecutive elements.
On uniform-random workloads this gives a ~1.8-2.0x speedup. However, when the index distribution is heavy-tailed (e.g. zipf, or skewed where a few hot rows receive millions of writes), the fast path issues 4 atomicAdds back-to-back from the same warp into consecutive cache lines of the same destination row.
The L2 atomic queue cannot drain between the unrolled rounds, and the resulting serialization causes a 4.7x slowdown on fp32 zipf inputs (and ~2x on bf16). Measured on a B200 with dst=[1.72M,128] and nIdx=7.77M:
{F1989310065}
Proposal https://fb.workplace.com/groups/482605989533128/permalink/1656067795520269/ exhibits highly skewed behavior and saw a regression with the diffs
We back the current implementation out temporarily and will be following the approach of #182675 instead and address the contention problem
Test Plan: CI
Reviewed By: yjhao
Differential Revision: D104098792