Skip to content
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

Bug fixes #717

Merged
merged 1 commit into from
Aug 20, 2024
Merged

Bug fixes #717

merged 1 commit into from
Aug 20, 2024

Conversation

metascroy
Copy link
Contributor

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

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
Copy link

pytorch-bot bot commented Aug 20, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/717

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit d29a33e with merge base 1909171 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 20, 2024
@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D60773448

@facebook-github-bot facebook-github-bot merged commit 227d4bf into pytorch:main Aug 20, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants