Commit b30f178
Replace assert with CUDA_KERNEL_ASSERT in Reduce.cuh for consistency (#113098)
Related to Fixes #94891
**Problem:**
We are trying to disable `printf` in kernels for Pytorch build on ROCm to fix the `torch.sum()` issues for certain community users by disabling `CUDA_KERNEL_ASSERT`, but found that there are still hostcall printf happening in `ReduceSumProdKernel` used by `torch.sum`.
**Reason:**
The reason is that there are `assert` function calls inside `Reduce.cuh`, ( defined as `__assert_fail` ) which caused `printf`.
**Fix:**
This pull request is to change `assert` to `CUDA_KERNEL_ASSERT` so that we can consistently disable assertion/printf in cuda/hip kernel code.
Pull Request resolved: #113098
Approved by: https://github.com/ezyang1 parent 77e8e8f commit b30f178
File tree
3 files changed
+6
-9
lines changed- aten/src/ATen/native/cuda
3 files changed
+6
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
483 | 482 | | |
484 | 483 | | |
485 | 484 | | |
486 | | - | |
| 485 | + | |
487 | 486 | | |
488 | 487 | | |
489 | 488 | | |
| |||
720 | 719 | | |
721 | 720 | | |
722 | 721 | | |
723 | | - | |
| 722 | + | |
724 | 723 | | |
725 | 724 | | |
726 | 725 | | |
| |||
733 | 732 | | |
734 | 733 | | |
735 | 734 | | |
736 | | - | |
| 735 | + | |
737 | 736 | | |
738 | 737 | | |
739 | 738 | | |
| |||
745 | 744 | | |
746 | 745 | | |
747 | 746 | | |
748 | | - | |
| 747 | + | |
749 | 748 | | |
750 | 749 | | |
751 | 750 | | |
752 | 751 | | |
753 | 752 | | |
754 | | - | |
| 753 | + | |
755 | 754 | | |
756 | 755 | | |
757 | 756 | | |
| |||
773 | 772 | | |
774 | 773 | | |
775 | 774 | | |
776 | | - | |
| 775 | + | |
777 | 776 | | |
778 | 777 | | |
779 | 778 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
0 commit comments