-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fix assertion failure in gemm template lowering #146353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/146353
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 5 Pending, 1 Unrelated FailureAs of commit b212a54 with merge base bc01918 ( NEW FAILURE - The following job has failed:
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. |
This pull request was exported from Phabricator. Differential Revision: D68814625 |
@pytorchbot label "topic: not user facing" |
aaf91e7
to
2b2c301
Compare
Summary: This commit fixes a crash in the gemm template lowering caused by hitting an [assert](https://github.com/pytorch/pytorch/blob/fd515e4f59bfa0ac9faa5185b7a02f3222c4cd08/torch/_inductor/codegen/common.py#L1181) that a buffer was previously removed. The assert triggers because in the first gemm lowering we use a local accumulation buffer, which causes the original buffer name to be added to the `removed_buffers` set. Then in the next gemm lowering we use the global buffer for accumulation, but that buffer name is already in the `removed_buffers` set. The fix is to add a unique suffix to the buffer name to avoid triggering the assert from different gemm lowerings. Test Plan: # Reduced test case ``` TRITON_LOCAL_BUILD=1 buck2 run 'fbcode//mode/opt' fbcode//caffe2/test/inductor:cpu_select_algorithm_cpu -- caffe2.test.inductor.test_cpu_select_algorithm.TestSelectAlgorithmCPU.test_local_and_global_accumulator_cpu_float32 ``` # Original failure ``` $ manifold get aitemplate/tree/aotinductor_cpu/915857944_1.input.predictor.disagg.remote_other /tmp/915857944_1.input.predictor.disagg.remote_other $ buck2 run @//mode/opt //deeplearning/aot_inductor/cpu:cli -- --local-model-path /tmp/915857944_1.input.predictor.disagg.remote_other --submodule remote_other --preset ads_second_stage_ranking_type_1 ``` Differential Revision: D68814625
This pull request was exported from Phabricator. Differential Revision: D68814625 |
@leslie-fang-intel and @frost-intel - could you please help take a look? we found another issue when trying autuotune from Meta internal models, and David comes up with this fix |
2b2c301
to
7fed581
Compare
This pull request was exported from Phabricator. Differential Revision: D68814625 |
Summary: This commit fixes a crash in the gemm template lowering caused by hitting an [assert](https://github.com/pytorch/pytorch/blob/fd515e4f59bfa0ac9faa5185b7a02f3222c4cd08/torch/_inductor/codegen/common.py#L1181) that a buffer was previously removed. The assert triggers because in the first gemm lowering we use a local accumulation buffer, which causes the original buffer name to be added to the `removed_buffers` set. Then in the next gemm lowering we use the global buffer for accumulation, but that buffer name is already in the `removed_buffers` set. The fix is to add a unique suffix to the buffer name to avoid triggering the assert from different gemm lowerings. Test Plan: # Reduced test case ``` TRITON_LOCAL_BUILD=1 buck2 run 'fbcode//mode/opt' fbcode//caffe2/test/inductor:cpu_select_algorithm_cpu -- caffe2.test.inductor.test_cpu_select_algorithm.TestSelectAlgorithmCPU.test_local_and_global_accumulator_cpu_float32 ``` # Original failure ``` $ manifold get aitemplate/tree/aotinductor_cpu/915857944_1.input.predictor.disagg.remote_other /tmp/915857944_1.input.predictor.disagg.remote_other $ buck2 run @//mode/opt //deeplearning/aot_inductor/cpu:cli -- --local-model-path /tmp/915857944_1.input.predictor.disagg.remote_other --submodule remote_other --preset ads_second_stage_ranking_type_1 ``` Differential Revision: D68814625
7fed581
to
b48f0db
Compare
This pull request was exported from Phabricator. Differential Revision: D68814625 |
b48f0db
to
fb64ee6
Compare
Summary: This commit fixes a crash in the gemm template lowering caused by hitting an [assert](https://github.com/pytorch/pytorch/blob/fd515e4f59bfa0ac9faa5185b7a02f3222c4cd08/torch/_inductor/codegen/common.py#L1181) that a buffer was previously removed. The assert triggers because in the first gemm lowering we use a local accumulation buffer, which causes the original buffer name to be added to the `removed_buffers` set. Then in the next gemm lowering we use the global buffer for accumulation, but that buffer name is already in the `removed_buffers` set. The fix is to add a unique suffix to the buffer name to avoid triggering the assert from different gemm lowerings. Test Plan: # Reduced test case ``` TRITON_LOCAL_BUILD=1 buck2 run 'fbcode//mode/opt' fbcode//caffe2/test/inductor:cpu_select_algorithm_cpu -- caffe2.test.inductor.test_cpu_select_algorithm.TestSelectAlgorithmCPU.test_local_and_global_accumulator_cpu_float32 ``` # Original failure ``` $ manifold get aitemplate/tree/aotinductor_cpu/915857944_1.input.predictor.disagg.remote_other /tmp/915857944_1.input.predictor.disagg.remote_other $ buck2 run @//mode/opt //deeplearning/aot_inductor/cpu:cli -- --local-model-path /tmp/915857944_1.input.predictor.disagg.remote_other --submodule remote_other --preset ads_second_stage_ranking_type_1 ``` Differential Revision: D68814625
This pull request was exported from Phabricator. Differential Revision: D68814625 |
fb64ee6
to
a8a5d97
Compare
This pull request was exported from Phabricator. Differential Revision: D68814625 |
Summary: This commit fixes a crash in the gemm template lowering caused by hitting an [assert](https://github.com/pytorch/pytorch/blob/fd515e4f59bfa0ac9faa5185b7a02f3222c4cd08/torch/_inductor/codegen/common.py#L1181) that a buffer was previously removed. The assert triggers because in the first gemm lowering we use a local accumulation buffer, which causes the original buffer name to be added to the `removed_buffers` set. Then in the next gemm lowering we use the global buffer for accumulation, but that buffer name is already in the `removed_buffers` set. The fix is to add a unique suffix to the buffer name to avoid triggering the assert from different gemm lowerings. Test Plan: # Reduced test case ``` TRITON_LOCAL_BUILD=1 buck2 run 'fbcode//mode/opt' fbcode//caffe2/test/inductor:cpu_select_algorithm_cpu -- caffe2.test.inductor.test_cpu_select_algorithm.TestSelectAlgorithmCPU.test_local_and_global_accumulator_cpu_float32 ``` # Original failure ``` $ manifold get aitemplate/tree/aotinductor_cpu/915857944_1.input.predictor.disagg.remote_other /tmp/915857944_1.input.predictor.disagg.remote_other $ buck2 run @//mode/opt //deeplearning/aot_inductor/cpu:cli -- --local-model-path /tmp/915857944_1.input.predictor.disagg.remote_other --submodule remote_other --preset ads_second_stage_ranking_type_1 ``` Differential Revision: D68814625
a8a5d97
to
b212a54
Compare
This pull request was exported from Phabricator. Differential Revision: D68814625 |
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: trunk / win-vs2019-cpu-py3 / test (default, 1, 3, windows.4xlarge.nonephemeral) Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge -f "the failed test is irrelevant with this PR" |
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 |
Summary:
This commit fixes a crash in the gemm template lowering caused by hitting an assert that a buffer was previously removed.
The assert triggers because in the first gemm lowering we use a local accumulation buffer, which causes the original buffer name to be added to the
removed_buffers
set. Then in the next gemm lowering we use the global buffer for accumulation, but that buffer name is already in theremoved_buffers
set.The fix is to add a unique suffix to the buffer name to avoid triggering the assert from different gemm lowerings.
Differential Revision: D68814625
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @amjames @desertfire @chauhang @aakhundov