Skip to content

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
@JohannesGaessler JohannesGaessler marked this pull request as ready for review November 19, 2024 16:24
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
Member

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 ggml-org: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