ggerganov / ggml

Tensor library for machine learning
MIT License
11.25k stars 1.05k forks source link

ggml-opt: fix data corruption #1022

Closed JohannesGaessler closed 1 day ago

JohannesGaessler commented 3 days ago

Small fixup to https://github.com/ggerganov/ggml/pull/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 https://github.com/ggerganov/ggml/pull/1020 .

JohannesGaessler commented 3 days ago

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.