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

ggml-opt: fix data corruption #1022

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

JohannesGaessler
Copy link
Collaborator

Small fixup to #988 .

Since there is now a distinction between statically and dynamically allocated gradients some workarounds for dynamically allocated gradients can be removed. This simplifies the code a bit and reduces the possible causes for the issues in #1020 .

@JohannesGaessler
Copy link
Collaborator Author

Looking at the code I'm finding small defects which (while not a problem currently) could lead to bugs depending on how the API is used. I think it would make sense to accumulate the resulting small changes into a single PR to reduce the time needed for reviewing and testing. I'll convert this to a draft for now.

@JohannesGaessler JohannesGaessler marked this pull request as draft November 19, 2024 12:52
Comment on lines -254 to -255
graph->grads[igrad_dst] = new_graph->grads[igrad_src];
graph->grad_accs[igrad_dst] = new_graph->grad_accs[igrad_src];
Copy link
Collaborator Author

@JohannesGaessler JohannesGaessler Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be why the tests were sometimes crashing. The direction of the copy is wrong so garbage could be written to the graph that is supposed to only be copied.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm test-opt no longer crashes or fails.

@JohannesGaessler JohannesGaessler changed the title ggml-opt: remove workarounds for dynamic tensors ggml-opt: fix data corruption Nov 19, 2024
@JohannesGaessler JohannesGaessler merged commit 3db8570 into ggerganov:master Nov 20, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants