-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This diff fixes two bugs that I found when creating a custom op and comparing results to PyTorch python implementations (next diff). 1) There is a segfault that occurred when n % 8 != 0 because the ukernel was storing out of bounds. There was an existing test for this case, but it passed because the output shape in the test was mistakenly too big and so no out of bound memory was written to in the test (it had shape m x k instead of shape m x n). This diff fixes the out-of-bound writes and the existing test. 2) The find_min_and_max function was incorrect. This corrects the function and adds tests for the reduction functions (find_min_and_max and compute_sum). (The find_min_and_max function is only used for dynamic quantization; there are existing tests for the quantization, but they passed because the existing find_min_and_max happened to return correct results in the tested case.) Reviewed By: digantdesai Differential Revision: D60773448
- Loading branch information
1 parent
1909171
commit d29a33e
Showing
10 changed files
with
246 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
torchao/experimental/kernels/cpu/aarch64/reduction/compute_sum.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 19 additions & 9 deletions
28
torchao/experimental/kernels/cpu/aarch64/reduction/find_min_and_max.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.